Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="2.1.31" installed="2.1.31" location="./tools/phpstan" copy="false"/>
<phar name="phpstan" version="2.1.55" installed="2.1.55" location="./tools/phpstan" copy="false"/>
</phive>
2 changes: 0 additions & 2 deletions src/TestSuite/Constraint/Queue/JobQueuedTimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class JobQueuedTimes extends QueueConstraintBase
{
/**
* Expected number of times
*
* @var int
*/
protected int $times;

Expand Down
2 changes: 0 additions & 2 deletions src/TestSuite/Constraint/Queue/QueueConstraintBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ abstract class QueueConstraintBase extends Constraint
{
/**
* Job index to check
*
* @var int|null
*/
protected ?int $at = null;

Expand Down
16 changes: 8 additions & 8 deletions src/TestSuite/QueueTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function assertJobNotQueued(string $jobClass, string $message = ''): void
$jobs = TestQueueClient::getQueuedJobsByClass($jobClass);
$this->assertEmpty(
$jobs,
$message ?: "Job {$jobClass} was queued unexpectedly",
$message ?: sprintf('Job %s was queued unexpectedly', $jobClass),
);
}

Expand Down Expand Up @@ -137,7 +137,7 @@ public function assertJobQueuedWith(
string $message = '',
): void {
$jobs = TestQueueClient::getQueuedJobsByClass($jobClass);
$this->assertNotEmpty($jobs, "Job {$jobClass} was not queued");
$this->assertNotEmpty($jobs, sprintf('Job %s was not queued', $jobClass));

$found = false;
foreach ($jobs as $job) {
Expand All @@ -149,7 +149,7 @@ public function assertJobQueuedWith(

$this->assertTrue(
$found,
$message ?: "Job {$jobClass} was not queued with expected data",
$message ?: sprintf('Job %s was not queued with expected data', $jobClass),
);
}

Expand Down Expand Up @@ -177,7 +177,7 @@ public function assertJobQueuedToQueue(

$this->assertTrue(
$found,
$message ?: "Job {$jobClass} was not queued to queue {$queue}",
$message ?: sprintf('Job %s was not queued to queue %s', $jobClass, $queue),
);
}

Expand All @@ -195,7 +195,7 @@ public function assertJobQueuedWithDelay(
string $message = '',
): void {
$jobs = TestQueueClient::getQueuedJobsByClass($jobClass);
$this->assertNotEmpty($jobs, "Job {$jobClass} was not queued");
$this->assertNotEmpty($jobs, sprintf('Job %s was not queued', $jobClass));

$found = false;
foreach ($jobs as $job) {
Expand All @@ -207,7 +207,7 @@ public function assertJobQueuedWithDelay(

$this->assertTrue(
$found,
$message ?: "Job {$jobClass} was not queued with delay {$delay}",
$message ?: sprintf('Job %s was not queued with delay %d', $jobClass, $delay),
);
}

Expand All @@ -225,7 +225,7 @@ public function assertJobQueuedWithPriority(
string $message = '',
): void {
$jobs = TestQueueClient::getQueuedJobsByClass($jobClass);
$this->assertNotEmpty($jobs, "Job {$jobClass} was not queued");
$this->assertNotEmpty($jobs, sprintf('Job %s was not queued', $jobClass));

$found = false;
foreach ($jobs as $job) {
Expand All @@ -237,7 +237,7 @@ public function assertJobQueuedWithPriority(

$this->assertTrue(
$found,
$message ?: "Job {$jobClass} was not queued with priority {$priority}",
$message ?: sprintf('Job %s was not queued with priority %s', $jobClass, $priority),
);
}

Expand Down
3 changes: 1 addition & 2 deletions src/TestSuite/TestQueueClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class TestQueueClient

/**
* Transport registration flag
*
* @var bool
*/
protected static bool $registered = false;

Expand Down Expand Up @@ -120,6 +118,7 @@ public static function captureMessage(
} elseif ($destination instanceof Topic) {
$queueName = $destination->getTopicName();
}

$queueName = $requeueOptions['queue'] ?? $queueName;

$properties = $message->getProperties();
Expand Down
2 changes: 0 additions & 2 deletions src/TestSuite/Transport/TestConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class TestConsumer implements Consumer
{
/**
* Queue
*
* @var \Interop\Queue\Queue
*/
protected Queue $queue;

Expand Down
4 changes: 1 addition & 3 deletions src/TestSuite/Transport/TestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class TestContext implements Context
{
/**
* Cached producer instance
*
* @var \Interop\Queue\Producer|null
*/
protected ?Producer $producer = null;

Expand Down Expand Up @@ -68,7 +66,7 @@ public function createTopic(string $name): Topic
*/
public function createProducer(): Producer
{
if ($this->producer === null) {
if (!$this->producer instanceof Producer) {
$this->producer = new TestProducer();
}

Expand Down
2 changes: 0 additions & 2 deletions src/TestSuite/Transport/TestDestination.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class TestDestination implements Queue, Topic
{
/**
* Destination name
*
* @var string
*/
protected string $name;

Expand Down
14 changes: 0 additions & 14 deletions src/TestSuite/Transport/TestDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@

namespace Cake\Queue\TestSuite\Transport;

use Enqueue\Client\Config;
use Enqueue\Client\Driver\GenericDriver;
use Enqueue\Client\DriverInterface;
use Enqueue\Client\RouteCollection;
use Interop\Queue\Context;

/**
* Test Driver
Expand All @@ -16,15 +13,4 @@
*/
class TestDriver extends GenericDriver implements DriverInterface
{
/**
* Constructor
*
* @param \Interop\Queue\Context $context Context
* @param \Enqueue\Client\Config $config Client config
* @param \Enqueue\Client\RouteCollection $routes Route collection
*/
public function __construct(Context $context, Config $config, RouteCollection $routes)
{
parent::__construct($context, $config, $routes);
}
}
2 changes: 0 additions & 2 deletions src/TestSuite/Transport/TestMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class TestMessage implements Message
{
/**
* Message body
*
* @var string
*/
protected string $body;

Expand Down
6 changes: 0 additions & 6 deletions src/TestSuite/Transport/TestProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,16 @@ class TestProducer implements Producer
{
/**
* Delivery delay
*
* @var int|null
*/
protected ?int $deliveryDelay = null;

/**
* Time to live
*
* @var int|null
*/
protected ?int $timeToLive = null;

/**
* Priority
*
* @var int|null
*/
protected ?int $priority = null;

Expand Down
Loading