-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "psalm/attributes", | ||
"type": "library", | ||
"description": "A collection of PHP 8 Attributes that Psalm can understand", | ||
"keywords": [ | ||
"php", | ||
"attributes", | ||
"static analysis" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Matthew Brown" | ||
} | ||
], | ||
"require": { | ||
"php": ">=8" | ||
}, | ||
"require-dev": { | ||
"vimeo/psalm": "dev-master" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Psalm\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Psalm\\Tests\\": "tests/" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"scripts": { | ||
"all-tests": [ | ||
"./psalm" | ||
], | ||
"psalm": "./psalm" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="1" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
/** | ||
* Exists just in case someone wants to grab all Psalm attributes during reflection | ||
*/ | ||
abstract class BaseAttribute | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
use Attribute; | ||
|
||
#[Attribute] | ||
#[Immutable] | ||
final class Deprecated extends BaseAttribute | ||
{ | ||
public function __construct( | ||
public ?string $since_version = null, | ||
public ?string $reason = null, | ||
public ?string $replacement = null, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS)] | ||
#[Immutable] | ||
final class ExternalMutationFree extends BaseAttribute | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS)] | ||
#[Immutable] | ||
final class Immutable extends BaseAttribute | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
use Attribute; | ||
|
||
#[Attribute] | ||
#[Immutable] | ||
final class Internal extends BaseAttribute | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD)] | ||
#[Immutable] | ||
final class Pure extends BaseAttribute | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Psalm; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::TARGET_PROPERTY)] | ||
#[Immutable] | ||
final class Readonly extends BaseAttribute | ||
{} |