skip used property

This commit is contained in:
TomasVotruba 2020-02-23 23:33:28 +01:00
parent ee77667778
commit 5c3aaf2ddc
2 changed files with 41 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}
}