Completed
Push — 1.x ( 6e286e...c7aa89 )
by Daniel
45:22 queued 35:25
created

AuthenticationService   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 7 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Clayton Daley
5
 * Date: 5/6/2015
6
 * Time: 6:40 PM
7
 */
8
9
namespace ZfcUser\Factory;
10
11
use Zend\ServiceManager\FactoryInterface;
12
use Zend\ServiceManager\ServiceLocatorInterface;
13
14
class AuthenticationService implements FactoryInterface
15
{
16
17
    /**
18
     * Create service
19
     *
20
     * @param ServiceLocatorInterface $serviceLocator
21
     * @return mixed
22
     */
23
    public function createService(ServiceLocatorInterface $serviceLocator)
24
    {
25
        return new \Zend\Authentication\AuthenticationService(
26
            $serviceLocator->get('ZfcUser\Authentication\Storage\Db'),
0 ignored issues
show
Documentation introduced by
$serviceLocator->get('Zf...tication\\Storage\\Db') is of type object|array, but the function expects a null|object<Zend\Authent...orage\StorageInterface>.

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...
27
            $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain')
0 ignored issues
show
Documentation introduced by
$serviceLocator->get('Zf...Adapter\\AdapterChain') is of type object|array, but the function expects a null|object<Zend\Authent...apter\AdapterInterface>.

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
        );
29
    }
30
}
31