mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 20:23:49 +01:00
add test case for #1595
This commit is contained in:
parent
f6751ac022
commit
2f0396d462
@ -150,7 +150,9 @@ CODE_SAMPLE
|
||||
->getNode();
|
||||
} else {
|
||||
$newProperty = $propertyBuilder->getNode();
|
||||
$this->docBlockManipulator->changeVarTag($newProperty, $propertyTypesAsString);
|
||||
if ($propertyTypesAsString) {
|
||||
$this->docBlockManipulator->changeVarTag($newProperty, $propertyTypesAsString);
|
||||
}
|
||||
}
|
||||
|
||||
$newProperties[] = $newProperty;
|
||||
|
@ -17,6 +17,7 @@ final class CompleteDynamicPropertiesRectorTest extends AbstractRectorTestCase
|
||||
__DIR__ . '/Fixture/skip_trait_used.php.inc',
|
||||
__DIR__ . '/Fixture/skip_magic_parent.php.inc',
|
||||
__DIR__ . '/Fixture/skip_magic.php.inc',
|
||||
__DIR__ . '/Fixture/skip_laravel_closure_binding.php.inc',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\CodeQuality\Tests\Rector\Class_\CompleteDynamicPropertiesRector\Fixture;
|
||||
|
||||
class SkipLaravelClosureBinding
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function registerCollectionMacros(): void
|
||||
{
|
||||
Collection::macro('ksort', function (): Collection {
|
||||
// macros callbacks are bound to collection so we can safely access
|
||||
// protected Collection::items
|
||||
$list = $this->items;
|
||||
ksort($list);
|
||||
|
||||
return new static($list);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user