Passed
Push — master ( f0d4c7...67a964 )
by Konrad
04:54
created

NamedNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 27
rs 10
ccs 11
cts 11
cp 1
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getType() 0 3 1
A equals() 0 3 1
A __toString() 0 3 1
A getValue() 0 3 1
1
<?php
2
3
namespace sweetrdf\InMemoryStoreSqlite\Rdf;
4
5
/*
6
 * This file is part of the sweetrdf/InMemoryStoreSqlite package and licensed under
7
 * the terms of the GPL-3 license.
8
 *
9
 * (c) Konrad Abicht <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
use rdfInterface\NamedNode as iNamedNode;
16
use rdfInterface\Term;
17
18
class NamedNode implements iNamedNode
19
{
20
    private string $iri;
21
22 6
    public function __construct(string $iri)
23
    {
24 6
        $this->iri = $iri;
25 6
    }
26
27 1
    public function __toString(): string
28
    {
29 1
        return '<'.$this->iri.'>';
30
    }
31
32 1
    public function getValue(): string
33
    {
34 1
        return $this->iri;
35
    }
36
37 1
    public function getType(): string
38
    {
39 1
        return \rdfInterface\TYPE_NAMED_NODE;
40
    }
41
42 2
    public function equals(Term $term): bool
43
    {
44 2
        return $this == $term;
45
    }
46
}
47