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

JoinPointPropertyGenerator   A

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
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