HeaderAuthenticationHandler::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Victoire\Bundle\APIBusinessEntityBundle\Authentication;
4
5
use Victoire\Bundle\APIBusinessEntityBundle\Authentication\Interfaces\APIAuthenticationMethodInterface;
6
7
class HeaderAuthenticationHandler implements APIAuthenticationMethodInterface
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
8
{
9
    const TYPE = 'header';
10
11
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$curl" missing
Loading history...
introduced by
Doc comment for parameter "$getMethod" missing
Loading history...
introduced by
Doc comment for parameter "$token" missing
Loading history...
12
     * Adds a http header to the curl request with the token.
13
     */
14
    public function handle($curl, &$getMethod, &$token)
15
    {
16
        curl_setopt($curl, CURLOPT_HTTPHEADER, sprintf('Authorization: %s', $token));
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public static function getType()
23
    {
24
        return self::TYPE;
25
    }
26
}
27