Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitAuto: [FEATURE] Implement Queue wrapper #238

Closed
Closed
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
01b1c4b
Update src/Queue.php.
gitauto-ai[bot] Oct 22, 2024
f098462
Update tests/QueueTest.php.
gitauto-ai[bot] Oct 22, 2024
0d63a91
style: format code with PHP CS Fixer
deepsource-autofix[bot] Oct 22, 2024
b418af9
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
6d1acda
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
f9cd673
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
496a08e
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
990d820
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
ab3ac1e
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
df03a47
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 22, 2024
529f408
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
guibranco Oct 25, 2024
bf044e7
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 26, 2024
fb1b224
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 26, 2024
ce4ea94
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Oct 28, 2024
5058da3
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 4, 2024
7195480
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 11, 2024
697e074
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 15, 2024
24dfd99
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 18, 2024
9cc9d43
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 25, 2024
b97a66f
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 26, 2024
f2828e0
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 26, 2024
ab9d590
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Nov 26, 2024
84e540f
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 3, 2024
a686472
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 3, 2024
0bf3e60
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 9, 2024
2b30db6
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 12, 2024
1aa0f5f
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 12, 2024
6a8800f
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 12, 2024
d188175
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 12, 2024
2e1870a
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 16, 2024
0769a13
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 21, 2024
2538bad
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 22, 2024
31fe228
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 23, 2024
e26b29b
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 25, 2024
a6bb47c
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 26, 2024
d6a90eb
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Dec 30, 2024
0066981
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 6, 2025
d59a930
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 6, 2025
ead501d
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 6, 2025
d68f670
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 7, 2025
f465f49
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 13, 2025
1598039
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 13, 2025
09d03b4
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 13, 2025
494beed
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 16, 2025
3645bf1
Update Queue.php
guibranco Jan 16, 2025
f8b5585
Update QueueTest.php
guibranco Jan 16, 2025
9d442ed
Merge branch 'main' into gitauto/issue-#82-51f588c0-a7e2-45bc-b113-f1…
gstraccini[bot] Jan 18, 2025
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
68 changes: 68 additions & 0 deletions src/Queue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

