Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/build_scoped_rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

# fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude_issue_fixer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
tools: composer:v2
coverage: none

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 @@ -92,7 +92,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- uses: "ramsey/composer-install@v4"
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 @@ -17,7 +17,7 @@ jobs:
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['8.3']
php_version: ['8.4']
directory:
- 'e2e/applied-auto-import'
- 'e2e/applied-polyfill-php80'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_command_with_option.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- uses: "ramsey/composer-install@v4"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e_with_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['8.3']
php_version: ['8.4']
directory:
- 'e2e/applied-rule-removed-node-with-cache'
- 'e2e/timeout-file-not-cached'
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none

- run: composer install --ansi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_with_no_diffs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['8.3']
php_version: ['8.4']
directory:
- 'e2e/applied-rule-removed-node-no-diffs'
- 'e2e/applied-no-diffs-format-json'
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 @@ -45,7 +45,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- run: composer config minimum-stability dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan_printer_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php-versions: ['8.3']
php-versions: ['8.4']

runs-on: ${{ matrix.os }}
timeout-minutes: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
-
name: 'Rector dev + PHPUnit 10'
run: composer require "phpunit/phpunit:10.*" -W
php: 8.2
php: 8.4
-
name: 'Rector dev + PHPUnit 11'
run: composer require "phpunit/phpunit:11.*" -W
php: 8.2
php: 8.4
-
name: 'Rector dev + PHPUnit 12'
run: composer require "phpunit/phpunit:12.*" -W
php: 8.3
php: 8.4

