Files
FreshRSS/lib/Minz/Hook.php
Alexis Degrugillier dac275ce3a Add support for extension priority (#8038)
Extension can now define their hook priority. This will allow to define the order in which hooks are triggered.

See #7110

Closes #7110

Changes proposed in this pull request:

- Add support for extension priority

How to test the feature manually:

1. Create an extension with 2 hooks on the same hook type but different priority
2. The hooks must be prepending the title with different values
3. Validate that changing the hook priority changes the final title accordingly.
2025-10-01 11:01:31 +02:00

21 lines
341 B
PHP

<?php
declare(strict_types=1);
class Minz_Hook {
public const DEFAULT_PRIORITY = 0;
public function __construct(
private readonly \Closure $function,
private readonly int $priority,
) {
}
public function getFunction(): \Closure {
return $this->function;
}
public function getPriority(): int {
return $this->priority;
}
}