Skip to content

Commit dc0375a

Browse files
authored
fix: Fix phpstan issues and update pipeline actions to current versions (#324)
* fix: update property access methods to use instanceProperty since it has been deprecated * Revert "fix: update property access methods to use instanceProperty since it has been deprecated" This reverts commit 9541652. * chore: since we need to support phpstan 1 lets baseline the deprecations * chore: fix phpstan 1 analysis. Ignore a few deprecations * chore: ignore ->file -> ->getFile() for now until we drop phpstan 1. * build: small phpcs fixes * build: update setup drupal action * build: fixup php versions * build: remove -vvv
1 parent 943d206 commit dc0375a

31 files changed

Lines changed: 268 additions & 68 deletions

.github/workflows/functional_test__rector_examples.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
include:
22-
- php-version: "8.1"
22+
- php-version: "8.2"
2323
drupal: "^10.0"
2424
fixture: "d10"
25-
- php-version: "8.3"
25+
- php-version: "8.4"
2626
drupal: "^10.0"
2727
fixture: "d10"
2828
runs-on: ubuntu-latest
@@ -35,7 +35,7 @@ jobs:
3535
tools: composer:v2
3636
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, gd
3737
- name: Setup Drupal
38-
uses: bluehorndigital/setup-drupal@v1.0.4
38+
uses: bluehorndigital/setup-drupal@v1.2.0
3939
with:
4040
version: '${{ matrix.drupal }}'
4141
path: ~/drupal

.github/workflows/functional_test__single_rectors.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
- uses: actions/checkout@v3
2020
- uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: "${{ matrix.php-version }}"
22+
php-version: "8.4"
2323
coverage: none
2424
tools: composer:v2
2525
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, gd
2626
- name: Setup Drupal
27-
uses: bluehorndigital/setup-drupal@v1.0.4
27+
uses: bluehorndigital/setup-drupal@v1.2.0
2828
with:
2929
version: '^11.0'
3030
path: ~/drupal
@@ -47,7 +47,7 @@ jobs:
4747
if [ -d "$d" ]; then
4848
echo "Processing $d"
4949
cp vendor/palantirnet/drupal-rector/tests/functional/$(basename ${d})/rector.php .
50-
vendor/bin/rector process $d -vvv --dry-run --debug || if (($? == 2)); then true; else exit 1; fi
50+
vendor/bin/rector process $d --dry-run --debug || if (($? == 2)); then true; else exit 1; fi
5151
fi
5252
done
5353
- name: Run rector against Drupal

phpstan-1-baseline.neon

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ parameters:
7373
count: 1
7474
path: rector.php
7575

76+
-
77+
message: """
78+
#^Instantiation of deprecated class PhpParser\\\\Node\\\\Expr\\\\ArrayItem\\:
79+
use \\\\PhpParser\\\\Node\\\\ArrayItem instead\\.$#
80+
"""
81+
count: 1
82+
path: src/Drupal10/Rector/Deprecation/WatchdogExceptionRector.php
83+
7684
-
7785
message: "#^Access to an undefined property PhpParser\\\\Node\\\\Expr\\:\\:\\$value\\.$#"
7886
count: 2
@@ -143,7 +151,39 @@ parameters:
143151
count: 1
144152
path: src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector.php
145153

154+
-
155+
message: """
156+
#^Instantiation of deprecated class PhpParser\\\\Node\\\\Scalar\\\\Encapsed\\:
157+
use \\\\PhpParser\\\\Node\\\\Scalar\\\\InterpolatedString instead\\.$#
158+
"""
159+
count: 1
160+
path: src/Drupal9/Rector/Deprecation/AssertNoUniqueTextRector.php
161+
162+
-
163+
message: """
164+
#^Instantiation of deprecated class PhpParser\\\\Node\\\\Scalar\\\\EncapsedStringPart\\:
165+
use \\\\PhpParser\\\\Node\\\\InterpolatedStringPart instead\\.$#
166+
"""
167+
count: 3
168+
path: src/Drupal9/Rector/Deprecation/AssertNoUniqueTextRector.php
169+
170+
-
171+
message: """
172+
#^Instantiation of deprecated class PhpParser\\\\Node\\\\Scalar\\\\LNumber\\:
173+
use \\\\PhpParser\\\\Node\\\\Scalar\\\\Int_ instead\\.$#
174+
"""
175+
count: 1
176+
path: src/Drupal9/Rector/Deprecation/AssertNoUniqueTextRector.php
177+
146178
-
147179
message: "#^Call to an undefined method PHPStan\\\\Type\\\\Type\\:\\:getValue\\(\\)\\.$#"
148180
count: 1
149181
path: src/Drupal9/Rector/Deprecation/ExtensionPathRector.php
182+
183+
-
184+
message: """
185+
#^Instantiation of deprecated class PhpParser\\\\Node\\\\Stmt\\\\UseUse\\:
186+
use \\\\PhpParser\\\\Node\\\\UseItem instead\\.$#
187+
"""
188+
count: 1
189+
path: src/Rector/Convert/HookConvertRector.php

phpstan-1.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ parameters:
44
- config
55
- src
66
- rector.php
7-
bootstrapFiles:
8-
- vendor/rector/rector/vendor/autoload.php
97
dynamicConstantNames:
108
- Drupal::VERSION
119
includes:

0 commit comments

Comments
 (0)