AfterThrowingInterceptor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

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