Skip to content

autowire on servicecontainer #18132

@FloSeas

Description

@FloSeas

I found a strand behavior with servicecontainer and autowire.

When I inject a service container and autowire it, the parameter bag is not resolved.

Basicly, with this definition of my service

    widget.manager:
        class: Widgets\Bundle\CoreBundle\Manager\WidgetManager
        arguments: ['@widget.renderer', '@service_container']

I am able to get parameters like:

$this->serviceContainer->getParameter('my.param')

But when I use autowire like this

    widget.manager:
        class: Widgets\Bundle\CoreBundle\Manager\WidgetManager
        autowire: true

on the same service, the parameter bag is not resolved and i get an error like "the prameter 'my parameter' does not exist".

Maybe it's a normal behavior, cause the service container is a special service, but we should have at least some meaningfull error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy