Skip to content

Commit

Permalink
Fixed rector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cradu committed Aug 28, 2024
1 parent c121fdf commit fa953bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tests/Fixtures/ClassWithRectorIssues.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

namespace Igorsgm\GitHooks\Tests\Fixtures;

Expand All @@ -9,6 +9,10 @@ class ClassWithRectorIssues
protected function test()
{
$a = [];

if (empty($a)) {
$a = ["string", 'another string'];
}

return $a;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/rectorFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;

return RectorConfig::configure()
->withPaths([
Expand All @@ -12,5 +12,5 @@
// uncomment to reach your current PHP version
->withPhpSets(php81: true)
->withRules([
AddVoidReturnTypeWhereNoReturnRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
]);

0 comments on commit fa953bb

Please sign in to comment.