Expand action and clean up code.

This commit is contained in:
James Cole
2023-11-04 14:09:51 +01:00
parent 6eabe5fa8c
commit 5a35960434
23 changed files with 119 additions and 93 deletions

View File

@@ -34,11 +34,10 @@ use Throwable;
*/
final class IntervalException extends Exception
{
public array $availableIntervals;
public Periodicity $periodicity;
/** @var string */
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)
{
@@ -60,8 +59,7 @@ final class IntervalException extends Exception
array $intervals,
int $code = 0,
?Throwable $previous = null
): IntervalException
{
): IntervalException {
$message = sprintf(
'The periodicity %s is unknown. Choose one of available periodicity: %s',
$periodicity->name,