ExceptionHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 1
1
<?php
2
/**
3
 * This file is part of the Koriym.Baracoa package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Koriym\Baracoa;
8
9
final class ExceptionHandler implements ExceptionHandlerInterface
10
{
11 1
    public function __invoke(\V8JsScriptException $e) : string
12
    {
13 1
        $erroCode = mb_strimwidth($e->getJsSourceLine(), $e->getJsStartColumn(), 240, '...');
14 1
        $errorMsg = sprintf(
15 1
            "%s\n%s\nJS Stack trace:\n%s",
16 1
            $e->getMessage(),
17
            $erroCode,
18 1
            $e->getJsTrace()
19
        );
20 1
        throw new \V8JsScriptException($errorMsg);
21
    }
22
}
23