Test Failed
Push — master ( 34c614...ede9b5 )
by Dawid
05:49
created

CursorException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Igni\Storage\Exception;
4
5
use Igni\Storage\Driver\Cursor;
6
7
class CursorException extends DriverException
8
{
9
    public static function forEmptyResult(): CursorException
10
    {
11
        return new self('Could not fetch empty result.');
12
    }
13
14
    public static function forExecutionFailure(Cursor $cursor, string $reason): CursorException
15
    {
16
        $cursor = get_class($cursor);
17
18
        return new self("Could not execute cursor ${cursor}, reason: ${reason}");
19
    }
20
}
21