mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-21 07:52:01 +02:00
add defined test case
This commit is contained in:
parent
b16ebe6be2
commit
3389d71219
@ -9,7 +9,11 @@ final class CompleteDynamicPropertiesRectorTest extends AbstractRectorTestCase
|
||||
{
|
||||
public function test(): void
|
||||
{
|
||||
$this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/multiple_types.php.inc']);
|
||||
$this->doTestFiles([
|
||||
__DIR__ . '/Fixture/fixture.php.inc',
|
||||
__DIR__ . '/Fixture/multiple_types.php.inc',
|
||||
__DIR__ . '/Fixture/skip_defined.php.inc',
|
||||
]);
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\CodeQuality\Tests\Rector\Class_\CompleteDynamicPropertiesRector\Fixture;
|
||||
|
||||
class SkipDefined
|
||||
{
|
||||
private $value;
|
||||
public function set()
|
||||
{
|
||||
$this->value = 5;
|
||||
}
|
||||
}
|
@ -96,6 +96,7 @@ CODE_SAMPLE
|
||||
return null;
|
||||
}
|
||||
|
||||
// type is already set → skip
|
||||
if ($node->type !== null) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user