Skip to content

Commit

Permalink
Fix/272 Strict phpunit10 feature for php 81 (#289)
Browse files Browse the repository at this point in the history
Co-authored-by: Erison Silva <[email protected]>
  • Loading branch information
eerison and Erison Silva authored Nov 7, 2023
1 parent 6903fc7 commit 7978595
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Reflection\ReflectionResolver;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\Core\ValueObject\PhpVersion;
use Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
Expand Down Expand Up @@ -82,7 +82,13 @@ public function getNodeTypes(): array

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
/**
* This rule just work for phpunit 10,
* And as php 8.1 is the min version supported by phpunit 10, then we decided to let this version as minimum.
*
* You can see more detail in this issue: https://github.com/rectorphp/rector-phpunit/issues/272
*/
return PhpVersion::PHP_81;
}

/**
Expand Down
10 changes: 8 additions & 2 deletions src/Rector/StmtsAwareInterface/WithConsecutiveRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use PhpParser\NodeTraverser;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\Core\ValueObject\PhpVersion;
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
Expand Down Expand Up @@ -125,7 +125,13 @@ public function refactor(Node $node)

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::MATCH_EXPRESSION;
/**
* This rule just work for phpunit 10,
* And as php 8.1 is the min version supported by phpunit 10, then we decided to let this version as minimum.
*
* You can see more detail in this issue: https://github.com/rectorphp/rector-phpunit/issues/272
*/
return PhpVersion::PHP_81;
}

/**
Expand Down

0 comments on commit 7978595

Please sign in to comment.