Skip to content

Commit

Permalink
Bump to Rector ~2.0.0 (#1177)
Browse files Browse the repository at this point in the history
* Bump to Rector ~2.0.0

* skip FirstClassCallableRector on UseCaseTest
  • Loading branch information
samsonasik authored Dec 13, 2024
1 parent da883f8 commit 99da899
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"phpunit/phpunit": "10.5.3",
"ramsey/collection": "^1.2",
"ramsey/uuid": "^4.2.3",
"rector/rector": "1.2.10",
"rector/rector": "~2.0.0",
"spiral/code-style": "^2.2",
"spiral/nyholm-bridge": "^1.2",
"spiral/testing": "^2.8",
Expand Down
9 changes: 5 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;

Expand Down Expand Up @@ -105,13 +106,13 @@
__DIR__ . '/src/Scaffolder/src/Command',
],

\Rector\PHPUnit\PHPUnit100\Rector\MethodCall\AssertIssetToAssertObjectHasPropertyRector::class => [
// ArrayAccess usage
__DIR__ . '/src/Session/tests/SessionTest.php',
FirstClassCallableRector::class => [
__DIR__ . '/src/Core/tests/Scope/UseCaseTest.php',
],
])
->withPhpSets(php81: true)
->withPreparedSets(deadCode: true, phpunit: true)
->withPreparedSets(deadCode: true)
->withComposerBased(phpunit: true)
->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
ClassPropertyAssignToConstructorPromotionRector::RENAME_PROPERTY => false,
]);
2 changes: 1 addition & 1 deletion src/Queue/src/Attribute/RetryPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class RetryPolicy
{
/**
* @param 0|positive-int $maxAttempts
* @param int<0, max> $maxAttempts
* @param positive-int $delay in seconds.
*/
public function __construct(
Expand Down
8 changes: 4 additions & 4 deletions src/Queue/src/RetryPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
final class RetryPolicy implements RetryPolicyInterface
{
/**
* @var positive-int|0
* @var int<0, max>
*/
private readonly int $maxAttempts;

/**
* @var positive-int|0
* @var int<0, max>
*/
private readonly int $delay;

Expand Down Expand Up @@ -50,7 +50,7 @@ public function __construct(int $maxAttempts, int $delay, float $multiplier = 1)
}

/**
* @param positive-int|0 $attempts
* @param int<0, max> $attempts
*
* @return positive-int
*/
Expand All @@ -60,7 +60,7 @@ public function getDelay(int $attempts = 0): int
}

/**
* @param positive-int|0 $attempts
* @param int<0, max> $attempts
*/
public function isRetryable(\Throwable $exception, int $attempts = 0): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Queue/src/RetryPolicyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
interface RetryPolicyInterface
{
/**
* @param positive-int|0 $attempts
* @param int<0, max> $attempts
*/
public function isRetryable(\Throwable $exception, int $attempts = 0): bool;

/**
* @param positive-int|0 $attempts
* @param int<0, max> $attempts
*
* @return positive-int
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/src/Bucket/ReadableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getLastModified(string $pathname): int;
/**
* Returns the file size in bytes.
*
* @return positive-int|0
* @return int<0, max>
* @throws FileOperationException
*/
public function getSize(string $pathname): int;
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/src/Bucket/ReadableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getLastModified(string $pathname): int
}

/**
* @return positive-int|0
* @return int<0, max>
*/
public function getSize(string $pathname): int
{
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/src/File/ReadableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getLastModified(): int;
/**
* {@see BucketInterface::getSize()}
*
* @return positive-int|0
* @return int<0, max>
* @throws FileOperationException
*/
public function getSize(): int;
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/src/File/ReadableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getLastModified(): int
}

/**
* @return positive-int|0
* @return int<0, max>
*/
public function getSize(): int
{
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/src/Storage/ReadableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function exists(string|\Stringable $id): bool;
/**
* {@see BucketInterface::getLastModified()}
*
* @return positive-int|0
* @return int<0, max>
* @throws FileOperationException
* @throws InvalidArgumentException
*/
Expand All @@ -54,7 +54,7 @@ public function getLastModified(string|\Stringable $id): int;
/**
* {@see BucketInterface::getSize()}
*
* @return positive-int|0
* @return int<0, max>
* @throws FileOperationException
* @throws InvalidArgumentException
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/src/Storage/ReadableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function exists(string|\Stringable $id): bool
}

/**
* @return positive-int|0
* @return int<0, max>
*/
public function getLastModified(string|\Stringable $id): int
{
Expand All @@ -50,7 +50,7 @@ public function getLastModified(string|\Stringable $id): int
}

/**
* @return positive-int|0
* @return int<0, max>
*/
public function getSize(string|\Stringable $id): int
{
Expand Down

0 comments on commit 99da899

Please sign in to comment.