-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[type-declaration] Add typed property using trait test fixture
- Loading branch information
1 parent
c59c83a
commit 1c39637
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...ector/Property/TypedPropertyFromStrictConstructorRector/Fixture/include_trait_as_well.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,23 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
use Doctrine\ORM\EntityManagerInterface; | ||
use Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source\TraitUsingEntityManager; | ||
|
||
final class IncludeTraitAsWell | ||
{ | ||
use TraitUsingEntityManager; | ||
|
||
/** | ||
* @var EntityManagerInterface | ||
*/ | ||
private $entityManager; | ||
|
||
public function __construct(EntityManagerInterface $entityManager) | ||
{ | ||
$this->entityManager = $entityManager; | ||
} | ||
} | ||
|
||
?> |
44 changes: 44 additions & 0 deletions
44
...r/Property/TypedPropertyFromStrictConstructorRector/Fixture/include_trait_as_well.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,44 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
use Doctrine\ORM\EntityManagerInterface; | ||
use Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source\TraitUsingEntityManager; | ||
|
||
final class IncludeTraitAsWell | ||
{ | ||
use TraitUsingEntityManager; | ||
|
||
/** | ||
* @var EntityManagerInterface | ||
*/ | ||
private $entityManager; | ||
|
||
public function __construct(EntityManagerInterface $entityManager) | ||
{ | ||
$this->entityManager = $entityManager; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
use Doctrine\ORM\EntityManagerInterface; | ||
use Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source\TraitUsingEntityManager; | ||
|
||
final class IncludeTraitAsWell | ||
{ | ||
use TraitUsingEntityManager; | ||
|
||
private EntityManagerInterface $entityManager; | ||
|
||
public function __construct(EntityManagerInterface $entityManager) | ||
{ | ||
$this->entityManager = $entityManager; | ||
} | ||
} | ||
|
||
?> |
11 changes: 11 additions & 0 deletions
11
...ctor/Property/TypedPropertyFromStrictConstructorRector/Source/TraitUsingEntityManager.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,11 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source; | ||
|
||
trait TraitUsingEntityManager | ||
{ | ||
public function run() | ||
{ | ||
$this->entityManager->flush(); | ||
} | ||
} |