Completed
Push — master ( aaff7d...f806fe )
by Sullivan
03:03
created

AuthorizationTrait::hasAuthorization()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Nexy\PayboxDirect\Request;
4
5
use Symfony\Component\Validator\Constraints as Assert;
6
7
/**
8
 * @author Sullivan Senechal <[email protected]>
9
 */
10
trait AuthorizationTrait
11
{
12
    /**
13
     * @var string|null
14
     *
15
     * @Assert\Length(min=1, max=10)
16
     */
17
    private $authorization = null;
18
19
    /**
20
     * @param string|null $authorization
21
     *
22
     * @return $this
23
     */
24
    final public function setAuthorization($authorization = null)
25
    {
26
        $this->authorization = $authorization;
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return bool
33
     */
34
    final protected function hasAuthorization()
35
    {
36
        return !empty($this->authorization);
37
    }
38
39
    /**
40
     * @return string|null
41
     */
42
    final protected function getAuthorization()
43
    {
44
        return $this->authorization;
45
    }
46
}
47