Your project must not contain invalid function or method calls
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- // Recreate the factory closure against the clone; rebinding
- // keeps any captured value (the ctor-provided dispatcher)
- // while re-pointing the captured container.
- $this->entries[$id] = new CallableEntry(
- $id,
- Closure::bind($entry->factory, $this, self::class),
- auto: true,
- );
- }
- }
- }
Your project must not contain invalid instantiations
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- // without them the closing `});` line can never be marked covered.
- $this->entries[$id] = (match (true) {
- // Invokable shapes first — the is_object guard is load-bearing: a class-string naming
- // an invokable class must fall through to the ClassName arm (build, never invoke).
- FactoryEntry::isValid($factory) => new FactoryEntry($id, $factory),
- CallableEntry::isValid($factory) => new CallableEntry($id, $factory),
- ClassNameEntry::isValid($factory) => new ClassNameEntry($id, $factory),
- MethodPairEntry::isValid($factory) => new MethodPairEntry($id, $factory),
- // any other string — incl. non-buildable type symbols (interface, trait, abstract
- // class, enum): must name a pre-registered entry (the typo catcher).
- \is_string($factory) => $this->has($factory)