/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Queue/Middleware/Skip.php
47 строк
963 B
Choraimy Kroonstuiver
Fix typos in doc blocks (#60782)
15 июл 2026, 18:50
Не верифицирован
15 июл 2026, 18:50
2adbe44
Код
Авторство
О чём код?
<?php namespace Illuminate\Queue\Middleware; use Closure; class Skip { /** * @param bool $skip Whether the job should be skipped. */ public function __construct(protected bool $skip = false) { } /** * Apply the middleware if the given condition is truthy. * * @param bool|(\Closure(): bool) $condition */ public static function when(Closure|bool $condition): static { return new static(value($condition)); } /** * Apply the middleware unless the given condition is truthy. * * @param bool|(\Closure(): bool) $condition */ public static function unless(Closure|bool $condition): static { return new static(! value($condition)); } /** * Handle the job. */ public function handle(mixed $job, callable $next): mixed { if ($this->skip) { return false; } return $next($job); } }