Passed
Push — extract-store ( 38a23e...9fc033 )
by Konrad
05:01
created

NamedNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 27.27%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A equals() 0 3 1
A __toString() 0 3 1
A getValue() 0 3 1
A __construct() 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
use rdfInterface\TYPE_NAMED_NODE;
0 ignored issues
show
Bug introduced by
The type rdfInterface\TYPE_NAMED_NODE was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
19
class NamedNode implements iNamedNode
20
{
21
    private string $iri;
22
23 1
    public function __construct(string $iri)
24
    {
25 1
        $this->iri = $iri;
26 1
    }
27
28
    public function __toString(): string
29
    {
30
        return '<'.$this->iri.'>';
31
    }
32
33
    public function getValue(): string
34
    {
35
        return $this->iri;
36
    }
37
38
    public function getType(): string
39
    {
40
        return TYPE_NAMED_NODE;
41
    }
42
43
    public function equals(Term $term): bool
44
    {
45
        return $this === $term;
46
    }
47
}
48