[ErrorHandler] add missing return types
This commit is contained in:
parent
7ec445b130
commit
810e4a136f
|
@ -45,8 +45,10 @@ use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
|
|||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
final class ErrorHandler
|
||||
class ErrorHandler
|
||||
{
|
||||
private $levels = [
|
||||
E_DEPRECATED => 'Deprecated',
|
||||
|
|
|
@ -83,7 +83,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $e;
|
||||
}
|
||||
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
$exceptions = [];
|
||||
foreach (array_merge([$this], $this->getAllPrevious()) as $exception) {
|
||||
|
@ -97,7 +97,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $exceptions;
|
||||
}
|
||||
|
||||
public function getStatusCode()
|
||||
public function getStatusCode(): int
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getHeaders()
|
||||
public function getHeaders(): array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getClass()
|
||||
public function getClass(): string
|
||||
{
|
||||
return $this->class;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getFile()
|
||||
public function getFile(): string
|
||||
{
|
||||
return $this->file;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getLine()
|
||||
public function getLine(): int
|
||||
{
|
||||
return $this->line;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getStatusText()
|
||||
public function getStatusText(): string
|
||||
{
|
||||
return $this->statusText;
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getMessage()
|
||||
public function getMessage(): string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
public function getCode(): int
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
@ -220,6 +220,9 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self|null
|
||||
*/
|
||||
public function getPrevious()
|
||||
{
|
||||
return $this->previous;
|
||||
|
@ -235,7 +238,10 @@ class FlattenException extends LegacyFlattenException
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getAllPrevious()
|
||||
/**
|
||||
* @return self[]
|
||||
*/
|
||||
public function getAllPrevious(): array
|
||||
{
|
||||
$exceptions = [];
|
||||
$e = $this;
|
||||
|
@ -246,7 +252,7 @@ class FlattenException extends LegacyFlattenException
|
|||
return $exceptions;
|
||||
}
|
||||
|
||||
public function getTrace()
|
||||
public function getTrace(): array
|
||||
{
|
||||
return $this->trace;
|
||||
}
|
||||
|
@ -261,7 +267,10 @@ class FlattenException extends LegacyFlattenException
|
|||
$this->setTraceFromThrowable($exception);
|
||||
}
|
||||
|
||||
public function setTraceFromThrowable(\Throwable $throwable)
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setTraceFromThrowable(\Throwable $throwable): self
|
||||
{
|
||||
$this->traceAsString = $throwable->getTraceAsString();
|
||||
|
||||
|
@ -351,19 +360,22 @@ class FlattenException extends LegacyFlattenException
|
|||
return $array['__PHP_Incomplete_Class_Name'];
|
||||
}
|
||||
|
||||
public function getTraceAsString()
|
||||
public function getTraceAsString(): ?string
|
||||
{
|
||||
return $this->traceAsString;
|
||||
}
|
||||
|
||||
public function setAsString(?string $asString)
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setAsString(?string $asString): self
|
||||
{
|
||||
$this->asString = $asString;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAsString()
|
||||
public function getAsString(): string
|
||||
{
|
||||
if (null !== $this->asString) {
|
||||
return $this->asString;
|
||||
|
|
Reference in New Issue