• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daycry / jobs / 24850441053

23 Apr 2026 05:54PM UTC coverage: 52.404% (-1.5%) from 53.938%
24850441053

push

github

daycry
Fixes

104 of 219 new or added lines in 42 files covered. (47.49%)

14 existing lines in 9 files now uncovered.

1210 of 2309 relevant lines covered (52.4%)

4.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/Jobs/ClosureJob.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Queues.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Jobs\Jobs;
15

16
use Daycry\Jobs\Exceptions\JobException;
17
use Daycry\Jobs\Interfaces\JobInterface;
18
use Daycry\Jobs\Job;
19
use Daycry\Jobs\Traits\InteractsWithCurrentJob;
20

21
/**
22
 * Executes a user-provided Closure (callable) stored in the payload.
23
 * Payload MUST be an invokable (Closure or object with __invoke()).
24
 */
25
class ClosureJob extends Job implements JobInterface
26
{
27
    use InteractsWithCurrentJob;
28

29
    public function handle(mixed $payload): mixed
30
    {
31
        if (! is_callable($payload)) {
23✔
NEW
32
            throw JobException::validationError('ClosureJob payload must be callable (Closure or object with __invoke).');
×
33
        }
34

35
        return $payload();
23✔
36
    }
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc