Completed
Pull Request — master (#11)
by Sandro
02:12
created

NoCursorId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A forType() 0 6 1
1
<?php
2
/**
3
 * Sandro Keil (https://sandro-keil.de)
4
 *
5
 * @link      http://github.com/sandrokeil/arangodb-php-client for the canonical source repository
6
 * @copyright Copyright (c) 2018-2020 Sandro Keil
7
 * @license   http://github.com/sandrokeil/arangodb-php-client/blob/master/LICENSE.md New BSD License
8
 */
9
10
declare(strict_types=1);
11
12
namespace ArangoDb\Exception;
13
14
use ArangoDb\Type\Type;
15
16
final class NoCursorId extends RuntimeException
17
{
18
    /**
19
     * @var Type
20
     */
21
    private $type;
22
23
    public static function forType(Type $type): self
24
    {
25
        $self = new self('There is no cursor id to get more results.');
26
27
        $self->type = $type;
28
        return $self;
29
    }
30
31
    public function getType(): Type
32
    {
33
        return $this->type;
34
    }
35
}
36