Skip to content

Commit 1b1e67e

Browse files
committed
!!! TASK: Remove the count() method completely
Which is replaced by countReady() now.
1 parent 9f0c625 commit 1b1e67e

4 files changed

Lines changed: 4 additions & 25 deletions

File tree

Classes/Command/JobCommandController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Neos\Cache\Frontend\VariableFrontend;
1919
use Neos\Flow\Annotations as Flow;
2020
use Neos\Flow\Cli\CommandController;
21+
use Neos\Flow\Mvc\Exception\StopActionException;
2122

2223
/**
2324
* Job command controller
@@ -62,6 +63,7 @@ class JobCommandController extends CommandController
6263
* @param int $limit If set, only the given amount of jobs are processed (successful or not) before the script exits
6364
* @param bool $verbose Output debugging information
6465
* @return void
66+
* @throws StopActionException
6567
*/
6668
public function workCommand($queue, $exitAfter = null, $limit = null, $verbose = false)
6769
{
@@ -123,11 +125,12 @@ public function workCommand($queue, $exitAfter = null, $limit = null, $verbose =
123125
* @param string $queue The name of the queue
124126
* @param integer $limit Number of jobs to list (some queues only support a limit of 1)
125127
* @return void
128+
* @throws JobQueueException
126129
*/
127130
public function listCommand($queue, $limit = 1)
128131
{
129132
$jobs = $this->jobManager->peek($queue, $limit);
130-
$totalCount = $this->queueManager->getQueue($queue)->count();
133+
$totalCount = $this->queueManager->getQueue($queue)->countReady();
131134
foreach ($jobs as $job) {
132135
$this->outputLine('<b>%s</b>', [$job->getLabel()]);
133136
}

Classes/Queue/FakeQueue.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,6 @@ public function peek($limit = 1)
143143
return [];
144144
}
145145

146-
/**
147-
* @inheritdoc
148-
*/
149-
public function count(): int
150-
{
151-
return $this->countReady();
152-
}
153-
154146
/**
155147
* @inheritdoc
156148
*/

Classes/Queue/QueueInterface.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ public function finish($messageId);
101101
*/
102102
public function peek($limit = 1);
103103

104-
/**
105-
* Get a count of ready messages currently in the queue.
106-
*
107-
* @return int The number of ready messages in the queue
108-
* @deprecated Will be removed with the next major. Use countReady instead.
109-
*/
110-
public function count(): int;
111-
112104
/**
113105
* Get a count of ready messages currently in the queue.
114106
*

Tests/Unit/Fixtures/TestQueue.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,6 @@ public function peek($limit = 1)
207207
return $messages;
208208
}
209209

210-
/**
211-
* @inheritdoc
212-
*/
213-
public function count(): int
214-
{
215-
return $this->countReady();
216-
}
217-
218210
/**
219211
* @inheritdoc
220212
*/

0 commit comments

Comments
 (0)