Skip to content

Conversation

@GeniJaho
Copy link
Collaborator

Fixes #270.

@GeniJaho GeniJaho changed the title PHPStan 2 support PHPStan 2.0 support Nov 13, 2024
@samsonasik
Copy link
Collaborator

Try latest rector/rector:dev-main , it now already use phpstan 2 and php-parser 5 :)

@samsonasik
Copy link
Collaborator

You can upgrade to php-parser 5 nodes with rector-php-parser package

https://github.com/rectorphp/rector-php-parser

composer require rector/rector-php-parser:dev-main --dev

add rector.php

<?php

return RectorConfig::configure()
    // ...
+    ->withSets([\Rector\PhpParser\Set\PhpParserSetList::PHP_PARSER_50]);

and then, run rector:

vendor/bin/rector

@samsonasik
Copy link
Collaborator

Update composer.json require and require dev:

-        "rector/rector": "^1.2.5"
+        "rector/rector": "dev-main as 1.2.10"

and update phpstan and phpstan extension to v2:

        "phpstan/phpstan": "^2.0",
        "phpstan/phpstan-strict-rules": "^2.0",
        "phpstan/phpstan-webmozart-assert": "^2.0",

and temporary remove the following extension

       "symplify/phpstan-extensions": "^11.4",
        "symplify/phpstan-rules": "^12.4",

then remove --error-format symplify in composer command registered in composer.json temporary, until everything ready.

@GeniJaho GeniJaho changed the base branch from main to 2.x November 23, 2024 14:12
@GeniJaho GeniJaho changed the title PHPStan 2.0 support PHPStan & Rector 2.0 support Nov 23, 2024
@GeniJaho GeniJaho marked this pull request as ready for review November 23, 2024 16:09
@GeniJaho GeniJaho merged commit 01d2229 into 2.x Nov 23, 2024
5 checks passed
@GeniJaho GeniJaho deleted the phpstan-2 branch November 23, 2024 16:10
GeniJaho added a commit that referenced this pull request Dec 12, 2024
* PHPStan & Rector 2.0 support (#271)

* Update rector dependency to 2.0.0-rc1 (#273)

* Update rector to 2.0.0.rc2

* Simplify composer scripts

* Fix downgrade scripts

* Add MigrateToSimplifiedAttributeRector to Laravel 9 set (#275)

* Update Duster and use latest Pint configuration (#276)

* Update Duster

* Remove pint.json and run Duster

* Refactor into our own AbstractRector that implements DocumentedRuleInterface

* Update to Rector 2.0

---------

Co-authored-by: Michael Wikberg <[email protected]>
Co-authored-by: Abdul Malik Ikhsan <[email protected]>
Co-authored-by: M ɑ k s <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incoming PHPStan 2.0

3 participants