Completed
Pull Request — master (#369)
by
unknown
04:33
created

AfterInterceptor   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 18
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A invoke() 0 8 1
1
<?php
2
declare(strict_types = 1);
3
/*
4
 * Go! AOP framework
5
 *
6
 * @copyright Copyright 2011, 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\Aop\Framework;
13
14
use Go\Aop\AdviceAfter;
15
use Go\Aop\Intercept\Joinpoint;
16
17
/**
18
 * "After" interceptor
19
 *
20
 * @api
21
 */
22
final class AfterInterceptor extends BaseInterceptor implements AdviceAfter
23
{
24
    /**
25
     * After invoker
26
     *
27
     * @param Joinpoint $joinpoint the concrete joinpoint
28
     *
29
     * @return mixed the result of the call to {@link Joinpoint::proceed()}
30
     */
31 2
    public function invoke(Joinpoint $joinpoint)
32
    {
33
        try {
34 2
            return $joinpoint->proceed();
35
        } finally {
36 2
            ($this->adviceMethod)($joinpoint);
37
        }
38
    }
39
}
40