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

Appearance settings

[DependcyInjection] _instanceof + PSR4 autoregistration - The definition "..." has a reference to an abstract definition "...". Abstract definitions cannot be the target of references.  #24111

Copy link
Copy link
Closed
@TomasVotruba

Description

@TomasVotruba
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3

All worked just fine untill I added _instanceof.

I don't understand this message at all. Just need a little guidance.

My setup is following

services:
    _defaults:
        autowire: true

    _instanceof:
        Rector\Rector\AbstractClassAwareRector:
            calls:
                - ['setClassResolver', ['@Rector\NodeAnalyzer\ClassResolver']]

    # PSR-4 autodiscovery
    Rector\:
        resource: '../../src'

And the error:

Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: The definition "Rector\Rector\RectorCollector" has a reference to an abstract definition "abstract.instanceof.Rector\Rector\Contrib\Nette\NetteObjectToSmartTraitRector". Abstract definitions cannot be the target of references. in /var/www/Rector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:37

NetteObjectToSmartTraitRector is not an abstract class. Not sure if that's what Symfony thinks

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.