[Debug] remove return types that break FC badly

This commit is contained in:
Nicolas Grekas 2019-10-22 18:51:37 +02:00
parent effae8a643
commit cb5ef6ec18
2 changed files with 10 additions and 4 deletions

View File

@ -36,12 +36,18 @@ class FlattenException
private $file;
private $line;
/**
* @return static
*/
public static function create(\Exception $exception, $statusCode = null, array $headers = [])
{
return static::createFromThrowable($exception, $statusCode, $headers);
}
public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): self
/**
* @return static
*/
public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = [])
{
$e = new static();
$e->setMessage($exception->getMessage());

View File

@ -38,12 +38,12 @@ class FlattenException extends LegacyFlattenException
private $file;
private $line;
public static function create(\Exception $exception, $statusCode = null, array $headers = []): LegacyFlattenException
public static function create(\Exception $exception, $statusCode = null, array $headers = []): self
{
return static::createFromThrowable($exception, $statusCode, $headers);
}
public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): LegacyFlattenException
public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): self
{
$e = new static();
$e->setMessage($exception->getMessage());
@ -228,7 +228,7 @@ class FlattenException extends LegacyFlattenException
/**
* @return $this
*/
public function setPrevious(LegacyFlattenException $previous): self
final public function setPrevious(LegacyFlattenException $previous): self
{
$this->previous = $previous;