Completed
Pull Request — 2.x (#349)
by Alexander
02:20
created

JoinPointPropertyGenerator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

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