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

squigg / azure-queue-laravel / 6e9da035-ea78-453b-a56d-5a8c77f86def

pending completion
6e9da035-ea78-453b-a56d-5a8c77f86def

push

circleci

squigg
Improve test config

51 of 51 relevant lines covered (100.0%)

10.94 hits per line

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

100.0
/src/AzureJob.php
1
<?php
2

3
namespace Squigg\AzureQueueLaravel;
4

5
use Illuminate\Container\Container;
6
use Illuminate\Contracts\Queue\Job as JobContract;
7
use Illuminate\Queue\Jobs\Job;
8
use MicrosoftAzure\Storage\Queue\Internal\IQueue;
9
use MicrosoftAzure\Storage\Queue\Models\QueueMessage;
10

11
class AzureJob extends Job implements JobContract
12
{
13

14
    /**
15
     * The Azure QueueRestProxy instance.
16
     */
17
    protected IQueue $azure;
18

19
    /**
20
     * The Azure QueueMessage instance.
21
     */
22
    protected QueueMessage $job;
23

24
    /**
25
     * The queue that the job belongs to.
26
     */
27
    protected $queue;
28

29
    /**
30
     * Create a new job instance.
31
     *
32
     * @param Container $container
33
     * @param IQueue $azure
34
     * @param QueueMessage $job
35
     * @param string $connectionName
36
     * @param string $queue
37
     *
38
     */
39
    public function __construct(Container    $container,
40
                                IQueue       $azure,
41
                                QueueMessage $job,
42
                                string       $connectionName,
43
                                string       $queue)
44
    {
45
        $this->azure = $azure;
24✔
46
        $this->job = $job;
24✔
47
        $this->queue = $queue;
24✔
48
        $this->container = $container;
24✔
49
        $this->connectionName = $connectionName;
24✔
50
    }
51

52
    /**
53
     * Delete the job from the queue.
54
     */
55
    public function delete(): void
56
    {
57
        parent::delete();
2✔
58
        $this->azure->deleteMessage($this->queue, $this->job->getMessageId(), $this->job->getPopReceipt());
2✔
59
    }
60

61
    /**
62
     * Release the job back into the queue.
63
     *
64
     * @param int $delay
65
     */
66
    public function release($delay = 0): void
67
    {
68
        parent::release($delay);
2✔
69
        $this->azure->updateMessage($this->queue, $this->job->getMessageId(), $this->job->getPopReceipt(), null,
2✔
70
            $delay);
2✔
71
    }
72

73
    /**
74
     * Get the number of times the job has been attempted.
75
     */
76
    public function attempts(): int
77
    {
78
        return $this->job->getDequeueCount();
2✔
79
    }
80

81
    /**
82
     * Get the IoC container instance.
83
     */
84
    public function getContainer(): Container
85
    {
86
        return $this->container;
2✔
87
    }
88

89
    /**
90
     * Get the underlying Azure client instance.
91
     */
92
    public function getAzure(): IQueue
93
    {
94
        return $this->azure;
2✔
95
    }
96

97
    /**
98
     * Get the underlying raw Azure job.
99
     */
100
    public function getAzureJob(): QueueMessage
101
    {
102
        return $this->job;
2✔
103
    }
104

105
    /**
106
     * Get the job ID
107
     */
108
    public function getJobId(): int
109
    {
110
        return $this->job->getMessageId();
2✔
111
    }
112

113
    /**
114
     * Get the raw body string for the job.
115
     */
116
    public function getRawBody(): string
117
    {
118
        return $this->job->getMessageText();
2✔
119
    }
120
}
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

© 2025 Coveralls, Inc