Skip to content

Commit

Permalink
fix for Fatal error: Default value for property of type YaPro\Monolog…
Browse files Browse the repository at this point in the history
…Ext\mixed may not be null. Use the nullable type ?YaPro\MonologExt\mixed to allow null default value
  • Loading branch information
yapro committed May 15, 2024
1 parent c0971bd commit 4489593
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ExtraDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
*/
class ExtraDataException extends Exception implements ExtraDataExceptionInterface
{
private mixed $extraData = null;
private $extraData = null;

public function __construct(string $message = '', mixed $extraData = null, Throwable $previous = null, $code = 0)
public function __construct(string $message = '', $extraData = null, Throwable $previous = null, $code = 0)
{
// если понадобится использовать $code чаще чем $previous, то сделаем параметры mixed, а тут проверим и
// поменяем местами переменные, чтобы правильно их передать в parent
parent::__construct($message, $code, $previous);
$this->extraData = $extraData;
}

public function getData(): mixed
public function getData()
{
return $this->extraData;
}

public function setData(mixed $extraData): self
public function setData($extraData): self
{
$this->extraData = $extraData;

Expand Down

0 comments on commit 4489593

Please sign in to comment.