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

AfterInterceptor   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A invoke() 0 11 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
    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