Implemented `NewExpressionParenthesesFixer` to support my "new without parentheses" RFC for PHP 8.4. Looking forward to review from @PHPCSFixer 😉
https://t.co/6pWm1v3mZb
I prototyped something over the weekend:
phpup – A single-file binary to run Composer and other tools, and to install a per-project PHP interpreter.
You don't need to have PHP installed on your machine to use it.
I admire how courageously you face the disease. I am so happy to know you in person (we met at SymfonyCon Amsterdam in 2019). Stay strong! Wish you all the best. ❤️
@lito_ordes@myakshin@pronskiy Unfortunately, this is not static analysis friendly. I usually add named static factories that reflect domain language. For instance, `Uuid::fromString(string)`, `Color::fromHex(string)`, etc.
@mrtoakdeniz@pronskiy I think, you are just not used. You don't read `new MyClass()` as `new` + `MyClass()` function call, do You? Same here. In other languages it seems natural and does not raise any questions. Anyway, RFC does not prohibit to continue using parentheses to emphasize priority.
@myakshin@pronskiy That would be a BC break for already existing static methods named "new" with required parameters. At the same time, other languages for years supported new without parentheses, so we can just bring PHP in line.
@enunomaduro Check out https://t.co/I29D5SYSDs, it already has a type system, extracted from Psalm and PHPStan and a Reflection with all types supported. Could be helpful for your idea.
@doekenorg@pronskiy@olegandreyev If it were ambiguous, PHP language bison grammar would not compile in my PR. But it did, so it's okay, it means that parser can unambiguously determine what the code should do.
@Ocramius Once we were coding side by side at EU-FOSSA Hackathon in Brussels. That was cool and inspiring, we were all from different places and cultures and it meant nothing for collaboration. I would've never believed that you can post such a stupid generalization.