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

CursorProperties::isScrollable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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