| 1 | <?php | ||
| 8 | class Interceptor | ||
| 9 | { | ||
| 10 | /** | ||
| 11 | * @var Interceptor | ||
| 12 | */ | ||
| 13 | private $next; | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @var callable | ||
| 17 | */ | ||
| 18 | private $callback; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Chain constructor. | ||
| 22 | */ | ||
| 23 | private function __construct() | ||
| 28 | |||
| 29 | /** | ||
| 30 | * @return Interceptor | ||
| 31 | */ | ||
| 32 | public static function createBase(): Interceptor | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @param callable $callback | ||
| 39 | * | ||
| 40 | * @return Interceptor | ||
| 41 | */ | ||
| 42 | public static function createWith(callable $callback): Interceptor | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @param Interceptor $element | ||
| 52 | * | ||
| 53 | * @return $this | ||
| 54 | */ | ||
| 55 | public function add(Interceptor $element) | ||
| 65 | |||
| 66 | /** | ||
| 67 | * @param AbstractContainer $container | ||
| 68 | * | ||
| 69 | * @return mixed | ||
| 70 | */ | ||
| 71 | public function handle(AbstractContainer $container): AbstractContainer | ||
| 92 | } | ||
| 93 |