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

[scoped on PHP 7.0] bin/rector run with extracted phpstan #6371

Merged
merged 2 commits into from
May 6, 2021

Conversation

TomasVotruba
Copy link
Member

No description provided.

@TomasVotruba TomasVotruba changed the title bin/rector run with extracted phpstan [scoped on PHP 7.0] bin/rector run with extracted phpstan May 6, 2021
composer.json Outdated
@@ -96,7 +96,8 @@
},
"files": [
"src/functions/node_helper.php",
"src/constants.php"
"src/constants.php",
"vendor/phpstan/phpstan-extracted/vendor/autoload.php"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will load phpstan's autoload and its own vendor/nikic/php-parser.
This package is in the same version, so Rector's preload.php would conflict with same classes.

That's why its nulled bellow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line must be added via config CLI command: composer config ...

In: .github/workflows/build_scoped_rector_php70.yaml

Now it breaks other builds

- run: rm -rf vendor/phpstan/phpstan/phpstan.phar

# THIS MUST WORK
- run: bin/rector downgrade-paths
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far so good :)

image

preload.php Outdated Show resolved Hide resolved
@TomasVotruba TomasVotruba marked this pull request as draft May 6, 2021 13:10
@TomasVotruba
Copy link
Member Author

@samsonasik Here is a prototype of PHP 7.0 build that doesn't use on phpstan-src but extracts phpstan.phar. It solves lots of issues with installation and scoping. Feel free to inspire here

@ondrejmirtes
Copy link
Contributor

As I said, your job might be easier if you contribute the PHP 7.0 downgrading to PHPStan compiling itself.

@TomasVotruba
Copy link
Member Author

TomasVotruba commented May 6, 2021

Might do later, but first I need to Rector work on PHP 7.0. Now it can handle PHP 7.1 tops. This is just theory :)

You can add Rector to your build workflow later based on our downgrade build. Should be easy.

@samsonasik
Copy link
Member

@TomasVotruba thank you 👍

@TomasVotruba TomasVotruba marked this pull request as ready for review May 6, 2021 20:56
"rector/rector-installer": "^0.10.1",
"rector/extension-installer": "^0.10.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sabbelasichon Btw, I flipped the name to extension-installer, as rector-<x> name is used for framework-specific sets. Like rector-nette, rector-symfony etc.
This should make also clear it does not install rector, but extensions.

@TomasVotruba TomasVotruba merged commit d225be2 into main May 6, 2021
@TomasVotruba TomasVotruba deleted the php70-extract branch May 6, 2021 21:43
TomasVotruba added a commit that referenced this pull request Oct 11, 2024
rectorphp/rector-src@203651a [CodeQuality] Skip else indirect return on SimplifyIfReturnBoolRector (#6371)
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.

3 participants