Completed
Push — 1.x ( c183a4...05b51a )
by Alexander
8s
created

AfterInterceptor   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

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 2
    public function invoke(Joinpoint $joinpoint)
31
    {
32
        try {
33 2
            $result = $joinpoint->proceed();
34 1
        } finally {
35 2
            $adviceMethod = $this->adviceMethod;
36 2
            $adviceMethod($joinpoint);
37
        }
38
39 1
        return $result;
40
    }
41
}
42