for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Innmind\EventBusBundle\Factory;
use Innmind\EventBusBundle\ContainerAwareEventBus;
use Innmind\EventBus\ClassName\ExtractorInterface;
use Innmind\Immutable\{
Map,
SetInterface,
Set
};
use Symfony\Component\DependencyInjection\ContainerInterface;
final class ContainerAwareEventBusFactory
{
public static function make(
ContainerInterface $container,
array $services,
ExtractorInterface $extractor
): ContainerAwareEventBus {
$map = new Map('string', SetInterface::class);
foreach ($services as $class => $listeners) {
$set = new Set('string');
foreach ($listeners as $listener) {
$set = $set->add($listener);
}
$map = $map->put($class, $set);
$class
integer|string
object<Innmind\Immutable\T>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$set
object<Innmind\Immutable\Set>
object<Innmind\Immutable\S>
return new ContainerAwareEventBus($container, $map, $extractor);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: