Skip to content

Commit fa953bb

Browse files
author
cradu
committed
Fixed rector tests
1 parent c121fdf commit fa953bb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/Fixtures/ClassWithRectorIssues.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
namespace Igorsgm\GitHooks\Tests\Fixtures;
44

@@ -9,6 +9,10 @@ class ClassWithRectorIssues
99
protected function test()
1010
{
1111
$a = [];
12+
13+
if (empty($a)) {
14+
$a = ["string", 'another string'];
15+
}
1216

1317
return $a;
1418
}

tests/Fixtures/rectorFixture.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
6+
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
77

88
return RectorConfig::configure()
99
->withPaths([
@@ -12,5 +12,5 @@
1212
// uncomment to reach your current PHP version
1313
->withPhpSets(php81: true)
1414
->withRules([
15-
AddVoidReturnTypeWhereNoReturnRector::class,
15+
SimplifyEmptyCheckOnEmptyArrayRector::class,
1616
]);

0 commit comments

Comments
 (0)