🔥 Simple DIC - PHP DI Container with autowiring in a single file allows you to easily use it in your PHP applications and especially convenient for WordPress plugins and themes.
Generics could not be applied because we use as classes and as string types as well.
So due to that in case of using combining types it would not work, and we get an error
due to type normalizing.
And in case we use just class-string and returning type T it works for classes but doesn't work for string in $c->get('string-service') in case we use primitives
https://phpstan.org/blog/generics-by-examples#function-accepts-any-string%2C-but-returns-object-of-the-same-type-if-it%E2%80%99s-a-class-string
Generics could not be applied because we use as classes and as string types as well. So due to that in case of using combining types it would not work, and we get an error
due to type normalizing. And in case we use just
class-string
and returning typeT
it works for classes but doesn't work for string in$c->get('string-service')
in case we use primitives