-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor doctrine/annotation from dynamic to own static-reflection pa…
…rser (#5974) * remove doctrine/annotations * Refactor doctrine/annotation parser to static reflection with phpdoc-parser * remove doctirne-annotation-parser-syncer * remove annotation stubs * use nodes * almost there * [ci-review] Rector Rectify * skip temporary * phpstan: remove fixed messages Co-authored-by: kaizen-ci <info@kaizen-ci.org>
- Loading branch information
1 parent
d2e4c0a
commit b2412ad
Showing
213 changed files
with
2,683 additions
and
6,703 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
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
8 changes: 0 additions & 8 deletions
8
packages-tests/BetterPhpDocParser/PhpDocInfo/PhpDocInfoPrinter/FixtureBasic/doc2.txt
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages-tests/BetterPhpDocParser/PhpDocInfo/PhpDocInfoPrinter/FixtureBasic/template_as.txt
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 @@ | ||
/** @template T as int */ |
1 change: 1 addition & 0 deletions
1
packages-tests/BetterPhpDocParser/PhpDocInfo/PhpDocInfoPrinter/FixtureBasic/template_of.txt
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 @@ | ||
/** @template T of int */ |
3 changes: 3 additions & 0 deletions
3
.../BetterPhpDocParser/PhpDocInfo/PhpDocInfoPrinter/FixtureCallable/callable_mixed_mixed.txt
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,3 @@ | ||
/** | ||
* @var (callable(mixed $value, string $typeName):mixed)[] | ||
*/ |
119 changes: 0 additions & 119 deletions
119
packages-tests/BetterPhpDocParser/PhpDocParser/AbstractPhpDocInfoTest.php
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
...-tests/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/ArrayParserTest.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,57 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\BetterPhpDocParser\PhpDocParser\StaticDoctrineAnnotationParser; | ||
|
||
use Iterator; | ||
use Rector\BetterPhpDocParser\PhpDocInfo\TokenIteratorFactory; | ||
use Rector\BetterPhpDocParser\PhpDocParser\StaticDoctrineAnnotationParser\ArrayParser; | ||
use Rector\Core\HttpKernel\RectorKernel; | ||
use Symplify\PackageBuilder\Testing\AbstractKernelTestCase; | ||
|
||
final class ArrayParserTest extends AbstractKernelTestCase | ||
{ | ||
/** | ||
* @var ArrayParser | ||
*/ | ||
private $arrayParser; | ||
|
||
/** | ||
* @var TokenIteratorFactory | ||
*/ | ||
private $tokenIteratorFactory; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->bootKernel(RectorKernel::class); | ||
|
||
$this->arrayParser = $this->getService(ArrayParser::class); | ||
$this->tokenIteratorFactory = $this->getService(TokenIteratorFactory::class); | ||
} | ||
|
||
/** | ||
* @dataProvider provideData() | ||
* @param array<string, string>|string[] $expectedArray | ||
*/ | ||
public function test(string $docContent, array $expectedArray): void | ||
{ | ||
$betterTokenIterator = $this->tokenIteratorFactory->create($docContent); | ||
|
||
$array = $this->arrayParser->parserArray($betterTokenIterator); | ||
$this->assertSame($expectedArray, $array); | ||
} | ||
|
||
public function provideData(): Iterator | ||
{ | ||
yield ['{key: "value"}', [ | ||
'key' => '"value"', | ||
]]; | ||
|
||
yield ['{"key": "value"}', [ | ||
'"key"' => '"value"', | ||
]]; | ||
|
||
yield ['{"value", "value2"}', ['"value"', '"value2"']]; | ||
} | ||
} |
Oops, something went wrong.