-
-
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 TemplateCovariant and TemplateContravariant attributes
- Loading branch information
1 parent
33ceb3e
commit 629f2f4
Showing
5 changed files
with
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use Exception; | ||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
/** | ||
* @deprecated | ||
* @template-contravariant T1 | ||
* @template-contravariant T2 of Exception | ||
* @phpstan-template-contravariant T3 | ||
*/ | ||
#[Property(name:'string')] | ||
class TemplateContravariantAttributeTest | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use Exception; | ||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
#[Property(name:'string')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateContravariant('T1')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateContravariant('T2', 'Exception')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateContravariant('T3')] | ||
class TemplateContravariantAttributeTest | ||
{ | ||
} | ||
|
||
?> |
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,41 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use Exception; | ||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
/** | ||
* @deprecated | ||
* @template-covariant T1 | ||
* @template-covariant T2 of Exception | ||
* @psalm-template-covariant T3 | ||
* @phpstan-template-covariant T4 | ||
*/ | ||
#[Property(name:'string')] | ||
class TemplateCovariantAttributeTest | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use Exception; | ||
use PhpStaticAnalysis\Attributes\Property; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
#[Property(name:'string')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateCovariant('T1')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateCovariant('T2', 'Exception')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateCovariant('T3')] | ||
#[\PhpStaticAnalysis\Attributes\TemplateCovariant('T4')] | ||
class TemplateCovariantAttributeTest | ||
{ | ||
} | ||
|
||
?> |