add test case for #1244 (#2525)

add test case for #1244
This commit is contained in:
Tomas Votruba 2019-12-29 21:24:16 +01:00 committed by GitHub
commit 4f826fb13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,32 @@
<?php
namespace Rector\DeadCode\Tests\Rector\Property\RemoveUnusedPrivatePropertyRector\MagicallyAssignedFetch;
class WriteOnly
{
private $seemsUnused;
public function getValue()
{
foreach ([1, 2, 3] as $key) {
$this->seemsUnused[] = 'foo';
}
}
}
?>
-----
<?php
namespace Rector\DeadCode\Tests\Rector\Property\RemoveUnusedPrivatePropertyRector\MagicallyAssignedFetch;
class WriteOnly
{
public function getValue()
{
foreach ([1, 2, 3] as $key) {
}
}
}
?>