TripleTag   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 10
c 2
b 0
f 1
lcom 1
cbo 0
dl 0
loc 58
ccs 25
cts 25
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setNamespace() 0 4 1
A setPredicate() 0 4 1
A setValue() 0 4 1
A getNamespace() 0 4 1
A getPredicate() 0 4 1
A getValue() 0 4 1
A equals() 0 8 3
1
<?php
2
3
/*
4
 * This file is part of the kaloa/metadata package.
5
 *
6
 * For full copyright and license information, please view the LICENSE file
7
 * that was distributed with this source code.
8
 */
9
10
namespace Kaloa\Metadata;
11
12
/**
13
 *
14
 */
15
final class TripleTag
16
{
17
    private $namespace = '';
18
    private $predicate = '';
19
    private $value = '';
20
21
    /**
22
     *
23
     * @param string $value
24
     * @param string $predicate
25
     * @param string $namespace
26
     */
27 7
    public function __construct($value = '', $predicate = '', $namespace = '')
28
    {
29 7
        $this->setValue($value);
30 7
        $this->setPredicate($predicate);
31 7
        $this->setNamespace($namespace);
32 7
    }
33
34 7
    public function setNamespace($newNamespace)
35
    {
36 7
        $this->namespace = trim($newNamespace);
37 7
    }
38
39 7
    public function setPredicate($newPredicate)
40
    {
41 7
        $this->predicate = trim($newPredicate);
42 7
    }
43
44 7
    public function setValue($newValue)
45
    {
46 7
        $this->value = trim($newValue);
47 7
    }
48
49 6
    public function getNamespace()
50
    {
51 6
        return $this->namespace;
52
    }
53
54 5
    public function getPredicate()
55
    {
56 5
        return $this->predicate;
57
    }
58
59 5
    public function getValue()
60
    {
61 5
        return $this->value;
62
    }
63
64 4
    public function equals(TripleTag $tripleTag)
65
    {
66
        return (
67 4
            $this->namespace === $tripleTag->getNamespace()
68 4
            && $this->predicate === $tripleTag->getPredicate()
69 4
            && $this->value === $tripleTag->getValue()
70 4
        );
71
    }
72
}
73