Completed
Pull Request — master (#463)
by Alexander
30:17 queued 05:15
created

AbstractGenericAdvisor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
/*
5
 * Go! AOP framework
6
 *
7
 * @copyright Copyright 2012, 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\Aop\Support;
14
15
use Go\Aop\Advice;
16
use Go\Aop\Advisor;
17
18
/**
19
 * Abstract generic Advisor that allows for any Advice to be configured.
20
 */
21
abstract class AbstractGenericAdvisor implements Advisor
22
{
23
    /**
24
     * Instance of advice
25
     */
26
    protected Advice $advice;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
27
28
    /**
29
     * Initializes an advisor with advice
30 3
     */
31
    public function __construct(Advice $advice)
32 3
    {
33 3
        $this->advice = $advice;
34
    }
35
36
    /**
37
     * Returns an advice to apply
38 3
     */
39
    public function getAdvice(): Advice
40 3
    {
41
        return $this->advice;
42
    }
43
}
44