for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @filesource
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
* @license MIT
* @author Miroslav Fedeleš <[email protected]>
* @since 0.27
*/
namespace Auth\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Mvc\Controller\ControllerManager;
use Auth\Dependency\ModuleManager as Dependencies;
class RemoveController extends AbstractActionController
{
* @var Dependencies
protected $dependencies;
* @param ControllerManager $controllerManager
* @return \Auth\Controller\RemoveController
public static function factory(ControllerManager $controllerManager)
$serviceManager = $controllerManager->getServiceLocator();
return new static($serviceManager->get('Auth/Dependency/ModuleManager'));
$serviceManager->get('Au...endency/ModuleManager')
object|array
object<Auth\Dependency\ModuleManager>
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);
}
* @param Dependencies $dependencies
public function __construct(Dependencies $dependencies)
$this->dependencies = $dependencies;
public function indexAction()
$user = $this->serviceLocator->get('AuthenticationService')->getUser();
if ($this->params()->fromPost('confirm'))
foreach ($this->dependencies as $dependency) /* @var $dependency \Auth\Dependency\ModuleInterface */
$dependency->removeItems($user);
return [
'dependencies' => $this->dependencies,
'user' => $user,
'router' => $this->getEvent()->getRouter()
];
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: