Test Failed
Push — master ( 257d98...3364ef )
by Yunus Emre
06:12
created

BaseException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace TarfinLabs\Parasut\Exceptions;
4
5
use Exception;
6
use Illuminate\Http\Client\Response;
7
8
abstract class BaseException extends Exception
9
{
10
    public static int $statusCode;
11
12
    /**
13
     * Create an Exception.
14
     *
15
     * @param  \Illuminate\Http\Client\Response  $response
16
     */
17
    public function __construct(Response $response)
18
    {
19
        parent::__construct(
20
            "{$response->json()['errors'][0]['title']}: {$response->json()['errors'][0]['detail']}",
21
            $response->status()
22
        );
23
    }
24
}
25