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
- $this->dispatch($reg = new Container\Events\BeforeRegistration(
- $this->factories[$id],
- $id,
- ));
- $this->entries[$id] = $this->resolver->resolve($reg->factory);
- if (isset($this->handledEntries[$id])) {
- unset($this->handledEntries[$id]);
- }
Your project should not use invalid parameter and return typehints 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint
- */
- final class AfterRegistration
- {
- public array|object|string $entry;
- public function __construct(
- array|callable|object|string $entry,
- public string $id,
- ) {
- $this->entry = $entry;
- }
- */
- final class BeforeRegistration
- {
- public array|object|string $factory;
- public function __construct(
- array|callable|object|string $factory,
- public string $id,
- ) {
- $this->factory = $factory;
- }
Your project should use return types
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint
- */
- final class ListenerProvider implements ContainerAware, ListenerProviderInterface
- {
- use HasContainer;
- public function getListenersForEvent(object $event): iterable
- {
- $listeners = [
- BeforeRegistration::class => ['beforeRegistration'],
- AfterRegistration::class => ['afterRegistration'],
- BeforeResolution::class => ['beforeResolution'],
Your project should not contain commented code
- Read doc
- Productivity
- Minor
More information: https://insight.symfony.com/what-we-analyse/php.commented_out_code
- self::class => $this,
- ContainerInterface::class => $this,
- ]);
- // if ($eventDispatcher) {
- // $entries[EventDispatcherInterface::class] = $eventDispatcher;
- // }
- foreach ($entries as $id => $factory) {
- $this->set($id, $factory);
- }