-
-
Notifications
You must be signed in to change notification settings - Fork 327
PHP-DI 7.0 #726
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
PHP-DI 7.0 #726
Conversation
We can get rid of PhpDocReader
Would be nice to see #662 included in 7.0 or some kind of it — I mean the ability to disable |
@b1rdex why would you want to disable |
I thought disabling it has some performance benefits.
Отправлено с iPhone
… 8 авг. 2020 г., в 17:58, Matthieu Napoli ***@***.***> написал(а):
@b1rdex why would you want to disable @Inject? Annotations are disabled by default anyway, so it's already the case 🤔
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Not really, if you don't use annotations those are not read. |
Inject via PHP 8 attributes
Little feedback on v7 I've created a new branch at https://github.com/juliangut/slim-php-di targetting 7.0-beta2 and so far everything went smoothly with PHP7.4, didn't test in PHP8 yet |
Awesome, thanks for the feedback @juliangut I'm using that new version in a prototype for now, going great. PHP 8 attributes are super cool! |
# Conflicts: # .travis.yml # composer.json # tests/UnitTest/Definition/Source/Fixtures/AnnotationFixture5.php
A small attribute feedback: unlike phpdoc, attributes can be assigned to parameters so #[Inject(['param2' => 'db.host'])]
public function method3(Foo $param1, $param2)
{
} can be public function method3(Foo $param1, #[Inject('db.host')] $param2)
{
} It would be nice to have it |
@arokettu absolutely, thank you for pointing it out! I completely forgot about that until I see that Symfony did exactly that recently. I want to implement that now 👍 |
Support PHP 8 attributes at the parameter level
@mnapoli awesome, thanks |
FWIW I have a fairly extensive Container test suite that's been utilizing |
# Conflicts: # src/Compiler/ObjectCreationCompiler.php # src/Container.php # src/Definition/Resolver/DefinitionResolver.php # src/Definition/Resolver/ObjectCreator.php # src/Definition/Resolver/ParameterResolver.php # src/Definition/Source/Autowiring.php # src/Definition/Source/DefinitionSource.php
PHP 7.4 reaches its end of life in 10 days. |
Any updates about the status of all this? I'm confused, see #833. |
Hello @mnapoli , |
# Conflicts: # .php-cs-fixer.php # composer.json # phpstan-baseline.neon
Hey everyone, I apologize for dropping the ball here. Big major versions like these are scary, and when you work on a project a few hours every month, it's hard to be confident enough to go over that scariness :) Though I do appreciate a lot the feedback from those that tested the beta versions (and had no issues). That is great to hear! Let's move this forward! I am setting a release date to next Thursday because that will be my birthday :p I'll tag a release candidate tonight, let's do this! |
Thank you for your reply. Looking forward to this release 😄 |
Yay, thanks a bunch @mnapoli! |
Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>
Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>
Today is the day 🎉 |
🎉 Happy hippy birthday @mnapoli and php-di:7.0.0! 🎉 |
Well thank you :) |
Happy birthday @mnapoli! And thank you for all you do, it's really appreciated 🎉 |
Awesome! And happy birthday to you! 🎉 |
This pull request contains a possible v7.0 version.
Changes:
new Container()
with definitions #769 Allownew Container()
with definitions#[Inject]
to replace@Inject
!@Inject
used with phpdoc annotations -> only native PHP types are supported nowThat makes PHP-DI simpler, faster and lighter (no need for the PhpDocReader package)
TODO:
@Inject
annotations in favor of attributes #812Blocked by: