1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
4
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
5
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
6
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
7
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
9
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
10
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
11
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
12
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
13
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14
|
|
|
* |
15
|
|
|
* This software consists of voluntary contributions made by many individuals |
16
|
|
|
* and is licensed under the MIT license. |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace ZfcUser\Factory\Controller; |
20
|
|
|
|
21
|
|
|
use Zend\Mvc\Controller\ControllerManager; |
22
|
|
|
use Zend\ServiceManager\FactoryInterface; |
23
|
|
|
use Zend\ServiceManager\ServiceLocatorInterface; |
24
|
|
|
use ZfcUser\Controller\UserController; |
25
|
|
|
|
26
|
|
|
class UserControllerFactory implements FactoryInterface |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* Create controller |
30
|
|
|
* |
31
|
|
|
* @param ControllerManager $serviceLocator |
|
|
|
|
32
|
|
|
* @return UserController |
33
|
|
|
*/ |
34
|
|
|
public function createService(ServiceLocatorInterface $controllerManager) |
35
|
|
|
{ |
36
|
|
|
/* @var ServiceLocatorInterface $serviceLocator */ |
37
|
|
|
$serviceLocator = $controllerManager->getServiceLocator(); |
|
|
|
|
38
|
|
|
|
39
|
|
|
$userService = $serviceLocator->get('zfcuser_user_service'); |
40
|
|
|
$registerForm = $serviceLocator->get('zfcuser_register_form'); |
41
|
|
|
$loginForm = $serviceLocator->get('zfcuser_login_form'); |
42
|
|
|
$options = $serviceLocator->get('zfcuser_module_options'); |
43
|
|
|
|
44
|
|
|
$controller = new UserController($userService, $options, $registerForm, $loginForm); |
45
|
|
|
|
46
|
|
|
return $controller; |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.