BaseArrayGranter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A mergeValues() 0 3 1
1
<?php
2
/**
3
 * This file is part of the sauls/security package.
4
 *
5
 * @author    Saulius Vaičeliūnas <[email protected]>
6
 * @link      http://saulius.vaiceliunas.lt
7
 * @copyright 2017
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Sauls\Bundle\Components\Component\Security\Access\Granter;
14
15
use function Sauls\Component\Helper\array_merge;
16
17
abstract class BaseArrayGranter implements GranterInterface
18
{
19
    /**
20
     * @var array
21
     */
22
    protected $values;
23
24
    /**
25
     * AllowGranter constructor.
26
     *
27
     * @param array $values
28
     */
29 16
    public function __construct(array $values = [])
30
    {
31 16
        $this->values = $values;
32 16
    }
33
34
    /**
35
     * @param array $values
36
     *
37
     * @return array
38
     */
39 14
    protected function mergeValues(array $values = []): array
40
    {
41 14
        return array_merge($this->values, $values);
42
    }
43
}
44