class Queue
{
private $connectionStrings;

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line(s) before first member var; 0 found Warning

Expected 1 blank line(s) before first member var; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing member variable doc comment Warning

Missing member variable doc comment

public function __construct(array $servers)

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function __construct() Warning

Missing doc comment for function __construct()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines before function; 1 found Warning

Expected 2 blank lines before function; 1 found
{
$this->connectionStrings = $servers;
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end __construct() Warning

Expected //end __construct()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

private function declareQueueWithDLX($channel, $queueName)

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function declareQueueWithDLX() Warning

Missing doc comment for function declareQueueWithDLX()

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$queueName'.

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$channel'.
{
// Existing implementation for declaring a queue with DLX

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end declareQueueWithDLX() Warning

Expected //end declareQueueWithDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

private function declareQueueWithoutDLX($channel, $queueName)

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function declareQueueWithoutDLX() Warning

Missing doc comment for function declareQueueWithoutDLX()

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$queueName'.

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$channel'.
{
// Implement declaration without DLX

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end declareQueueWithoutDLX() Warning

Expected //end declareQueueWithoutDLX()

public function publish($queueName, $message, $useDLX = true)

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between argument "$useDLX" and equals sign; expected 0 but found 1 Warning

Incorrect spacing between argument "$useDLX" and equals sign; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between default value and equals sign for argument "$useDLX"; expected 0 but found 1 Warning

Incorrect spacing between default value and equals sign for argument "$useDLX"; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function publish() Warning

Missing doc comment for function publish()

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$message'.
{
$connection = $this->getRandomConnection();
$channel = $connection->channel();

if ($useDLX) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead
$this->declareQueueWithDLX($channel, $queueName);
} else {

Check warning

Code scanning / Phpmd (reported by Codacy)

Use return statements instead of else expression Warning

The method publish uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
$this->declareQueueWithoutDLX($channel, $queueName);
}

// Code to publish the message

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end publish() Warning

Expected //end publish()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

public function consume($timeout, $queueName, $callback, $resetTimeoutOnReceive = false, $prefetchCount = 10, $useDLX = true)

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between default value and equals sign for argument "$useDLX"; expected 0 but found 1 Warning

Incorrect spacing between default value and equals sign for argument "$useDLX"; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between argument "$resetTimeoutOnReceive" and equals sign; expected 0 but found 1 Warning

Incorrect spacing between argument "$resetTimeoutOnReceive" and equals sign; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between argument "$prefetchCount" and equals sign; expected 0 but found 1 Warning

Incorrect spacing between argument "$prefetchCount" and equals sign; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between default value and equals sign for argument "$resetTimeoutOnReceive"; expected 0 but found 1 Warning

Incorrect spacing between default value and equals sign for argument "$resetTimeoutOnReceive"; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function consume() Warning

Missing doc comment for function consume()

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between argument "$useDLX" and equals sign; expected 0 but found 1 Warning

Incorrect spacing between argument "$useDLX" and equals sign; expected 0 but found 1

Check warning

Code scanning / Phpcs (reported by Codacy)

Incorrect spacing between default value and equals sign for argument "$prefetchCount"; expected 0 but found 1 Warning

Incorrect spacing between default value and equals sign for argument "$prefetchCount"; expected 0 but found 1

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$timeout'.

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$resetTimeoutOnReceive'.

Check warning

Code scanning / Phpmd (reported by Codacy)

Detects when a field, local, or parameter has a very long name. Warning

Avoid excessively long variable names like $resetTimeoutOnReceive. Keep variable name length under 20.

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note

Avoid unused parameters such as '$callback'.
{
foreach ($this->connectionStrings as $server) {
$connection = $this->getConnection($server);
$channel = $connection->channel();

if ($useDLX) {

Check warning

Code scanning / Phpcs (reported by Codacy)

Implicit true comparisons prohibited; use === TRUE instead Warning

Implicit true comparisons prohibited; use === TRUE instead
$this->declareQueueWithDLX($channel, $queueName);
} else {

Check warning

Code scanning / Phpmd (reported by Codacy)

Use return statements instead of else expression Warning

The method consume uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
$this->declareQueueWithoutDLX($channel, $queueName);
}

$channel->basic_qos(null, $prefetchCount, null);

// Code to consume messages

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning

Inline comments must end in full-stops, exclamation marks, or question marks
}
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end consume() Warning

Expected //end consume()

private function getRandomConnection()

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function getRandomConnection() Warning

Missing doc comment for function getRandomConnection()
{
$randomServer = $this->connectionStrings[array_rand($this->connectionStrings)];
return $this->getConnection($randomServer);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end getRandomConnection() Warning

Expected //end getRandomConnection()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

private function getConnection($server)

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function getConnection() Warning

Missing doc comment for function getConnection()
{
$options = ['connection_timeout' => 10.0, 'read_write_timeout' => 10.0];

Check warning

Code scanning / Phpcs (reported by Codacy)

Array with multiple values cannot be declared on a single line Warning

Array with multiple values cannot be declared on a single line
return AMQPStreamConnection::create_connection([$server], $options);

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code Warning

Avoid using static access to class 'AMQPStreamConnection' in method 'getConnection'.
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end getConnection() Warning

Expected //end getConnection()

// Additional methods and logic for the Queue class

Check warning

Code scanning / Phpcs (reported by Codacy)

There must be no blank line following an inline comment Warning

There must be no blank line following an inline comment

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning

Inline comments must end in full-stops, exclamation marks, or question marks

}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end class Warning

Expected //end class
59 changes: 59 additions & 0 deletions tests/QueueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

use PHPUnit\Framework\TestCase;

class QueueTest extends TestCase
{
private $queue;

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line(s) before first member var; 0 found Warning test

Expected 1 blank line(s) before first member var; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing member variable doc comment Warning test

Missing member variable doc comment

protected function setUp(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines before function; 1 found Warning test

Expected 2 blank lines before function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function setUp() Warning test

Missing doc comment for function setUp()
{
$servers = [
['host' => 'server1', 'port' => 5672, 'user' => 'guest', 'password' => 'guest'],

Check warning

Code scanning / Phpcs (reported by Codacy)

Array value not aligned correctly; expected 20 spaces but found 12 Warning test

Array value not aligned correctly; expected 20 spaces but found 12

Check warning

Code scanning / Phpcs (reported by Codacy)

Array with multiple values cannot be declared on a single line Warning test

Array with multiple values cannot be declared on a single line
['host' => 'server2', 'port' => 5672, 'user' => 'guest', 'password' => 'guest']

Check warning

Code scanning / Phpcs (reported by Codacy)

Comma required after last value in array declaration Warning test

Comma required after last value in array declaration

Check warning

Code scanning / Phpcs (reported by Codacy)

Array with multiple values cannot be declared on a single line Warning test

Array with multiple values cannot be declared on a single line

Check warning

Code scanning / Phpcs (reported by Codacy)

Array value not aligned correctly; expected 20 spaces but found 12 Warning test

Array value not aligned correctly; expected 20 spaces but found 12
];

Check warning

Code scanning / Phpcs (reported by Codacy)

Closing parenthesis not aligned correctly; expected 19 spaces but found 8 Warning test

Closing parenthesis not aligned correctly; expected 19 spaces but found 8
$this->queue = new Queue($servers);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end setUp() Warning test

Expected //end setUp()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

public function testPublishWithDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testPublishWithDLX() Warning test

Missing doc comment for function testPublishWithDLX()
{
$this->queue->publish('testQueue', 'testMessage', true);
// Assertions to verify message was published with DLX

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testPublishWithDLX() Warning test

Expected //end testPublishWithDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

public function testPublishWithoutDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testPublishWithoutDLX() Warning test

Missing doc comment for function testPublishWithoutDLX()
{
$this->queue->publish('testQueue', 'testMessage', false);
// Assertions to verify message was published without DLX

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testPublishWithoutDLX() Warning test

Expected //end testPublishWithoutDLX()

public function testConsumeWithDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testConsumeWithDLX() Warning test

Missing doc comment for function testConsumeWithDLX()
{
$callback = function ($msg) {

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note test

Avoid unused parameters such as '$msg'.
// Process message

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
};
$this->queue->consume(30, 'testQueue', $callback, false, 10, true);
// Assertions to verify messages are consumed with DLX

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testConsumeWithDLX() Warning test

Expected //end testConsumeWithDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

public function testConsumeWithoutDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testConsumeWithoutDLX() Warning test

Missing doc comment for function testConsumeWithoutDLX()
{
$callback = function ($msg) {

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note test

Avoid unused parameters such as '$msg'.
// Process message

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
};
$this->queue->consume(30, 'testQueue', $callback, false, 10, false);
// Assertions to verify messages are consumed without DLX

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testConsumeWithoutDLX() Warning test

Expected //end testConsumeWithoutDLX()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

public function testConsumeWithDifferentQoS()

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testConsumeWithDifferentQoS() Warning test

Missing doc comment for function testConsumeWithDifferentQoS()
{
$callback = function ($msg) {

Check notice

Code scanning / Phpmd (reported by Codacy)

Prohibit the definition of unused parameters on methods or constructors Note test

Avoid unused parameters such as '$msg'.
// Process message

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
};
$this->queue->consume(30, 'testQueue', $callback, false, 5, true);
// Assertions to verify messages are consumed with different QoS settings

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testConsumeWithDifferentQoS() Warning test

Expected //end testConsumeWithDifferentQoS()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

// Additional test cases

Check warning

Code scanning / Phpcs (reported by Codacy)

Inline comments must end in full-stops, exclamation marks, or question marks Warning test

Inline comments must end in full-stops, exclamation marks, or question marks

Check warning

Code scanning / Phpcs (reported by Codacy)

There must be no blank line following an inline comment Warning test

There must be no blank line following an inline comment

}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end class Warning test

Expected //end class
Loading