Skip to content

Commit c00a8cc

Browse files
committed
pint fixes
1 parent f7a3f9d commit c00a8cc

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

pint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"preset": "laravel",
33
"rules": {
4-
"nullable_type_declaration_for_default_null_value": {
5-
"use_nullable_type_declaration": false
4+
"php_unit_method_casing": {
5+
"case": "camel_case"
66
}
77
}
88
}

src/Horizon/RabbitMQQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RabbitMQQueue extends BaseRabbitMQQueue
2626
*
2727
* @throws AMQPProtocolChannelException
2828
*/
29-
public function readyNow(string $queue = null): int
29+
public function readyNow(?string $queue = null): int
3030
{
3131
return $this->size($queue);
3232
}

src/Queue/Connection/ConfigFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ConfigFactory
1616
*/
1717
public static function make(array $config = []): AMQPConnectionConfig
1818
{
19-
return tap(new AMQPConnectionConfig(), function (AMQPConnectionConfig $connectionConfig) use ($config) {
19+
return tap(new AMQPConnectionConfig, function (AMQPConnectionConfig $connectionConfig) use ($config) {
2020
// Set the connection to a Lazy by default
2121
$connectionConfig->setIsLazy(! in_array(
2222
Arr::get($config, 'lazy') ?? true,

src/Queue/QueueConfigFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class QueueConfigFactory
1313
*/
1414
public static function make(array $config = []): QueueConfig
1515
{
16-
return tap(new QueueConfig(), function (QueueConfig $queueConfig) use ($config) {
16+
return tap(new QueueConfig, function (QueueConfig $queueConfig) use ($config) {
1717
if (! empty($queue = Arr::get($config, 'queue'))) {
1818
$queueConfig->setQueue($queue);
1919
}

src/Queue/RabbitMQQueue.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected function publishBatch($jobs, $data = '', $queue = null): void
204204
/**
205205
* @throws AMQPProtocolChannelException
206206
*/
207-
public function bulkRaw(string $payload, string $queue = null, array $options = []): int|string|null
207+
public function bulkRaw(string $payload, ?string $queue = null, array $options = []): int|string|null
208208
{
209209
[$destination, $exchange, $exchangeType, $attempts] = $this->publishProperties($queue, $options);
210210

@@ -397,7 +397,7 @@ public function deleteExchange(string $name, bool $unused = false): void
397397
*
398398
* @throws AMQPProtocolChannelException
399399
*/
400-
public function isQueueExists(string $name = null): bool
400+
public function isQueueExists(?string $name = null): bool
401401
{
402402
$queueName = $this->getQueue($name);
403403

@@ -484,7 +484,7 @@ public function bindQueue(string $queue, string $exchange, string $routingKey =
484484
/**
485485
* Purge the queue of messages.
486486
*/
487-
public function purge(string $queue = null): void
487+
public function purge(?string $queue = null): void
488488
{
489489
// create a temporary channel, so the main channel will not be closed on exception
490490
$channel = $this->createChannel();
@@ -637,7 +637,7 @@ protected function getDelayQueueArguments(string $destination, int $ttl): array
637637
/**
638638
* Get the exchange name, or empty string; as default value.
639639
*/
640-
protected function getExchange(string $exchange = null): string
640+
protected function getExchange(?string $exchange = null): string
641641
{
642642
return $exchange ?? $this->getConfig()->getExchange();
643643
}
@@ -654,7 +654,7 @@ protected function getRoutingKey(string $destination): string
654654
/**
655655
* Get the exchangeType, or AMQPExchangeType::DIRECT as default.
656656
*/
657-
protected function getExchangeType(string $type = null): string
657+
protected function getExchangeType(?string $type = null): string
658658
{
659659
$constant = AMQPExchangeType::class.'::'.Str::upper($type ?: $this->getConfig()->getExchangeType());
660660

@@ -664,7 +664,7 @@ protected function getExchangeType(string $type = null): string
664664
/**
665665
* Get the exchange for failed messages.
666666
*/
667-
protected function getFailedExchange(string $exchange = null): string
667+
protected function getFailedExchange(?string $exchange = null): string
668668
{
669669
return $exchange ?? $this->getConfig()->getFailedExchange();
670670
}
@@ -699,7 +699,7 @@ protected function isQueueDeclared(string $name): bool
699699
*
700700
* @throws AMQPProtocolChannelException
701701
*/
702-
protected function declareDestination(string $destination, string $exchange = null, string $exchangeType = AMQPExchangeType::DIRECT): void
702+
protected function declareDestination(string $destination, ?string $exchange = null, string $exchangeType = AMQPExchangeType::DIRECT): void
703703
{
704704
// When an exchange is provided and no exchange is present in RabbitMQ, create an exchange.
705705
if ($exchange && ! $this->isExchangeExists($exchange)) {

tests/Feature/QueueTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class QueueTest extends TestCase
1212
{
13-
public function setUp(): void
13+
protected function setUp(): void
1414
{
1515
parent::setUp();
1616

@@ -29,7 +29,7 @@ public function testWithoutReconnect(): void
2929
{
3030
$queue = $this->connection('rabbitmq');
3131

32-
$queue->push(new TestJob());
32+
$queue->push(new TestJob);
3333
sleep(1);
3434
$this->assertSame(1, $queue->size());
3535

@@ -38,6 +38,6 @@ public function testWithoutReconnect(): void
3838
$this->assertFalse($queue->getConnection()->isConnected());
3939

4040
$this->expectException(AMQPChannelClosedException::class);
41-
$queue->push(new TestJob());
41+
$queue->push(new TestJob);
4242
}
4343
}

tests/Feature/SslQueueTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class SslQueueTest extends TestCase
88
{
9-
public function setUp(): void
9+
protected function setUp(): void
1010
{
1111
$this->markTestSkipped();
1212
}

tests/Feature/TestCase.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class TestCase extends BaseTestCase
1717
/**
1818
* @throws AMQPProtocolChannelException
1919
*/
20-
public function setUp(): void
20+
protected function setUp(): void
2121
{
2222
parent::setUp();
2323

@@ -70,7 +70,7 @@ public function testPushRaw(): void
7070

7171
public function testPush(): void
7272
{
73-
Queue::push(new TestJob());
73+
Queue::push(new TestJob);
7474

7575
sleep(1);
7676

@@ -154,7 +154,7 @@ public function testLaterRaw(): void
154154

155155
public function testLater(): void
156156
{
157-
Queue::later(3, new TestJob());
157+
Queue::later(3, new TestJob);
158158

159159
sleep(1);
160160

@@ -197,7 +197,7 @@ public function testBulk(): void
197197

198198
public function testPushEncrypted(): void
199199
{
200-
Queue::push(new TestEncryptedJob());
200+
Queue::push(new TestEncryptedJob);
201201

202202
sleep(1);
203203

@@ -251,7 +251,7 @@ public function testPushEncryptedAfterCommit(): void
251251

252252
public function testEncryptedLater(): void
253253
{
254-
Queue::later(3, new TestEncryptedJob());
254+
Queue::later(3, new TestEncryptedJob);
255255

256256
sleep(1);
257257

@@ -320,7 +320,7 @@ public function testReleaseRaw(): void
320320

321321
public function testRelease(): void
322322
{
323-
Queue::push(new TestJob());
323+
Queue::push(new TestJob);
324324

325325
sleep(1);
326326

@@ -377,7 +377,7 @@ public function testReleaseWithDelayRaw(): void
377377

378378
public function testReleaseInThePast(): void
379379
{
380-
Queue::push(new TestJob());
380+
Queue::push(new TestJob);
381381

382382
$job = Queue::pop();
383383
$job->release(-3);
@@ -392,7 +392,7 @@ public function testReleaseInThePast(): void
392392

393393
public function testReleaseAndReleaseWithDelayAttempts(): void
394394
{
395-
Queue::push(new TestJob());
395+
Queue::push(new TestJob);
396396

397397
sleep(1);
398398

@@ -419,7 +419,7 @@ public function testReleaseAndReleaseWithDelayAttempts(): void
419419

420420
public function testDelete(): void
421421
{
422-
Queue::push(new TestJob());
422+
Queue::push(new TestJob);
423423

424424
$job = Queue::pop();
425425

@@ -433,7 +433,7 @@ public function testDelete(): void
433433

434434
public function testFailed(): void
435435
{
436-
Queue::push(new TestJob());
436+
Queue::push(new TestJob);
437437

438438
$job = Queue::pop();
439439

tests/Functional/RabbitMQQueueTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testConfigExchangeType(): void
8787
$queue = $this->connection('rabbitmq-with-options-null');
8888
$this->assertSame(AMQPExchangeType::DIRECT, $this->callMethod($queue, 'getExchangeType'));
8989

90-
//testing an unkown type with a default
90+
// testing an unkown type with a default
9191
$this->callProperty($queue, 'config')->setExchangeType('unknown');
9292
$this->assertSame(AMQPExchangeType::DIRECT, $this->callMethod($queue, 'getExchangeType'));
9393
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function getEnvironmentSetUp($app): void
5050
]);
5151
}
5252

53-
protected function connection(string $name = null): RabbitMQQueue
53+
protected function connection(?string $name = null): RabbitMQQueue
5454
{
5555
return Queue::connection($name);
5656
}

0 commit comments

Comments
 (0)