GoogleTrendsException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 8
cts 8
cp 1
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php declare(strict_types=1);
2
3
namespace GSoares\GoogleTrends\Error;
4
5
use Exception;
6
use Throwable;
7
8
/**
9
 * @author Gabriel Felipe Soares <[email protected]>
10
 */
11
class GoogleTrendsException extends Exception
12
{
13
    private const ERROR_CODE = 19980904; // Google's creation date
14
15 20
    public function __construct(string $message, Throwable $previous = null)
16
    {
17 20
        parent::__construct(
18 20
            sprintf(
19 20
                'GoogleTrends error: %s',
20 20
                $message
21
            ),
22 20
            self::ERROR_CODE,
23 20
            $previous
24
        );
25 20
    }
26
}
27