for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace DoctrineModule\Service\Authentication;
use DoctrineModule\Authentication\Adapter\ObjectRepository;
use DoctrineModule\Service\AbstractFactory;
use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use function is_string;
/**
* Factory to create authentication adapter object.
*
* @link http://www.doctrine-project.org/
*/
class AdapterFactory extends AbstractFactory
{
* {@inheritDoc}
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
$options = $this->getOptions($container, 'authentication');
$objectManager = $options->getObjectManager();
if (is_string($objectManager)) {
$options->setObjectManager($container->get($objectManager));
}
return new ObjectRepository($options);
$options
object<Laminas\Stdlib\AbstractOptions>
array<integer,*>|object<...Options\Authentication>
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);
* @return ObjectRepository
public function createService(ServiceLocatorInterface $serviceLocator)
return $this($serviceLocator, ObjectRepository::class);
public function getOptionsClass() : string
return 'DoctrineModule\Options\Authentication';
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: