Skip to content

Commit a38c8de

Browse files
committed
refactor: clean up code style and improve type narrowing
1 parent b44386a commit a38c8de

4 files changed

Lines changed: 3 additions & 14 deletions

File tree

rector.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
3030
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
3131
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
32-
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
3332
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector;
3433
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
3534
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
@@ -103,11 +102,6 @@
103102
RemoveUnusedPrivateMethodRector::class => [
104103
__DIR__ . '/src/Commands/QueueWork.php',
105104
],
106-
107-
// Skip for PayloadMetadata in the constructor
108-
NewInInitializerRector::class => [
109-
__DIR__ . '/src/Payloads/Payload.php',
110-
],
111105
]);
112106

113107
// auto import fully qualified class names

src/Commands/QueueStop.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ class QueueStop extends BaseCommand
6060
*
6161
* @var array<string, string>
6262
*/
63-
protected $options = [
64-
];
63+
protected $options = [];
6564

6665
/**
6766
* Actually execute a command.

src/Models/QueueJobFailedModel.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ public function __construct(?ConnectionInterface $db = null, ?ValidationInterfac
4646
{
4747
$this->DBGroup = config('Queue')->database['dbGroup'];
4848

49-
/**
50-
* @var BaseConnection|null $db
51-
*/
5249
$db ??= Database::connect($this->DBGroup);
50+
assert($db instanceof BaseConnection);
5351

5452
// Turn off the Strict Mode
5553
$db->transStrict(false);

src/Models/QueueJobModel.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ public function __construct(?ConnectionInterface $db = null, ?ValidationInterfac
5050
{
5151
$this->DBGroup = config('Queue')->database['dbGroup'];
5252

53-
/**
54-
* @var BaseConnection|null $db
55-
*/
5653
$db ??= Database::connect($this->DBGroup);
54+
assert($db instanceof BaseConnection);
5755

5856
// Turn off the Strict Mode
5957
$db->transStrict(false);

0 commit comments

Comments
 (0)