AfterThrowingInterceptor::invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.9332
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
/*
5
 * Go! AOP framework
6
 *
7
 * @copyright Copyright 2011, Lisachenko Alexander <[email protected]>
8
 *
9
 * This source file is subject to the license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Go\Aop\Framework;
14
15
use Go\Aop\AdviceAfter;
16
use Go\Aop\Intercept\Joinpoint;
17
use Throwable;
18
19
/**
20
 * "After Throwing" interceptor
21
 *
22
 * @api
23
 */
24
final class AfterThrowingInterceptor extends AbstractInterceptor implements AdviceAfter
25
{
26
    /**
27
     * @inheritdoc
28
     * @throws Throwable
29 2
     */
30
    public function invoke(Joinpoint $joinpoint)
31
    {
32 2
        try {
33 1
            return $joinpoint->proceed();
34 1
        } catch (Throwable $throwableInstance) {
35
            ($this->adviceMethod)($joinpoint, $throwableInstance);
36 1
37
            throw $throwableInstance;
38
        }
39
    }
40
}
41