for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Innmind\Neo4jBundle\Configurator;
use Innmind\Neo4j\ONM\{
Metadatas,
RepositoryInterface,
RepositoryFactory
};
use Innmind\Immutable\Map;
final class RepositoryFactoryConfigurator
{
private $metadatas;
private $repositories;
public function __construct(Metadatas $metadatas)
$this->metadatas = $metadatas;
$this->repositories = new Map('string', RepositoryInterface::class);
}
/**
* Register a newrepository for the given entity class
*
* @param string $class
* @param RepositoryInterface $repository
* @return self
*/
public function register(string $class, RepositoryInterface $repository): self
$this->repositories = $this->repositories->put($class, $repository);
$class
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);
$repository
object<Innmind\Neo4j\ONM\RepositoryInterface>
object<Innmind\Immutable\S>
return $this;
* Inject registered repositories into the given repository factory
* @param RepositoryFactory $factory
* @return RepositoryFactory
public function configure(RepositoryFactory $factory): RepositoryFactory
$this
->repositories
->foreach(function(
string $class,
RepositoryInterface $repository
) use (
$factory
) {
$factory->register(
$this->metadatas->get($class),
);
});
return $factory;
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: