Files
php-flasher/src/Prime/Stamp/PriorityStamp.php
T
Younes ENNAJI 9239063159 Simplify PHPDoc comments in Stamp classes and PhpStorm meta files
Removes verbose documentation and comments from:
- Stamp classes (PriorityStamp, HopsStamp, DelayStamp, etc.)
- .phpstorm.meta.php files (Prime, Noty, Notyf, SweetAlert, Toastr)
- Factory and EventDispatcher classes
2026-01-16 00:23:16 +01:00

35 lines
687 B
PHP

<?php
declare(strict_types=1);
namespace Flasher\Prime\Stamp;
final readonly class PriorityStamp implements OrderableStampInterface, PresentableStampInterface, StampInterface
{
public function __construct(private int $priority)
{
}
public function getPriority(): int
{
return $this->priority;
}
public function compare(StampInterface $orderable): int
{
if (!$orderable instanceof self) {
return 1;
}
return $this->priority - $orderable->priority;
}
/**
* @return array{priority: int}
*/
public function toArray(): array
{
return ['priority' => $this->priority];
}
}