name: ${{ matrix.actions.name }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
# PHP 8.3 is required, so Rector's code is PHP 8.3 compatible even after refactoring
php-version: 8.3
# PHP 8.4 is required, so Rector's code is PHP 8.4 compatible even after refactoring
php-version: 8.4
coverage: none

- run: composer install --no-progress --ansi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rector_drupal_rector_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

# fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rector_laravel_rector_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

# fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remove_unused_deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- run: composer install --no-progress --ansi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php-versions: ['8.3', '8.4', '8.5']
php-versions: ['8.4', '8.5']

runs-on: ${{ matrix.os }}
timeout-minutes: 4
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 @@ -41,7 +41,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- uses: "ramsey/composer-install@v4"
Expand Down
4 changes: 2 additions & 2 deletions build/build-preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private function buildPreloadScriptPhpParser(string $buildDirectory, string $pre
*/
private function findPhpParserFiles(string $vendorDir): array
{
$finder = (new Finder())
$finder = new Finder()
->files()
->name('*.php')
->in($vendorDir . '/nikic/php-parser/lib/PhpParser')
Expand All @@ -233,7 +233,7 @@ private function findPhpParserFiles(string $vendorDir): array
*/
private function findPhpDocParserFiles(string $vendorDir): array
{
$finder = (new Finder())
$finder = new Finder()
->files()
->name('*.php')
->in($vendorDir . '/phpstan/phpdoc-parser')
Expand Down
14 changes: 5 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"migration"
],
"require": {
"php": "^8.3",
"php": "^8.4",
"clue/ndjson-react": "^1.3",
"composer/pcre": "^3.4.0",
"composer/semver": "^3.4",
Expand All @@ -36,7 +36,6 @@
"symfony/console": "^6.4.24",
"symfony/filesystem": "^7.4",
"symfony/finder": "^6.4",
"symfony/polyfill-php84": "^1.38",
"symfony/process": "^7.4",
"symplify/easy-parallel": "^11.2.2",
"symplify/rule-doc-generator-contracts": "^11.2",
Expand All @@ -51,14 +50,12 @@
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^12.5.6",
"rector/jack": "^0.5",
"rector/release-notes-generator": "^0.5.1",
"rector/jack": "^1.0",
"rector/swiss-knife": "^2.4.1",
"rector/type-perfect": "^2.1.2",
"shipmonk/composer-dependency-analyser": "^1.8",
"symplify/easy-coding-standard": "^13.1",
"symplify/phpstan-extensions": "^12.0.2",
"symplify/phpstan-rules": "^14.9.11",
"symplify/easy-coding-standard": "^13.2",
"symplify/phpstan-rules": "^14.12",
"symplify/vendor-patches": "^11.5",
"tomasvotruba/class-leak": "^2.1",
"tomasvotruba/unused-public": "^2.2",
Expand Down Expand Up @@ -118,8 +115,7 @@
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse --ansi --memory-limit=512M",
"rector": "bin/rector process --ansi",
"preload": "php build/build-preload.php .",
"release": "vendor/bin/rng --from-commit X --to-commit Y --remote-repository rectorphp/rector-symfony --remote-repository rectorphp/rector-doctrine --remote-repository rectorphp/rector-phpunit"
"preload": "php build/build-preload.php ."
},
"extra": {
"patches": {
Expand Down
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// use faster in-memory cache in CI.
// CI always starts from scratch, therefore IO intensive caching is not worth it
if ((new CiDetector())->isCiDetected()) {
if (new CiDetector()->isCiDetected()) {
$rectorConfig->cacheClass(MemoryCacheStorage::class);
}

Expand Down
23 changes: 13 additions & 10 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ parameters:
checkMissingCallableSignature: true
treatPhpDocTypesAsCertain: false

# see https://github.com/symplify/phpstan-rules
symplify:
symfonyReturnType: true
laravelReturnType: true
pathStrings: true
ctor: true

paths:
- rector.php
- bin
Expand Down Expand Up @@ -344,12 +351,9 @@ parameters:
# list vs array
- '#Parameter (.*?) expects list<(.*?)>, array<(.*?)> given#'

- identifier: symplify.noConstructorOverride
path: src/StaticTypeMapper/ValueObject/Type/SimpleStaticType.php

-
identifier: arrayValues.list
path: rules/CodingStyle/Application/UseImportsAdder.php
identifier: symplify.noConstructorOverride
path: src/StaticTypeMapper/ValueObject/Type/SimpleStaticType.php

-
message: '#Offset float\|int\|string might not exist on string#'
Expand Down Expand Up @@ -449,12 +453,11 @@ parameters:

- '#Provide more specific return type "Iterator|PhpParser\\Node" over abstract one#'

# BC layer
-
message: '#Access to deprecated property \$file of class Rector\\Rector\\AbstractRector#'
path: src/Rector/AbstractRector.php

# allowed
-
message: '#"@\\simplexml_load_string\(\$junitXml\)" is forbidden to use#'
path: scripts/remove-unused-deps.php

-
path: src/Util/Reflection/PrivatesAccessor.php
identifier: symplify.newOverSetters
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Do_;
Expand Down Expand Up @@ -208,6 +209,6 @@ private function isInPropertyPromotedParams(Class_ $class, PropertyFetch|StaticP
/** @var string $propertyName */
$propertyName = $this->getName($propertyFetch);
$params = $this->promotedPropertyResolver->resolveFromClass($class);
return array_any($params, fn (Node $param): bool => $this->isName($param, $propertyName));
return array_any($params, fn (Param $param): bool => $this->isName($param, $propertyName));
}
}
4 changes: 2 additions & 2 deletions scripts/no-php-file-in-fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function findPhpFiles(array $directories): array
{
Assert::allDirectory($directories);

$finder = (new Finder())
$finder = new Finder()
->files()
->in($directories)
->path('/Fixture')
Expand All @@ -92,7 +92,7 @@ private function findFixtureFiles(array $directories): array
{
Assert::allDirectory($directories);

$finder = (new Finder())
$finder = new Finder()
->files()
->in($directories)
->path('Fixture')
Expand Down
3 changes: 2 additions & 1 deletion src/Bootstrap/AutoloadFileParameterResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public static function resolveFromArgv(array $argv): void
// handles "--autoload-file path", "--autoload-file=path" and "-a path";
// parallel workers receive the space-separated form, so all spellings must
// normalize to the same value or main process and workers would disagree
$autoloadFile = (new ArgvInput($argv))->getParameterOption(['--autoload-file', '-a'], null);
$autoloadFile = new ArgvInput($argv)
->getParameterOption(['--autoload-file', '-a'], null);
if (! is_string($autoloadFile) || $autoloadFile === '') {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ public function withSkipPath(string $skipPath): self
*/
public function withRootFiles(): self
{
$rootPhpFilesFinder = (new Finder())->files()
$rootPhpFilesFinder = new Finder()
->files()
->in(getcwd())
->depth(0)
->ignoreDotFiles(false)
Expand Down
2 changes: 1 addition & 1 deletion src/PhpParser/Comparing/NodeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function isNodeEqual(Node $singleNode, array $availableNodes): bool
{
return array_any(
$availableNodes,
fn (Node|array|null $availableNode): bool => $this->areNodesEqual($singleNode, $availableNode)
fn (Node $availableNode): bool => $this->areNodesEqual($singleNode, $availableNode)
);
}

Expand Down
Loading