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

BeforeInterceptor::invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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\AdviceBefore;
14
use Go\Aop\Intercept\Joinpoint;
15
16
/**
17
 * "Before" interceptor
18
 *
19
 * @api
20
 */
21
final class BeforeInterceptor extends BaseInterceptor implements AdviceBefore
22
{
23
    /**
24
     * Before invoker for joinpoint
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
        $adviceMethod = $this->adviceMethod;
33
        $adviceMethod($joinpoint);
34
35
        return $joinpoint->proceed();
36
    }
37
}
38