Completed
Push — master ( 296743...12eab9 )
by Kirill
36:17
created

CompilerException::wrap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Exceptions;
11
12
/**
13
 * An error occurred during the initialization of the compiler.
14
 */
15
class CompilerException extends \LogicException
16
{
17
    /**
18
     * @param \Throwable $e
19
     * @return CompilerException
20
     */
21
    public static function wrap(\Throwable $e): self
22
    {
23
        return new static($e->getMessage(), $e->getCode(), $e);
24
    }
25
}
26