-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Apply PHP 8.0 Syntax and constructor promotion #140
Conversation
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
2cc96b5
to
8b3c9c5
Compare
All green 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @samsonasik!
if ($first instanceof ContainerInterface) { | ||
$container = $first; | ||
$instance = $second; | ||
} else { | ||
$container = $second; | ||
$instance = $first; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like that rector gets rid of random whitespace, but it's not critical :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's on PHP-Parser latest dev-master for keep the space, but probably only will land on PHP-Parser 5.0 nikic/PHP-Parser#891
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
Thanks @samsonasik! |
Amazing work 🥳 |
@TomasVotruba we still need to automate @samsonasik away xD |
@Ocramius We're working on that together... 😉 You'll notice our Github accounts start to look like human speaking 😆 |
@TomasVotruba aware, just saying that we probably need to put some effort in making this some sort of CI / bot. Absolutely hats off to @samsonasik's thankless and constant efforts, but I think that would be a big win for the ecosystem at large 👍 |
@Ocramius We already use it in CI as automated contributor: https://github.com/rectorphp/rector-src/blob/main/.github/workflows/rector.yaml |
Yeh, I discussed it with @samsonasik before: what we need is something that suggests changes (with github actions output format), rather than something that applies the changes :) I haven't worked on it myself yet, but probably something for https://github.com/rectorphp/rector/tree/b9c04e2a17bf233037d76ea2b9b2d7b411b5ec41/src/Console/Formatter Someday I'll try helping out there :D |
Signed-off-by: Abdul Malik Ikhsan samsonasik@gmail.com
Description
Since composer.json require php 8.0, php 8.0 syntax can constuctor promotion can be applied.