diff --git a/.github/workflows/build_scoped_rector.yaml b/.github/workflows/build_scoped_rector.yaml index c2fb9eae2d2..82151479820 100644 --- a/.github/workflows/build_scoped_rector.yaml +++ b/.github/workflows/build_scoped_rector.yaml @@ -31,7 +31,7 @@ jobs: run: sleep 20 - - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -83,7 +83,7 @@ jobs: # 6. clone remote repository, so we can push it - - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: repository: rectorphp/rector path: remote-repository diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index b1b94385adc..904ecf4c597 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -77,7 +77,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # see https://github.com/shivammathur/setup-php - diff --git a/.github/workflows/code_analysis_no_dev.yaml b/.github/workflows/code_analysis_no_dev.yaml index 51d75eac98f..bd689cb31c4 100644 --- a/.github/workflows/code_analysis_no_dev.yaml +++ b/.github/workflows/code_analysis_no_dev.yaml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4ec42dcaf17..5c733ccbc02 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -38,7 +38,7 @@ jobs: name: End to end test - ${{ matrix.directory }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/e2e_consecutive_changes.yaml b/.github/workflows/e2e_consecutive_changes.yaml index 53e7438c6ee..b83a8224be3 100644 --- a/.github/workflows/e2e_consecutive_changes.yaml +++ b/.github/workflows/e2e_consecutive_changes.yaml @@ -29,7 +29,7 @@ jobs: name: End to end test - ${{ matrix.directory }} [disableParallel=${{ matrix.rector_disable_parallel }}] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/e2e_with_cache.yaml b/.github/workflows/e2e_with_cache.yaml index 220768b3aaf..3f2f65e5ce0 100644 --- a/.github/workflows/e2e_with_cache.yaml +++ b/.github/workflows/e2e_with_cache.yaml @@ -30,7 +30,7 @@ jobs: name: End to end test - ${{ matrix.directory }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/packages_tests.yaml b/.github/workflows/packages_tests.yaml index d6f1623e1b7..147a7a82a72 100644 --- a/.github/workflows/packages_tests.yaml +++ b/.github/workflows/packages_tests.yaml @@ -37,7 +37,7 @@ jobs: steps: # see https://github.com/actions/checkout#usage - - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: repository: ${{ matrix.repository_name }} ref: "main" diff --git a/.github/workflows/php_linter.yaml b/.github/workflows/php_linter.yaml index 1fc34bc0cf4..1e300a1c714 100644 --- a/.github/workflows/php_linter.yaml +++ b/.github/workflows/php_linter.yaml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 3 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index fff5fe4255f..012d6ede6b1 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -19,7 +19,7 @@ jobs: if: github.event.pull_request.head.repo.full_name == 'rectorphp/rector-src' steps: - - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # Must be used to trigger workflow after push token: ${{ secrets.ACCESS_TOKEN }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5739c288bfb..2f83c66956b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,7 +19,7 @@ jobs: name: PHP 8.1 tests steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/weekly_pull_requests.yaml b/.github/workflows/weekly_pull_requests.yaml index 7b6997a12f4..456a029dba5 100644 --- a/.github/workflows/weekly_pull_requests.yaml +++ b/.github/workflows/weekly_pull_requests.yaml @@ -33,7 +33,7 @@ jobs: steps: - - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.ACCESS_TOKEN }} diff --git a/build/target-repository/.github/workflows/along_other_packages.yaml b/build/target-repository/.github/workflows/along_other_packages.yaml index d08576d09d6..4a291ca3c95 100644 --- a/build/target-repository/.github/workflows/along_other_packages.yaml +++ b/build/target-repository/.github/workflows/along_other_packages.yaml @@ -31,7 +31,7 @@ jobs: name: "PHP ${{ matrix.php_version }}" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/build/target-repository/.github/workflows/bare_run.yaml b/build/target-repository/.github/workflows/bare_run.yaml index d802a98b307..7116fd02555 100644 --- a/build/target-repository/.github/workflows/bare_run.yaml +++ b/build/target-repository/.github/workflows/bare_run.yaml @@ -16,7 +16,7 @@ jobs: php_version: ['7.2', '7.3', '7.4', '8.0', '8.1'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 diff --git a/build/target-repository/.github/workflows/e2e.yaml b/build/target-repository/.github/workflows/e2e.yaml index d05dac882fc..a6855653df2 100644 --- a/build/target-repository/.github/workflows/e2e.yaml +++ b/build/target-repository/.github/workflows/e2e.yaml @@ -25,7 +25,7 @@ jobs: name: End to end test - ${{ matrix.directory }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/build/target-repository/.github/workflows/e2e_diff.yaml b/build/target-repository/.github/workflows/e2e_diff.yaml index bd65c0cc129..ec962962fbc 100644 --- a/build/target-repository/.github/workflows/e2e_diff.yaml +++ b/build/target-repository/.github/workflows/e2e_diff.yaml @@ -22,7 +22,7 @@ jobs: name: End to end test with diff - ${{ matrix.directory }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/build/target-repository/.github/workflows/e2e_global.yaml b/build/target-repository/.github/workflows/e2e_global.yaml index 16bf3a9b425..a63793cc1bd 100644 --- a/build/target-repository/.github/workflows/e2e_global.yaml +++ b/build/target-repository/.github/workflows/e2e_global.yaml @@ -19,7 +19,7 @@ jobs: name: End to end test - ${{ matrix.directory }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/build/target-repository/.github/workflows/e2e_php72.yaml b/build/target-repository/.github/workflows/e2e_php72.yaml index 1246812919a..5a1d2c2ba62 100644 --- a/build/target-repository/.github/workflows/e2e_php72.yaml +++ b/build/target-repository/.github/workflows/e2e_php72.yaml @@ -13,7 +13,7 @@ jobs: name: End to end test - PHP 7.2 with load ReflectionUnionType stub steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/build/target-repository/.github/workflows/e2e_php74.yaml b/build/target-repository/.github/workflows/e2e_php74.yaml index fd30e3b4076..f85efaba581 100644 --- a/build/target-repository/.github/workflows/e2e_php74.yaml +++ b/build/target-repository/.github/workflows/e2e_php74.yaml @@ -16,7 +16,7 @@ jobs: name: End to end test - PHP 7.4 and Match class name steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/build/target-repository/.github/workflows/standalone_rule_test.yaml b/build/target-repository/.github/workflows/standalone_rule_test.yaml index 6dbcd92edd9..a7aa6fa4f92 100644 --- a/build/target-repository/.github/workflows/standalone_rule_test.yaml +++ b/build/target-repository/.github/workflows/standalone_rule_test.yaml @@ -19,7 +19,7 @@ jobs: name: End to end test - ${{ matrix.directory }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: diff --git a/rules/Php81/Rector/MethodCall/MyCLabsMethodCallToEnumConstRector.php b/rules/Php81/Rector/MethodCall/MyCLabsMethodCallToEnumConstRector.php index e3e9c02eccb..61fcdea349c 100644 --- a/rules/Php81/Rector/MethodCall/MyCLabsMethodCallToEnumConstRector.php +++ b/rules/Php81/Rector/MethodCall/MyCLabsMethodCallToEnumConstRector.php @@ -166,7 +166,7 @@ private function refactorGetValueMethodCall(MethodCall $methodCall): ?PropertyFe private function refactorEqualsMethodCall(MethodCall $methodCall): ?Identical { $expr = $this->getNonEnumReturnTypeExpr($methodCall->var); - if ($expr === null) { + if (!$expr instanceof Expr) { $expr = $this->getValidEnumExpr($methodCall->var); if (! $expr instanceof Expr) { return null; @@ -179,7 +179,7 @@ private function refactorEqualsMethodCall(MethodCall $methodCall): ?Identical } $right = $this->getNonEnumReturnTypeExpr($arg->value); - if ($right === null) { + if (!$right instanceof Expr) { $right = $this->getValidEnumExpr($arg->value); if (! $right instanceof Expr) { return null; diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php index bdb4ebfbdbc..e654f454c24 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php @@ -4,6 +4,8 @@ namespace Rector\TypeDeclaration\Rector\ClassMethod; +use PhpParser\Node\Stmt\Expression; +use PhpParser\Node\Expr\MethodCall; use PhpParser\Node; use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\AssignOp\Coalesce as AssignOpCoalesce; @@ -159,7 +161,7 @@ private function shouldStop(Node $node, string $paramName): bool $nodeToCheck = $firstArg->value; } - if ($node instanceof Node\Stmt\Expression) { + if ($node instanceof Expression) { $nodeToCheck = $node->expr; } @@ -171,7 +173,7 @@ private function shouldStop(Node $node, string $paramName): bool $nodeToCheck = $node->var; } - if ($nodeToCheck instanceof Node\Expr\MethodCall) { + if ($nodeToCheck instanceof MethodCall) { return $nodeToCheck->var instanceof Variable && $this->isName($nodeToCheck->var, $paramName); } diff --git a/templates/rector-github-action-check.yaml b/templates/rector-github-action-check.yaml index c5bee4ddcce..553f1d938ba 100644 --- a/templates/rector-github-action-check.yaml +++ b/templates/rector-github-action-check.yaml @@ -11,7 +11,7 @@ jobs: steps: - if: github.event.pull_request.head.repo.full_name == github.repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # Must be used to trigger workflow after push token: ${{ secrets.ACCESS_TOKEN }}