[WIP] Add PHP 8 support and configuration by attributes#3
[WIP] Add PHP 8 support and configuration by attributes#3zluiten wants to merge 2 commits intoevent-engine:masterfrom
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.