Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
use Rector\Rector\AbstractRector;
use Rector\Reflection\ReflectionResolver;
use Rector\ValueObject\PhpVersion;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector\DataProviderAnnotationToAttributeRectorTest
*/
final class DataProviderAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface
final class DataProviderAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface
{
public function __construct(
private readonly TestsNodeAnalyzer $testsNodeAnalyzer,
Expand Down Expand Up @@ -84,6 +86,11 @@ public function getNodeTypes(): array
return [ClassMethod::class];
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector\DependsAnnotationWithValueToAttributeRectorTest
*/
final class DependsAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface
final class DependsAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface
{
private const string DEPENDS_ATTRIBUTE = 'PHPUnit\Framework\Attributes\Depends';

Expand Down Expand Up @@ -85,6 +87,11 @@ public function getNodeTypes(): array
return [Class_::class];
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand All @@ -28,7 +30,7 @@
*
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\TestWithAnnotationToAttributeRector\TestWithAnnotationToAttributeRectorTest
*/
final class TestWithAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface
final class TestWithAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface
{
private const string TEST_WITH_ATTRIBUTE = 'PHPUnit\Framework\Attributes\TestWith';

Expand Down Expand Up @@ -148,6 +150,11 @@ public function refactor(Node $node): ?Node
return $node;
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
use Rector\PHPUnit\ValueObject\AnnotationWithValueToAttribute;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use Webmozart\Assert\Assert;

/**
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector\AnnotationWithValueToAttributeRectorTest
*/
final class AnnotationWithValueToAttributeRector extends AbstractRector implements ConfigurableRectorInterface, MinPhpVersionInterface
final class AnnotationWithValueToAttributeRector extends AbstractRector implements ConfigurableRectorInterface, MinPhpVersionInterface, ComposerPackageConstraintInterface
{
/**
* @var AnnotationWithValueToAttribute[]
Expand Down Expand Up @@ -89,6 +91,11 @@ public function getNodeTypes(): array
return [Class_::class];
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector\CoversAnnotationWithValueToAttributeRectorTest
*/
final class CoversAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface
final class CoversAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface
{
private const string COVERS_FUNCTION_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversFunction';

Expand Down Expand Up @@ -94,6 +96,11 @@ public function getNodeTypes(): array
return [Class_::class, ClassMethod::class];
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\RequiresAnnotationWithValueToAttributeRector\RequiresAnnotationWithValueToAttributeRectorTest
*/
final class RequiresAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface
final class RequiresAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface
{
public function __construct(
private readonly PhpDocTagRemover $phpDocTagRemover,
Expand Down Expand Up @@ -84,6 +86,11 @@ public function getNodeTypes(): array
return [Class_::class, ClassMethod::class];
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand All @@ -31,7 +33,7 @@
*
* @see \Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\TicketAnnotationToAttributeRector\TicketAnnotationToAttributeRectorTest
*/
final class TicketAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface
final class TicketAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface
{
private const string TICKET_CLASS = 'PHPUnit\Framework\Attributes\Ticket';

Expand Down Expand Up @@ -81,6 +83,11 @@ public function getNodeTypes(): array
return [Class_::class, ClassMethod::class];
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('phpunit/phpunit', '>=10.0');
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
use Rector\PHPUnit\Enum\PHPUnitAttribute;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Rector\PHPUnit\Tests\PHPUnit120\Rector\Class_\AllowMockObjectsForDataProviderRector\AllowMockObjectsForDataProviderRectorTest
*/
final class AllowMockObjectsForDataProviderRector extends AbstractRector
final class AllowMockObjectsForDataProviderRector extends AbstractRector implements MinPhpVersionInterface
{
public function __construct(
private readonly TestsNodeAnalyzer $testsNodeAnalyzer,
Expand All @@ -36,6 +38,11 @@ public function getNodeTypes(): array
return [Class_::class];
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
}

/**
* @param Class_ $node
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Rector\PHPUnit\Enum\PHPUnitClassName;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand All @@ -25,7 +27,7 @@
*
* @see https://github.com/sebastianbergmann/phpunit/commit/24c208d6a340c3071f28a9b5cce02b9377adfd43
*/
final class AllowMockObjectsWhereParentClassRector extends AbstractRector
final class AllowMockObjectsWhereParentClassRector extends AbstractRector implements MinPhpVersionInterface
{
/**
* @var string[]
Expand All @@ -44,6 +46,11 @@ public function getNodeTypes(): array
return [Class_::class];
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
}

/**
* @param Class_ $node
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\Rector\AbstractRector;
use Rector\ValueObject\MethodName;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand All @@ -32,7 +34,7 @@
*
* @see https://github.com/sebastianbergmann/phpunit/commit/24c208d6a340c3071f28a9b5cce02b9377adfd43
*/
final class AllowMockObjectsWithoutExpectationsAttributeRector extends AbstractRector
final class AllowMockObjectsWithoutExpectationsAttributeRector extends AbstractRector implements MinPhpVersionInterface
{
public function __construct(
private readonly TestsNodeAnalyzer $testsNodeAnalyzer,
Expand All @@ -47,6 +49,11 @@ public function getNodeTypes(): array
return [Class_::class];
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ATTRIBUTES;
}

/**
* @param Class_ $node
*/
Expand Down
Loading