-
-
Notifications
You must be signed in to change notification settings - Fork 431
[WIP] Feat: Type properties with PHP >= 7.4 #689
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
Conversation
Hi @Superkooka! Ah, thank you for this! It's been on my mind lately!!! ❤️ 2 quick things come to mind: A) If someone is using PHP 7.4, when would they not want to use typed properties? I'm wondering about the option: do we need it? Or, do you "envision" the question as a "sanity" check to make sure they aren't accidentally using php 7.4 on a code base that will actually use 7.3 (for example) on production? B) There are various other spots where we should also use typed properties. A simple - but probably not exhaustive - thing to check for is to search this bundle for Thanks! |
Hey @weaverryan Regarding behavior, what do you think of this? For all the commands that may need to generate class properties.
Second, for editing, what to base it on? Same behavior? Make:entity is the only command for "update" a php class ? Next, yes it should concern the whole bundle and not just make:entity. What would you recommend for this at the files level ? A new "Util" file ? Thanks ;) |
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.
Here are a few suggestions about the code style, and a few English fixes as well 👍
To avoid all the problems with the different versions of php (<7.4) I decided to use a global flag (--typed) as well as the possibility of activating this flag by default in a configuration file as long as the version minimum PHP supported by the maker bundle will not be >= 7.4. In the following day(s) I will rebase and force push on my branch to keep a clean history of commits |
feat: adding a configuration option to set the default typing
Hi 👋 ! I don't have the time to fix for passing the CI, so if someone can fix it, I just have to squash the commit and this PR is ready to merge. |
Seems the tests pass so far but the whole job was just cancelled after 10 minutes before they all finished. Could the tests be triggered again so we can see if there's still anything actually wrong? |
Just look to the "CI / PHP 7.1.3 + symfony/skeleton@stable" job, the other are automatically cancel after. |
That 7.1.3 run has tests skipped that are OK on 7.4 though. I doubt 7.1 is the top priority here... |
I think if the CI crash in 7.1, it's also crash on 7.4, the 7.1 is always supported and I don't know how to run only one test 😄 |
Hi @Superkooka great work so far! Just a heads up in PR #736 I've created a This is not merged yet but should be shortly. Once it's merged, I think rather than setting a flag - you'll be able to check the newly created |
Edit: now this flag is global and you can defined if you want to use typing in the configuraiton file 🥳 Just one test dosn't pass.
When it's fix, this PR is ready to be merge.
Hi 👋
With PHP 7.4 and the arrival of PHP 8.0 typing is starting to gain importance. So it's why I have adding the
--typed
flag. This flag type the properties of your entity.For exemple, with PHP 7.4 or more, if I create this entity, I obtain the PHP below:
If I execute this command with a lower PHP version I have a confirmation warning to ask if I really want typed properties.
To run the test, this pr need PHP 7.4 inot the CI, see #690