Completed
Push — 2.x ( 98b57b...8b2aa1 )
by Alexander
05:24
created

AfterInterceptor::invoke()   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 2
nop 1
crap 1
1
<?php
2
/*
3
 * Go! AOP framework
4
 *
5
 * @copyright Copyright 2011, Lisachenko Alexander <[email protected]>
6
 *
7
 * This source file is subject to the license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Go\Aop\Framework;
12
13
use Go\Aop\AdviceAfter;
14
use Go\Aop\Intercept\Joinpoint;
15
16
/**
17
 * "After" interceptor
18
 *
19
 * @api
20
 */
21
final class AfterInterceptor extends BaseInterceptor implements AdviceAfter
22
{
23
    /**
24
     * After invoker
25
     *
26
     * @param Joinpoint $joinpoint the concrete joinpoint
27
     *
28
     * @return mixed the result of the call to {@link Joinpoint::proceed()}
29
     */
30 2
    public function invoke(Joinpoint $joinpoint)
31
    {
32
        try {
33 2
            return $joinpoint->proceed();
34
        } finally {
35 2
            $adviceMethod = $this->adviceMethod;
36 2
            $adviceMethod($joinpoint);
37
        }
38
    }
39
}
40