Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PhpDumper tries to access undefined method Alias::isShared #33942

Closed
@gquemener

Description

@gquemener

Symfony version(s) affected: 4.2+

Description
PhpDumper tries to access unknown method isShared from class Symfony\Component\DependencyInjection\Alias.

Here's the exact PHP error:

Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared() 

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184

How to reproduce

  1. Clone the https://github.com/prooph/service-bus-symfony-bundle repository
  2. Install the dependencies (this will install symfony/dependency-injection:4.3.*)
  3. Run the testsuite (./vendor/bin/phpunit)

I haven't been able (yet) to create a more minimalist environment, sorry about that!

Possible Solution
In PhpDumper::isSingleUsePrivateNode, apply the following patch:

- if ($edge->isLazy() || !$value->isShared()) {
+ if ($edge->isLazy() || ($value instanceof Definition && !$value->isShared())) {

Additional context
Further investigations are being led on prooph/service-bus-symfony-bundle#79

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