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

AfterInterceptor::invoke()   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 2
nop 1
crap 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