Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update github actions/checkout from v3 to v4 #4909

Merged
merged 2 commits into from
Sep 4, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/build_scoped_rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: sleep 20

-
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# see https://github.com/shivammathur/setup-php
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis_no_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_consecutive_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_with_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packages_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php_linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 3

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

-
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

name: PHP 8.1 tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

-
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly_pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/bare_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/e2e_diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/e2e_global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/e2e_php72.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/e2e_php74.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion templates/rector-github-action-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down