-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RequireExtends and RequireImplements attributes
- Loading branch information
1 parent
3ffff94
commit 189e5ad
Showing
6 changed files
with
141 additions
and
1 deletion.
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
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
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
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
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,65 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
class RequireClass | ||
{ | ||
} | ||
|
||
/** | ||
* @phpstan-require-extends RequireClass | ||
*/ | ||
trait RequireExtendsAttributeTest | ||
{ | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
* @phpstan-require-extends RequireClass this is the class that needs to be extended | ||
*/ | ||
#[Property(name:'string')] | ||
trait RequireExtendsAttributeTest2 | ||
{ | ||
} | ||
|
||
/** | ||
* @psalm-require-extends RequireClass | ||
*/ | ||
trait RequireExtendsAttributeTest3 | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
class RequireClass | ||
{ | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\RequireExtends('RequireClass')] | ||
trait RequireExtendsAttributeTest | ||
{ | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
#[Property(name:'string')] | ||
#[\PhpStaticAnalysis\Attributes\RequireExtends('RequireClass')] // this is the class that needs to be extended | ||
trait RequireExtendsAttributeTest2 | ||
{ | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\RequireExtends('RequireClass')] | ||
trait RequireExtendsAttributeTest3 | ||
{ | ||
} | ||
|
||
?> |
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,65 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
interface RequireInterface | ||
{ | ||
} | ||
|
||
/** | ||
* @phpstan-require-implements RequireInterface | ||
*/ | ||
trait RequireImplementsAttributeTest | ||
{ | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
* @phpstan-require-implements RequireInterface this is the interface that needs to be implemented | ||
*/ | ||
#[Property(name:'string')] | ||
trait RequireImplementsAttributeTest2 | ||
{ | ||
} | ||
|
||
/** | ||
* @psalm-require-implements RequireInterface | ||
*/ | ||
trait RequireImplementsAttributeTest3 | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
interface RequireInterface | ||
{ | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\RequireImplements('RequireInterface')] | ||
trait RequireImplementsAttributeTest | ||
{ | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
#[Property(name:'string')] | ||
#[\PhpStaticAnalysis\Attributes\RequireImplements('RequireInterface')] // this is the interface that needs to be implemented | ||
trait RequireImplementsAttributeTest2 | ||
{ | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\RequireImplements('RequireInterface')] | ||
trait RequireImplementsAttributeTest3 | ||
{ | ||
} | ||
|
||
?> |