Including additional properties from throwables
This release comes with support for including additional properties from the throwable into the encoded version of the throwable using the AdditionalPropertiesInterface
. As this is a BC break on the (return) type hint of the encoded throwable, this feature requires a new major release.
<?php
declare(strict_types=1);
use WyriHaximus\AdditionalPropertiesInterface;
use WyriHaximus\ExposeTraceTrait;
final class AdditionalPropertiesException extends Exception implements AdditionalPropertiesInterface
{
use ExposeTraceTrait;
private int $time;
public function __construct(int $time)
{
parent::__construct('Additional properties exception raised');
$this->time = $time;
}
public function time(): int
{
return $this->time;
}
/**
* @return array<string>
*/
public function additionalProperties(): array
{
return ['time'];
}
}
List view
0 issues of 0 selected
There are no open issues in this milestone
Add issues to milestones to help organize your work for a particular release or project. Find and add issues with no milestones in this repo.