mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-15 23:52:23 +00:00
skip used property
This commit is contained in:
parent
ee77667778
commit
5c3aaf2ddc
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\DeadCode\Tests\Rector\Property\RemoveUnusedPrivatePropertyRector\Fixture;
|
||||
|
||||
trait TraitA
|
||||
{
|
||||
use TraitB;
|
||||
}
|
||||
|
||||
trait TraitB
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
echo $this->property;
|
||||
}
|
||||
}
|
||||
|
||||
trait SkipTraitInTraitUser
|
||||
{
|
||||
use TraitA;
|
||||
|
||||
private $property = 10;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\DeadCode\Tests\Rector\Property\RemoveUnusedPrivatePropertyRector\Fixture;
|
||||
|
||||
class SkipTraitUsedProperty
|
||||
{
|
||||
use PropertyUser;
|
||||
|
||||
private $usedProperty = 10;
|
||||
}
|
||||
|
||||
trait PropertyUser
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
return $this->usedProperty;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user