Completed
Push — master ( 99e196...2d8856 )
by Vladimir
27:17 queued 12:39
created

BaseException::fromGuzzle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AcquiroPay\Exceptions;
6
7
use Exception;
8
use GuzzleHttp\Exception\RequestException;
9
10
class BaseException extends Exception
11
{
12
    public static function fromGuzzle(RequestException $exception)
13
    {
14
        return new static(
15
            $exception->getMessage(),
16
            $exception->getCode(),
17
            $exception
18
        );
19
    }
20
}