-
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add constructor fixture, just to verify alter behavior
- Loading branch information
1 parent
56afd54
commit 5394ff6
Showing
2 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
tests/Issues/AddClassDependency/Fixture/strick_with_constructor.php.inc
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,43 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Issues\AddClassDependency\Fixture; | ||
|
||
use Rector\Tests\Issues\AddClassDependency\Source\SomeAutowiredService; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
|
||
final class StickWithConstructor extends Controller | ||
{ | ||
public function __construct( | ||
private SomeAutowiredService $someAutowiredService, | ||
) { | ||
} | ||
|
||
public function configure() | ||
{ | ||
$someType = $this->get('validator'); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Issues\AddClassDependency\Fixture; | ||
|
||
use Rector\Tests\Issues\AddClassDependency\Source\SomeAutowiredService; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
|
||
final class StickWithConstructor extends Controller | ||
{ | ||
public function __construct( | ||
private SomeAutowiredService $someAutowiredService, private readonly \Symfony\Component\Validator\Validator\ValidatorInterface $validator, | ||
) { | ||
} | ||
|
||
public function configure() | ||
{ | ||
$someType = $this->validator; | ||
} | ||
} | ||
|
||
?> |
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