Your project must not contain invalid function or method calls

More information: https://insight.symfony.com/what-we-analyse/php.invalid_call

in src/Container.php, line 168
  1. $this->dispatch($reg = new Container\Events\BeforeRegistration(
  2. $this->factories[$id],
  3. $id,
  4. ));
  5. $this->entries[$id] = $this->resolver->resolve($reg->factory);
    Parameter #1 $factory of method Projek\Container\Resolver::resolve() expects array{string, string}|(callable(): mixed)|object|string, array|object|string given.
    Last edited by Fery Wardiyanto
  6. if (isset($this->handledEntries[$id])) {
  7. unset($this->handledEntries[$id]);
  8. }

Your project should not use invalid parameter and return typehints 2

More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint

  1. */
  2. final class AfterRegistration
  3. {
  4. public array|object|string $entry;
  5. public function __construct(
    Method Projek\Container\Events\AfterRegistration::__construct() has parameter $entry with no value type specified in iterable type array.
    Last edited by Fery Wardiyanto
  6. array|callable|object|string $entry,
  7. public string $id,
  8. ) {
  9. $this->entry = $entry;
  10. }
  1. */
  2. final class BeforeRegistration
  3. {
  4. public array|object|string $factory;
  5. public function __construct(
    Method Projek\Container\Events\BeforeRegistration::__construct() has parameter $factory with no value type specified in iterable type array.
    Last edited by Fery Wardiyanto
  6. array|callable|object|string $factory,
  7. public string $id,
  8. ) {
  9. $this->factory = $factory;
  10. }

Your project should use return types

More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint

  1. */
  2. final class ListenerProvider implements ContainerAware, ListenerProviderInterface
  3. {
  4. use HasContainer;
  5. public function getListenersForEvent(object $event): iterable
    Method Projek\Container\Events\ListenerProvider::getListenersForEvent() return type has no value type specified in iterable type iterable.
    Last edited by Fery Wardiyanto
  6. {
  7. $listeners = [
  8. BeforeRegistration::class => ['beforeRegistration'],
  9. AfterRegistration::class => ['afterRegistration'],
  10. BeforeResolution::class => ['beforeResolution'],

Your project should not contain commented code

More information: https://insight.symfony.com/what-we-analyse/php.commented_out_code

in src/Container.php, line 58
  1. self::class => $this,
  2. ContainerInterface::class => $this,
  3. ]);
  4. // if ($eventDispatcher) {
  5. // $entries[EventDispatcherInterface::class] = $eventDispatcher;
    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  6. // }
  7. foreach ($entries as $id => $factory) {
  8. $this->set($id, $factory);
  9. }