-
-
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 DefineType and ImportType attributes
- Loading branch information
1 parent
19cdb95
commit a84ba9d
Showing
44 changed files
with
457 additions
and
239 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
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
29 changes: 29 additions & 0 deletions
29
tests/AnnotationsToAttributesWithTypeAttributeForTypeClassRectorTest.php
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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule; | ||
|
||
use Iterator; | ||
use Rector\Testing\PHPUnit\AbstractRectorTestCase; | ||
|
||
final class AnnotationsToAttributesWithTypeAttributeForTypeClassRectorTest extends AbstractRectorTestCase | ||
{ | ||
/** | ||
* @dataProvider provideData() | ||
*/ | ||
public function test(string $filePath): void | ||
{ | ||
$this->doTestFile($filePath); | ||
} | ||
|
||
public static function provideData(): Iterator | ||
{ | ||
yield [__DIR__ . '/SpecialFixture/TypeAttributeTestForTypeClassAnnotation.php.inc']; | ||
} | ||
|
||
public function provideConfigFilePath(): string | ||
{ | ||
return __DIR__ . '/config/configured-rule-with-type-attribute-for-type-class.php'; | ||
} | ||
} |
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,35 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\DefineType; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
* @phpstan-type StringArray string[] | ||
* @psalm-type IntArray int[] | ||
*/ | ||
#[DefineType(FloatArray: 'float[]')] | ||
class DefineTypeAttributeTest | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\DefineType; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
#[DefineType(FloatArray: 'float[]')] | ||
#[DefineType(StringArray: 'string[]')] | ||
#[DefineType(IntArray: 'int[]')] | ||
class DefineTypeAttributeTest | ||
{ | ||
} | ||
|
||
?> |
Oops, something went wrong.