Skip to content

Commit 6d7884f

Browse files
committed
updated rector config
1 parent a8b1c4f commit 6d7884f

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
},
2929
"require-dev": {
3030
"dereuromark/composer-prefer-lowest": "^0.1.10",
31-
"larastan/larastan": "^2.8.1",
32-
"laravel/pint": "^1.0",
31+
"larastan/larastan": "^2.9",
32+
"laravel/pint": "^1.17",
3333
"mockery/mockery": "^1.6",
3434
"nesbot/carbon": "^2.63 || ^3.0",
3535
"nunomaduro/collision": "^7.0 || ^8.0",
@@ -39,7 +39,7 @@
3939
"phpstan/extension-installer": "^1.1",
4040
"phpstan/phpstan-deprecation-rules": "^1.0",
4141
"phpstan/phpstan-phpunit": "^1.0",
42-
"rector/rector": "^1.0",
42+
"rector/rector": "^1.2",
4343
"spatie/invade": "^2.0",
4444
"spatie/laravel-data": "^4.3",
4545
"spatie/laravel-ray": "^1.26",

rector.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22

33
declare(strict_types=1);
44

5-
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
65
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
7-
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
8-
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
9-
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
106
use Rector\Config\RectorConfig;
117
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
12-
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
13-
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
148
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
159
use Rector\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector;
1610
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
@@ -19,25 +13,31 @@
1913
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector;
2014

2115
return RectorConfig::configure()
22-
->withPhpSets()
23-
->withPreparedSets()
16+
->withCache(__DIR__.'/build/rector')
2417
->withPaths([
2518
__DIR__.'/src',
2619
__DIR__.'/config',
2720
])
21+
->withPhpSets()
22+
->withPreparedSets(
23+
deadCode: true,
24+
codeQuality: true,
25+
codingStyle: true,
26+
typeDeclarations: true,
27+
)
28+
->withImportNames(
29+
importNames: false,
30+
importDocBlockNames: false,
31+
importShortClasses: false,
32+
removeUnusedImports: true
33+
)
2834
->withSkip([
2935
AddArrowFunctionReturnTypeRector::class,
3036
AddParamBasedOnParentClassMethodRector::class,
31-
CallableThisArrayToAnonymousFunctionRector::class,
32-
ChangeAndIfToEarlyReturnRector::class,
3337
FlipTypeControlToUseExclusiveTypeRector::class,
3438
IfIssetToCoalescingRector::class,
35-
PostIncDecToPreIncDecRector::class,
3639
RemoveNullPropertyInitializationRector::class,
37-
ReturnBinaryOrToEarlyReturnRector::class,
3840
ReturnTypeFromReturnDirectArrayRector::class,
3941
ReturnTypeFromReturnNewRector::class,
4042
ReturnTypeFromStrictTypedCallRector::class,
41-
StaticArrowFunctionRector::class,
42-
StaticClosureRector::class,
4343
]);

src/Exceptions/TemporalSerializerException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class TemporalSerializerException extends Exception
88
{
99
public static function targetClassDoesntExists(string $className): self
1010
{
11-
return new self("Cannot deserialize value, class `$className` does not exist");
11+
return new self(sprintf('Cannot deserialize value, class `%s` does not exist', $className));
1212
}
1313

1414
public static function targetClassIsNotSerializable(string $className): self
1515
{
16-
return new self("Cannot deserialize value, class `$className` does not implement `TemporalSerializable` interface");
16+
return new self(sprintf('Cannot deserialize value, class `%s` does not implement `TemporalSerializable` interface', $className));
1717
}
1818
}

src/Temporal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function newChildWorkflow(): ChildWorkflowBuilder
3838

3939
public function buildWorkerOptions(string $taskQueue): WorkerOptions
4040
{
41-
if (static::$buildWorkerOptionsCallback) {
41+
if (static::$buildWorkerOptionsCallback !== null) {
4242
$workerOptions = call_user_func(static::$buildWorkerOptionsCallback, $taskQueue);
4343

4444
if ($workerOptions instanceof WorkerOptions) {

0 commit comments

Comments
 (0)