php-commerce/Exceptions/PauseLimitExceededException.php

28 lines
647 B
PHP
Raw Permalink Normal View History

2026-01-27 00:24:22 +00:00
<?php
declare(strict_types=1);
namespace Core\Mod\Commerce\Exceptions;
2026-01-27 00:24:22 +00:00
use Exception;
use Core\Mod\Commerce\Models\Subscription;
2026-01-27 00:24:22 +00:00
/**
* Exception thrown when a subscription has exceeded its pause cycle limit.
*/
class PauseLimitExceededException extends Exception
{
public function __construct(
public readonly Subscription $subscription,
public readonly int $maxPauseCycles,
string $message = '',
) {
$message = $message ?: sprintf(
'Subscription has reached the maximum number of pause cycles (%d).',
$maxPauseCycles
);
parent::__construct($message);
}
}