Passed
Push — master ( 27ca4d...8d618a )
by Ondřej
02:45 queued 10s
created

CursorProperties   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isBinary() 0 3 1
A isScrollable() 0 3 1
A isHoldable() 0 3 1
1
<?php
2
declare(strict_types=1);
3
namespace Ivory\Relation;
4
5
class CursorProperties
6
{
7
    private $holdable;
8
    private $scrollable;
9
    private $binary;
10
11
    public function __construct(bool $holdable, bool $scrollable, bool $binary)
12
    {
13
        $this->holdable = $holdable;
14
        $this->scrollable = $scrollable;
15
        $this->binary = $binary;
16
    }
17
18
    /**
19
     * Tells whether the cursor is _holdable_, and thus will not be closed automatically with the transaction end.
20
     */
21
    public function isHoldable(): bool
22
    {
23
        return $this->holdable;
24
    }
25
26
    /**
27
     * Tells whether the cursor is _scrollable_, and thus any moves and fetches of multiple tuples is possible.
28
     */
29
    public function isScrollable(): bool
30
    {
31
        return $this->scrollable;
32
    }
33
34
    /**
35
     * Tells whether the cursor is binary, and thus returns binary data rather than plaintext.
36
     */
37
    public function isBinary(): bool
38
    {
39
        return $this->binary;
40
    }
41
}
42