File tree Expand file tree Collapse file tree 3 files changed +80
-0
lines changed
rules/coding-style/tests/Rector/Namespace_/ImportFullyQualifiedNamesRector Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \CodingStyle \Tests \Rector \Namespace_ \ImportFullyQualifiedNamesRector \FixtureAttributes ;
4+
5+ use Symfony \Component \Routing \Annotation \Route ;
6+
7+ final class SymfonyRouteAttribute
8+ {
9+ #[Route(path: 'access-denied ' , name: \Rector \CodingStyle \Tests \Rector \Namespace_ \ImportFullyQualifiedNamesRector \Source \ValueObject \RouteName::ACCESS_DENIED )]
10+ public function __invoke ()
11+ {
12+ }
13+ }
14+
15+ ?>
16+ -----
17+ <?php
18+
19+ namespace Rector \CodingStyle \Tests \Rector \Namespace_ \ImportFullyQualifiedNamesRector \FixtureAttributes ;
20+
21+ use Rector \CodingStyle \Tests \Rector \Namespace_ \ImportFullyQualifiedNamesRector \Source \ValueObject \RouteName ;
22+ use Symfony \Component \Routing \Annotation \Route ;
23+
24+ final class SymfonyRouteAttribute
25+ {
26+ #[Route(path: 'access-denied ' , name: RouteName::ACCESS_DENIED )]
27+ public function __invoke ()
28+ {
29+ }
30+ }
31+
32+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \CodingStyle \Tests \Rector \Namespace_ \ImportFullyQualifiedNamesRector ;
6+
7+ use Iterator ;
8+ use Rector \Core \Configuration \Option ;
9+ use Rector \Renaming \Rector \Name \RenameClassRector ;
10+ use Rector \Testing \PHPUnit \AbstractRectorTestCase ;
11+ use Symplify \SmartFileSystem \SmartFileInfo ;
12+
13+ /**
14+ * @see \Rector\PostRector\Rector\NameImportingPostRector
15+ */
16+ final class Php80Test extends AbstractRectorTestCase
17+ {
18+ /**
19+ * @requires PHP 8.0
20+ * @dataProvider provideData()
21+ */
22+ public function test (SmartFileInfo $ fileInfo ): void
23+ {
24+ $ this ->setParameter (Option::AUTO_IMPORT_NAMES , true );
25+
26+ $ this ->doTestFileInfo ($ fileInfo );
27+ }
28+
29+ public function provideData (): Iterator
30+ {
31+ return $ this ->yieldFilesFromDirectory (__DIR__ . '/FixtureAttributes ' );
32+ }
33+
34+ protected function getRectorClass (): string
35+ {
36+ return RenameClassRector::class;
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \CodingStyle \Tests \Rector \Namespace_ \ImportFullyQualifiedNamesRector \Source \ValueObject ;
6+
7+ final class RouteName
8+ {
9+ public const ACCESS_DENIED = 'access-denied ' ;
10+ }
You can’t perform that action at this time.
0 commit comments