Skip to content

Cannot access parent:: when current class scope has no parent #41133

Closed
@Androbin

Description

@Androbin

Symfony version(s) affected: 4.4

Description
If $p->getDefaultValueConstantName() starts with parent::, defined interprets it relative to the wrong base class.

How to reproduce
Minimal reproducing test project, only need to run composer install

Possible Solution
See #40774

Additional context

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception

  [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command:

  PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Cannot access parent:: when current class scope has no parent in ./vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ReflectionClassResource.php:167
  Stack trace:
  #0 ./vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ReflectionClassResource.php(167): defined()
  #1 ./vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ReflectionClassResource.php(117): Symfony\Component\Config\Resource\ReflectionClassResource->generateSignature()
  #2 ./vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ReflectionClassResource.php(66): Symfony\Component\Config\Resource\ReflectionClassResource->computeHash()
  #3 [internal function]: Symfony\Component\Config\Resource\ReflectionClassResource->serialize()
  #4 ./vendor/symfony/s in ./vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ReflectionClassResource.php on line 167

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