Skip to content

Commit 4625137

Browse files
Refactor: Update rector configuration and add type declarations in tests
1 parent a610c53 commit 4625137

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

rector.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22

33
declare(strict_types=1);
44

5-
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
65
use Rector\Config\RectorConfig;
7-
use Rector\Set\ValueObject\LevelSetList;
8-
use Rector\Set\ValueObject\SetList;
6+
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
97

10-
return static function (RectorConfig $rectorConfig): void {
11-
$rectorConfig->paths([
8+
return RectorConfig::configure()
9+
->withPaths([
1210
__DIR__.'/src',
13-
]);
14-
15-
$rectorConfig->rules([
16-
InlineConstructorDefaultToPropertyRector::class,
17-
]);
18-
19-
$rectorConfig->sets([
20-
LevelSetList::UP_TO_PHP_83,
21-
SetList::CODE_QUALITY,
22-
SetList::DEAD_CODE,
23-
SetList::EARLY_RETURN,
24-
SetList::TYPE_DECLARATION,
25-
SetList::PRIVATIZATION,
26-
]);
27-
};
11+
__DIR__.'/tests',
12+
])
13+
->withSkip([
14+
AddOverrideAttributeToOverriddenMethodsRector::class,
15+
])
16+
->withPreparedSets(
17+
deadCode: true,
18+
codeQuality: true,
19+
typeDeclarations: true,
20+
privatization: true,
21+
earlyReturn: true,
22+
strictBooleans: true,
23+
)
24+
->withPhpSets(php83: true);

tests/Feature/ExampleTest.php

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

33
declare(strict_types=1);
44

5-
it('is true', function () {
5+
it('is true', function (): void {
66
expect(true)->toBeTrue();
77
});

tests/TestCase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ class TestCase extends Orchestra
1313
* Define environment setup.
1414
*
1515
* @param \Illuminate\Foundation\Application $app
16-
* @return void
1716
*/
18-
public function getEnvironmentSetUp($app)
17+
public function getEnvironmentSetUp($app): void
1918
{
2019
//
2120
}

tests/Unit/ExampleTest.php

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

33
declare(strict_types=1);
44

5-
it('is true', function () {
5+
it('is true', function (): void {
66
expect(true)->toBeTrue();
77
});

0 commit comments

Comments
 (0)