BaseParser::getTriples()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * This file is part of the sweetrdf/InMemoryStoreSqlite package and licensed under
5
 * the terms of the GPL-2 license.
6
 *
7
 * (c) Konrad Abicht <[email protected]>
8
 * (c) Benjamin Nowack
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace sweetrdf\InMemoryStoreSqlite\Parser;
15
16
use sweetrdf\InMemoryStoreSqlite\Log\Logger;
17
use sweetrdf\InMemoryStoreSqlite\NamespaceHelper;
18
use sweetrdf\InMemoryStoreSqlite\StringReader;
19
20
abstract class BaseParser
21
{
22
    /**
23
     * @var array
24
     */
25
    protected $added_triples;
26
27
    protected string $base;
28
29
    protected string $bnode_prefix;
30
31
    protected string $bnode_id;
32
33
    protected array $blocks;
34
35
    protected Logger $logger;
36
37
    protected NamespaceHelper $namespaceHelper;
38
39
    /**
40
     * Query infos container.
41
     */
42
    protected array $r = [];
43
44
    protected StringReader $reader;
45
46
    protected array $triples = [];
47
48
    protected int $t_count = 0;
49
50 100
    public function __construct(Logger $logger, NamespaceHelper $namespaceHelper, StringReader $stringReader)
51
    {
52 100
        $this->reader = $stringReader;
53
54 100
        $this->logger = $logger;
55
56 100
        $this->namespaceHelper = $namespaceHelper;
57
58
        // generates random prefix for blank nodes
59 100
        $this->bnode_prefix = bin2hex(random_bytes(4)).'b';
60
61 100
        $this->bnode_id = 0;
62
    }
63
64 98
    public function getQueryInfos()
65
    {
66 98
        return $this->r;
67
    }
68
69 2
    public function getTriples()
70
    {
71 2
        return $this->triples;
72
    }
73
}
74