Passed
Push — master ( cc53ed...009c64 )
by butschster
17:39 queued 07:59
created

RenderException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 22
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setUserTrace() 0 3 1
A getUserTrace() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Views\Exception;
6
7
class RenderException extends ViewException
8
{
9
    private array $userTrace = [];
10
11 5
    public function __construct(\Throwable $previous = null)
12
    {
13 5
        parent::__construct((string) $previous?->getMessage(), (int) ($previous?->getCode() ?? 0), $previous);
14 5
        $this->file = (string) $previous?->getFile();
15 5
        $this->line = (int) $previous?->getLine();
16
    }
17
18
    /**
19
     * Set user trace pointing to the location of error in view templates.
20
     */
21 3
    public function setUserTrace(array $trace): void
22
    {
23 3
        $this->userTrace = $trace;
24
    }
25
26 2
    public function getUserTrace(): array
27
    {
28 2
        return $this->userTrace;
29
    }
30
}
31