JoinPointPropertyGenerator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
/*
5
 * Go! AOP framework
6
 *
7
 * @copyright Copyright 2018, Lisachenko Alexander <[email protected]>
8
 *
9
 * This source file is subject to the license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Go\Proxy\Part;
14
15
use Laminas\Code\Generator\Exception\InvalidArgumentException;
16
use Laminas\Code\Generator\PropertyGenerator;
17
use Laminas\Code\Generator\PropertyValueGenerator;
18
19
/**
20
 * Prepares the definition for joinpoints private property in the class
21
 */
22
final class JoinPointPropertyGenerator extends PropertyGenerator
23
{
24
    /**
25
     * Default property name for storing join points in the class
26
     */
27
    public const NAME = '__joinPoints';
28
29
    /**
30
     * JoinPointProperty constructor.
31
     *
32
     * @param array $adviceNames List of advices to apply per class
33
     *
34 10
     * @throws InvalidArgumentException
35
     */
36 10
    public function __construct(array $adviceNames)
37
    {
38 10
        $value = new PropertyValueGenerator($adviceNames, PropertyValueGenerator::TYPE_ARRAY_SHORT);
39
40 10
        parent::__construct(self::NAME, $value, PropertyGenerator::FLAG_PRIVATE | PropertyGenerator::FLAG_STATIC);
41 10
42
        $this->setDocBlock('List of applied advices per class');
43
    }
44
}
45