Your project must not contain invalid instantiations
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- // trait, abstract class, enum): must name a pre-registered entry
- // (the typo catcher).
- \is_string($factory) => $this->has($factory)
- ? new AliasEntry($id, $factory)
- : throw InvalidArgumentException::unresolvableString($id, $factory),
- \is_array($factory) => new MethodPairEntry($id, $factory), // pair validation in its ctor
- // Plain objects only; invokables matched the arm above.
- // (\is_object, not `instanceof object` — the latter always
- // evaluates false: `object` is parsed as a class name.)
- \is_object($factory) => throw InvalidArgumentException::plainObjectNotAFactory($id, $factory),
- // Invalid factory of type %s.