Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DependencyInjection] PhpDumper, abstract service and factory. #17353

Closed
@fbourigault

Description

@fbourigault

While using Symfony 2.7.6 (composer update won't let me update to 2.7.8 even with a ^2.7.0 dependency :/) andcsa/guzzle-bundle 2.0.4 andguzzlehttp/guzzle 6.1.1 I encountered a bug that lead to generate the following code inappDevDebugProjectContainer.php (I removed some sensitive data):

/**     * Gets the 'csa_guzzle.client.my_client' service.     *     * This service is shared.     * This method always returns the same instance of the service.     *     * @return \GuzzleHttp\Client A GuzzleHttp\Client instance.     */protectedfunctiongetCsaGuzzle_Client_MyClientService()    {$a =new \UL();$a->push($this->get('csa_guzzle.middleware.stopwatch'),'stopwatch');$a->push($this->get('csa_guzzle.middleware.logger'),'logger');$a->push($this->get('csa_guzzle.middleware.history'),'history');return$this->services['csa_guzzle.client.my_client'] =new \GuzzleHttp\Client(array('base_uri' =>'https://...','headers' =>array('Authorization' =>'Bearer ...','Content-Type' =>'...'),'on_stats' =>array(0 =>$this->get('csa_guzzle.data_collector.guzzle'),1 =>'addStats'),'handler' =>$a));    }

The service is defined from an abstract service using a factory:
https://github.com/csarrazi/CsaGuzzleBundle/blob/v2.0.4/src/Resources/config/middleware.xml#L9
and decorated in a compiler pass:
https://github.com/csarrazi/CsaGuzzleBundle/blob/v2.0.4/src/DependencyInjection/CompilerPass/MiddlewarePass.php#L117

I did some debug in PhpDumper and notice that in:
https://github.com/symfony/symfony/blob/v2.7.6/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L752
the$class value returned is NULL and:
https://github.com/symfony/symfony/blob/v2.7.6/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L800
makes it look like$a = new \UL().

I don't know if it's a csa/guzzle-bundle misuse of DependencyInjection or a bug in the PhpDumper class.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp