JoinPointPropertyGenerator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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