Completed
Pull Request — 1.x (#301)
by
unknown
04:37
created

AfterInterceptor::invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 10
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
crap 2
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
    public function invoke(Joinpoint $joinpoint)
31
    {
32
        try {
33
            $result = $joinpoint->proceed();
34
        } finally {
35
            $adviceMethod = $this->adviceMethod;
36
            $adviceMethod($joinpoint);
37
        }
38
39
        return $result;
40
    }
41
}
42