mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
9239063159
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
35 lines
687 B
PHP
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];
|
|
}
|
|
}
|