for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BsbDoctrineReconnectTest\Util;
use Zend\Mvc\Service\ServiceManagerConfig;
use Zend\ServiceManager\ServiceManager;
class ServiceManagerFactory
{
/**
* @var array
*/
protected static $config;
* @param array $config
public static function setConfig(array $config)
static::$config = $config;
}
* Builds a new service manager
public static function getServiceManager()
$serviceManager = new ServiceManager(new ServiceManagerConfig(
new \Zend\Mvc\Service\Se...ce_manager'] : array())
object<Zend\Mvc\Service\ServiceManagerConfig>
array
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);
isset(static::$config['service_manager']) ? static::$config['service_manager'] : []
));
$serviceManager->setService('ApplicationConfig', static::$config);
$serviceManager->setFactory('ServiceListener', 'Zend\Mvc\Service\ServiceListenerFactory');
/** @var $moduleManager \Zend\ModuleManager\ModuleManager */
$moduleManager = $serviceManager->get('ModuleManager');
$moduleManager->loadModules();
return $serviceManager;
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: