Skip to content

Commit

Permalink
bug #40388 [ErrorHandler] Added missing type annotations to FlattenEx…
Browse files Browse the repository at this point in the history
…ception (derrabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Added missing type annotations to FlattenException

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40385
| License       | MIT
| Doc PR        | N/A

This class has no constructor where the properties' types could be inferred from. If we want potential contributors (and our serializer, see #40385) to read that code, I think it's only fair that we document the property types via doc blocks.

Commits
-------

d68832e [ErrorHandler] Added missing type annotations to FlattenException
  • Loading branch information
fabpot committed Mar 9, 2021
2 parents f7ce401 + d68832e commit 72c6489
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/Symfony/Component/ErrorHandler/Exception/FlattenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,40 @@
*/
class FlattenException extends LegacyFlattenException
{
/** @var string */
private $message;

/** @var int|string */
private $code;

/** @var self|null */
private $previous;

/** @var array */
private $trace;

/** @var string */
private $traceAsString;

/** @var string */
private $class;

/** @var int */
private $statusCode;

/** @var string */
private $statusText;

/** @var array */
private $headers;

/** @var string */
private $file;

/** @var int */
private $line;

/** @var string|null */
private $asString;

public static function create(\Exception $exception, $statusCode = null, array $headers = []): self
Expand Down Expand Up @@ -104,6 +127,8 @@ public function getStatusCode(): int
}

/**
* @param int $code
*
* @return $this
*/
public function setStatusCode($code): self
Expand Down Expand Up @@ -134,6 +159,8 @@ public function getClass(): string
}

/**
* @param string $class
*
* @return $this
*/
public function setClass($class): self
Expand All @@ -149,6 +176,8 @@ public function getFile(): string
}

/**
* @param string $file
*
* @return $this
*/
public function setFile($file): self
Expand All @@ -164,6 +193,8 @@ public function getLine(): int
}

/**
* @param int $line
*
* @return $this
*/
public function setLine($line): self
Expand Down Expand Up @@ -191,6 +222,8 @@ public function getMessage(): string
}

/**
* @param string $message
*
* @return $this
*/
public function setMessage($message): self
Expand All @@ -215,6 +248,8 @@ public function getCode()
}

/**
* @param int|string $code
*
* @return $this
*/
public function setCode($code): self
Expand Down Expand Up @@ -282,6 +317,10 @@ public function setTraceFromThrowable(\Throwable $throwable): self
}

/**
* @param array $trace
* @param string|null $file
* @param int|null $line
*
* @return $this
*/
public function setTrace($trace, $file, $line): self
Expand Down

0 comments on commit 72c6489

Please sign in to comment.