Completed
Push — feature/EVO-6305_worker_authen... ( 23d108...e5231d )
by Bastian
95:03 queued 30:21
created

AbstractHttpStrategyProxy   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A extractFieldInfo() 0 4 1
A validateField() 0 4 1
A apply() 0 3 1
A getRoles() 0 4 1
1
<?php
2
/**
3
 * proxy class for testing abstract strategy
4
 */
5
6
namespace Graviton\SecurityBundle\Tests\Authentication\Strategies;
7
8
use Graviton\SecurityBundle\Authentication\Strategies\AbstractHttpStrategy;
9
use Symfony\Component\HttpFoundation\Request;
10
11
/**
12
 * Class AbstractHttpStrategyProxy
13
 *
14
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
15
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
16
 * @link     http://swisscom.ch
17
 */
18
class AbstractHttpStrategyProxy extends AbstractHttpStrategy
19
{
20
    /**
21
     * {@inheritdoc}
22
     *
23
     * @param string $header    header
24
     * @param string $fieldName field name
25
     *
26
     * @return string
27
     */
28
    public function extractFieldInfo($header, $fieldName)
29
    {
30
        return parent::extractFieldInfo($header, $fieldName);
0 ignored issues
show
Documentation introduced by
$header is of type string, but the function expects a object<Symfony\Component...tpFoundation\HeaderBag>.

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
    }
32
33
    /**
34
     * {@inheritdoc}
35
     *
36
     * @param string $header    header
37
     * @param string $fieldName field name
38
     *
39
     * @return void
40
     */
41
    public function validateField($header, $fieldName)
42
    {
43
        parent::validateField($header, $fieldName);
0 ignored issues
show
Documentation introduced by
$header is of type string, but the function expects a object<Symfony\Component...tpFoundation\HeaderBag>.

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...
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     *
49
     * @param Request $request request
50
     *
51
     * @return void
52
     */
53
    public function apply(Request $request)
54
    {
55
    }
56
57
    /**
58
     * @inheritDoc
59
     *
60
     * @return array
61
     */
62
    public function getRoles()
63
    {
64
        return [];
65
    }
66
}
67