Skip to content

Commit

Permalink
Merge pull request codeigniter4#9015 from samsonasik/refactor-enable-…
Browse files Browse the repository at this point in the history
…phpunit-attribute

refactor: Enable phpunit 10 attribute Rector rules
  • Loading branch information
samsonasik authored Jun 30, 2024
2 parents 01f52ef + 8ab9e40 commit bab8828
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
12 changes: 0 additions & 12 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
Expand Down Expand Up @@ -176,13 +171,6 @@

// Unnecessary (string) is inserted
NullToStrictStringFuncCallArgRector::class,

// PHPUnit 10 (requires PHP 8.1) features
DataProviderAnnotationToAttributeRector::class,
DependsAnnotationWithValueToAttributeRector::class,
AnnotationWithValueToAttributeRector::class,
AnnotationToAttributeRector::class,
CoversAnnotationWithValueToAttributeRector::class,
])
// auto import fully qualified class names
->withImportNames(removeUnusedImports: true)
Expand Down
5 changes: 2 additions & 3 deletions system/Test/DatabaseTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Config\Database;
use Config\Migrations;
use Config\Services;
use PHPUnit\Framework\Attributes\AfterClass;

/**
* DatabaseTestTrait
Expand Down Expand Up @@ -228,14 +229,12 @@ public function seed(string $name)
// --------------------------------------------------------------------
// Utility
// --------------------------------------------------------------------

/**
* Reset $doneMigration and $doneSeed
*
* @afterClass
*
* @return void
*/
#[AfterClass]
public static function resetMigrationSeedCount()
{
self::$doneMigration = false;
Expand Down

0 comments on commit bab8828

Please sign in to comment.