Passed
Push — develop ( a1f3e3...8f45f4 )
by Enea
03:43
created

Authorization   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A getName() 0 3 1
A fake() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author enea dhack <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Enea\Authorization\Repositories;
13
14
class Authorization
15
{
16
    private $name;
17
18
    private $description;
19
20 6
    public function __construct(string $name, ?string $description = null)
21
    {
22 6
        $this->name = $name;
23 6
        $this->description = $description;
24 6
    }
25
26 6
    public static function fake(string $name, ?string $description = null): Authorization
27
    {
28 6
        return new static($name, $description);
29
    }
30
31 6
    public function getName(): string
32
    {
33 6
        return $this->name;
34
    }
35
36 6
    public function getDescription(): ?string
37
    {
38 6
        return $this->description;
39
    }
40
}
41