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

RuntimeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContext() 0 3 1
A __construct() 0 4 1
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