-
Notifications
You must be signed in to change notification settings - Fork 2
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
[WIP] Add PHP 8 support and configuration by attributes #3
base: master
Are you sure you want to change the base?
Conversation
cdc4494
to
bc487f3
Compare
I like the changes, but I'm not sure if we should merge it here or instead add PHP 8 attribute support to https://github.com/bitExpert/disco As stated in the readme: Discolight is inspired by disco. Hence, the name ;) @shochdoerfer , @Netiul , @sandrokeil What do you think? |
That would be lovely. I had plans to create a version 1.0 of Disco supporting PHP 8 but I could not yet find the time to get started. I am more than willing to support this movement. |
Ah, I came to this library via event-engine and I think it's really good. Never looked any further even though https://github.com/bitExpert/disco is indeed credited. I'm more than happy to move these changes and see if @shochdoerfer likes it. |
Yes, we should go to that Disco, if they will play PHP 8 attributes. ;-) |
@Netiul feel free to open an issue in the Disco repo to discuss things. I assume we need to change quite a bit but that should not stop us ;) |
ping @heiglandreas just in case you are bored during the Christmas holidays :P |
…ons by using attributes. This adds support for registering multiple instances of the same type.
bc487f3
to
6e83d09
Compare
Re #2
This adds support for the following:
EventEngine\Discolight\ServiceDefinition
).callable
)Above list is available for PHP 8 only but doesn't break applications running PHP 7.
Example 1:
Example 2:
Fixed some unreachable code as well. The null check in the following code can not happen:
Oh, and I've removed the prooph/php-cs-fixer-config dependency for now, since it's not PHP 8 ready yet.