Completed
Pull Request — 1.x (#627)
by
unknown
08:55
created

User   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 16 1
1
<?php
2
3
namespace ZfcUser\Factory\Service;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use ZfcUser\Service\User as UserService;
8
9
class User implements FactoryInterface
10
{
11
12
    /**
13
     * Create service
14
     *
15
     * @param ServiceLocatorInterface $serviceLocator
16
     * @return mixed
17
     */
18
    public function createService(ServiceLocatorInterface $serviceLocator)
19
    {
20
        $userMapper = $serviceLocator->get('zfcuser_user_mapper');
21
        $authService = $serviceLocator->get('zfcuser_auth_service');
22
        $registerForm = $serviceLocator->get('zfcuser_register_form');
23
        $options = $serviceLocator->get('zfcuser_module_options');
24
        $formHydrator = $serviceLocator->get('zfcuser_user_hydrator');
25
26
        return new UserService(
27
            $userMapper,
0 ignored issues
show
Documentation introduced by
$userMapper is of type object|array, but the function expects a object<ZfcUser\Mapper\UserInterface>.

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);
Loading history...
28
            $authService,
0 ignored issues
show
Documentation introduced by
$authService is of type object|array, but the function expects a object<Zend\Authentication\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);
Loading history...
29
            $registerForm,
0 ignored issues
show
Documentation introduced by
$registerForm is of type object|array, but the function expects a object<Zend\Form\Form>.

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);
Loading history...
30
            $options,
0 ignored issues
show
Documentation introduced by
$options is of type object|array, but the function expects a object<ZfcUser\Options\U...erviceOptionsInterface>.

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);
Loading history...
31
            $formHydrator
0 ignored issues
show
Documentation introduced by
$formHydrator is of type object|array, but the function expects a object<Zend\Hydrator\HydratorInterface>.

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);
Loading history...
32
        );
33
    }
34
}
35