-
-
Notifications
You must be signed in to change notification settings - Fork 738
Closed
rectorphp/rector-src
#7776Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/46ca86bb-337a-4bad-81af-40d1ab7929c8
<?php
class InternalServerException
{
private Throwable $stack = [];
public function __construct(string $message = 'Server error', int $code = 500, ?Throwable $previous = null)
{
echo 'Error thrown : ' . $message . ' (' . $code . ')';
if (!is_null($previous)) {
$this->stack[] = $previous;
}
}
}
class BlogException extends InternalServerException
{
public function __construct(string $message = 'Blog handling error', int $code = 570, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}Responsible rules
RemoveParentDelegatingConstructorRector
Expected Behavior
As the child constructor provide default parameters' values (which may be different than parent's ones) if necessary, I think that the child constructor is still relevant.
samsonasik