Passed
Push — master ( d0634e...13c37e )
by Yuichi
10:21 queued 22s
created

RuntimeException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace CybozuHttp\Exception;
4
5
use Throwable;
6
7
class RuntimeException extends \RuntimeException implements ExceptionInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    private $context;
13
14
    /**
15
     * RuntimeException constructor.
16
     * @param string $message
17
     * @param int $code
18
     * @param Throwable|null $previous
19
     * @param array $context
20
     */
21 1
    public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null, array $context = [])
22
    {
23 1
        $this->context = $context;
24 1
        parent::__construct($message, $code, $previous);
25
    }
26
27
    /**
28
     * @return array
29
     */
30 1
    public function getContext(): array
31
    {
32 1
        return $this->context;
33
    }
34
}
35