Skip to content

Commit 15a9de7

Browse files
committed
style
1 parent 6b22499 commit 15a9de7

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

src/Illuminate/Foundation/Bus/Attributes/OnConnection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class OnConnection
99
{
1010
/**
11-
* @param string|\UnitEnum $connection
11+
* @param string|\UnitEnum $connection
1212
* @return void
1313
*/
1414
public function __construct(public $connection)

src/Illuminate/Foundation/Bus/Attributes/OnQueue.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
class OnQueue
99
{
1010
/**
11-
* @param string|\UnitEnum $queue
11+
* @param string|\UnitEnum $queue
1212
* @return void
1313
*/
1414
public function __construct(public $queue)
1515
{
16-
1716
}
1817
}

src/Illuminate/Foundation/Bus/PendingDispatch.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function __construct($job)
4646
* Set the job's queue and connection values based on the job's OnQueue/OnConnection attributes.
4747
*
4848
* @return void
49+
*
4950
* @throws \ReflectionException
5051
*/
5152
protected function setQueueAndConnectionFromAttributesIfNotSet(): void
@@ -58,14 +59,14 @@ protected function setQueueAndConnectionFromAttributesIfNotSet(): void
5859
}
5960

6061
$reflectionClass = new \ReflectionClass($this->job);
61-
if (!$hasQueueSet) {
62+
if (! $hasQueueSet) {
6263
$onQueue = $reflectionClass->getAttributes(OnQueue::class);
6364
if ($onQueue !== []) {
6465
$this->onQueue($onQueue[0]->newInstance()->queue);
6566
}
6667
}
6768

68-
if (!$hasConnectionSet) {
69+
if (! $hasConnectionSet) {
6970
$onConnection = $reflectionClass->getAttributes(OnConnection::class);
7071
if ($onConnection !== []) {
7172
$this->onConnection($onConnection[0]->newInstance()->connection);

tests/Integration/Bus/BusPendingDispatchWithAttributesTest.php

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Illuminate\Tests\Integration\Bus;
44

5-
65
use Illuminate\Bus\Queueable;
76
use Illuminate\Contracts\Queue\ShouldQueue;
87
use Illuminate\Foundation\Bus\Attributes\OnConnection;
@@ -20,8 +19,8 @@ public function testDispatchWhereQueueAndConnectionAreFromAttributes(): void
2019
FakeJobWithOnQueueAndOnConnection::dispatch(123);
2120

2221
Queue::assertPushed(function (FakeJobWithOnQueueAndOnConnection $job) {
23-
return $job->connection === "connection_from_attribute"
24-
&& $job->queue === "queue-from-attribute"
22+
return $job->connection === 'connection_from_attribute'
23+
&& $job->queue === 'queue-from-attribute'
2524
&& $job->value === 123;
2625
});
2726
}
@@ -30,11 +29,11 @@ public function testDispatchWhereQueueIsFromAttribute(): void
3029
{
3130
Queue::fake();
3231

33-
FakeJobWithOnQueueFromAttribute::dispatch(1234)->onConnection("not-from-attribute");
32+
FakeJobWithOnQueueFromAttribute::dispatch(1234)->onConnection('not-from-attribute');
3433

3534
Queue::assertPushed(function (FakeJobWithOnQueueFromAttribute $job) {
36-
return $job->connection === "not-from-attribute"
37-
&& $job->queue === "queue-from-attribute"
35+
return $job->connection === 'not-from-attribute'
36+
&& $job->queue === 'queue-from-attribute'
3837
&& $job->value === 1234;
3938
});
4039
}
@@ -46,8 +45,8 @@ public function testDispatchWhereConnectionIsFromAttribute(): void
4645
FakeJobWithOnConnection::dispatch(999);
4746

4847
Queue::assertPushed(function (FakeJobWithOnConnection $job) {
49-
return $job->connection === "connection_from_attribute"
50-
&& !isset($job->queue)
48+
return $job->connection === 'connection_from_attribute'
49+
&& ! isset($job->queue)
5150
&& $job->value === 999;
5251
});
5352
}
@@ -61,8 +60,8 @@ public function testOverridingQueueAndConnectionDoesNotUseAttributeValues(): voi
6160
->onConnection('setViaMethodToo');
6261

6362
Queue::assertPushed(function (FakeJobWithOnQueueAndOnConnection $job) {
64-
return $job->queue === "setViaMethod"
65-
&& $job->connection === "setViaMethodToo"
63+
return $job->queue === 'setViaMethod'
64+
&& $job->connection === 'setViaMethodToo'
6665
&& $job->value === 'abc';
6766
});
6867
}

0 commit comments

Comments
 (0)