-
-
Notifications
You must be signed in to change notification settings - Fork 849
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
Allow to use container parameters as class name #2233
Conversation
Shouldn't this be done at the metadata factory level? |
/** | ||
* Recursively replaces placeholders with the service container parameters. | ||
* | ||
* @see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/Router.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | ||
* Base file extractor. | ||
* | ||
* @author Kévin Dunglas <dunglas@gmail.com> | ||
*/ | ||
abstract class AbstractExtractor implements ExtractorInterface | ||
{ | ||
private $container; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't private
come after protected
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @dunglas ?
@@ -13,6 +13,10 @@ | |||
|
|||
namespace ApiPlatform\Core\Metadata\Extractor; | |||
|
|||
use Psr\Container\ContainerInterface; | |||
use Symfony\Component\DependencyInjection\ContainerInterface as SymfonyContainerInterface; | |||
use function array_key_exists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mhh we're not doing this anywhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should, it's way better than a leading backslash. That said it's better to apply a fixer for it so let's remove it here
Allows to use a config like this one:
TODO: