Skip to content

Commit 8eed061

Browse files
committed
[DeadCode] Handle crash when parent does not has default param and child has
1 parent afd6b04 commit 8eed061

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Fixture;
4+
5+
use Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Source\SomeParentWithoutDefaultParam;
6+
7+
final class SkipParentDoesNotHasDefaultParam extends SomeParentWithoutDefaultParam
8+
{
9+
public function __construct(array $value = [])
10+
{
11+
parent::__construct($value);
12+
}
13+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Source;
6+
7+
class SomeParentWithoutDefaultParam
8+
{
9+
public function __construct(array $value)
10+
{
11+
}
12+
}

0 commit comments

Comments
 (0)