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

daycry / jobs / 21906779292

09 Feb 2026 05:28PM UTC coverage: 56.164% (+0.06%) from 56.107%
21906779292

push

github

daycry
Pass backend job ID into Job objects

Add a jobId field and getter/setter to IdentityTrait and populate it when creating Job instances from queue records. QueueRunCommand now injects the backend queue entity ID into the Job, and SyncQueue sets the job ID for in-process jobs; SyncQueue also removes an unused import and updates removeJob's type hint to use Job. Minor whitespace cleanup in DatabaseQueue.

4 of 5 new or added lines in 3 files covered. (80.0%)

1180 of 2101 relevant lines covered (56.16%)

4.56 hits per line

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

90.0
/src/Traits/IdentityTrait.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\Traits;
15

16
/**
17
 * Unified trait for job identification and dependencies.
18
 * Combines NameableTrait and DependableTrait functionality.
19
 */
20
trait IdentityTrait
21
{
22
    protected ?string $name    = null;
23
    protected ?string $jobId   = null;
24
    protected array $dependsOn = [];
25

26
    // ============================================================
27
    // Naming (formerly NameableTrait)
28
    // ============================================================
29

30
    public function named(string $name): self
31
    {
32
        $this->name = $name;
65✔
33

34
        return $this;
65✔
35
    }
36

37
    public function getName(): string
38
    {
39
        $this->name ??= $this->job . '-' . md5(serialize($this->payload));
22✔
40

41
        return $this->name;
22✔
42
    }
43

44
    public function setJobId(string $id): self
45
    {
46
        $this->jobId = $id;
3✔
47

48
        return $this;
3✔
49
    }
50

51
    public function getJobId(): ?string
52
    {
NEW
53
        return $this->jobId;
×
54
    }
55

56
    // ============================================================
57
    // Dependencies (formerly DependableTrait)
58
    // ============================================================
59

60
    public function dependsOn(array|string $jobNames): self
61
    {
62
        $this->dependsOn = is_array($jobNames) ? $jobNames : [$jobNames];
3✔
63

64
        return $this;
3✔
65
    }
66

67
    public function getDependsOn(): ?array
68
    {
69
        return $this->dependsOn;
3✔
70
    }
71
}
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