Your project must not contain invalid function or method calls 5
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- if (\is_object($entry) && ! \is_callable($entry)) {
- return $entry;
- }
- return $this->handledEntries[$id] = $this->resolver->handle($entry);
- }
- /**
- * Determine whether the **entry** is registered.
- *
- if ($callback) {
- $instance = $callback($instance) ?: $instance;
- }
- return $this->resolver->handle($instance, $args);
- }
- /**
- * Extending an entry.
- *
- throw new Container\Exception(
- \sprintf('Cannot extending a non-object or a callable entry of "%s"', $id)
- );
- }
- $extended = $this->make($callback, [$entry]);
- if (! \is_a($extended, $class = \get_class($entry))) {
- throw new Container\Exception(
- \sprintf('Argument #2 callback must be returns of type "%s"', $class)
- );
- ? \explode('::', $entry)
- : $this->createInstance($entry, $args);
- }
- if (\is_array($entry) && \is_string($entry[0])) {
- $entry[0] = $this->resolve($entry[0], $args);
- }
- if (\is_object($entry) || \is_callable($entry)) {
- return $entry;
- }
- // Otherwise convert it to closure.
- $callable = \Closure::fromCallable($callable);
- }
- $ref = $this->createCallableReflection($callable);
- $caller = $ref->getName();
- /** @var array{object|null, TArgs} */
- $params = [];
Your project should not use invalid parameter and return typehints 3
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint
- /**
- * Create instance.
- *
- * @param Container $container
- */
- public function __construct(ContainerInterface $container)
- {
- $this->container = $container;
- }
- /**
- protected $container = null;
- /**
- * @see ContainerAware::setContainer()
- */
- public function setContainer(\Projek\Container $container): ContainerAware
- {
- $this->container = $container;
- return $this;
- }
- * Assign a container to the instance.
- *
- * @param \Projek\Container $container
- * @return static
- */
- public function setContainer(\Projek\Container $container): ContainerAware;
- /**
- * Retrieve container instance or the instance of registered service.
- *
- * If no parameter given, this method should returns instance of `Projek\Container`