for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* YAWIK
*
* @filesource
* @copyright (c) 2013-2016 Cross Solution (http://cross-solution.de)
* @author cbleek
* @license MIT
*/
namespace Jobs\Factory\Controller\Plugin;
use Zend\ServiceManager\FactoryInterface;
use Core\Repository\RepositoryService;
use Jobs\Controller\Plugin\InitializeJob;
class InitializeJobFactory implements FactoryInterface {
public function createService(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator)
{
/* @var $serviceLocator \Zend\Mvc\Controller\PluginManager */
$services = $serviceLocator->getServiceLocator();
/* @var $repositories RepositoryService */
$repositories = $services->get('repositories');
/* @var \Auth\AuthenticationService */
$auth = $services->get('AuthenticationService');
/* @var \Acl\Controller\Plugin\Acl */
$acl = $serviceLocator->get('acl');
$plugin = new InitializeJob($repositories, $auth, $acl);
$auth
object|array
object<Auth\AuthenticationService>
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);
$acl
object<Acl\Service\Acl>
return $plugin;
}
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: