Completed
Push — master ( 4f9e52...c78e04 )
by Kai
06:43 queued 04:55
created

HashContainer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 42
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getHashString() 0 4 1
A setHashString() 0 6 1
A __toString() 0 4 1
1
<?php namespace SimpleHash\Container;
2
3
/**
4
 * Hash container class
5
 *
6
 * @package    SimpleHash
7
 * @author     Kai Hempel <[email protected]>
8
 * @copyright  2016 Kai Hempel <[email protected]>
9
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
10
 * @link       https://www.kuweh.de/
11
 * @since      Class available since Release 1.0.0
12
 */
13
class HashContainer implements HashContainerInterface
14
{
15
    /**
16
     * The hash string
17
     *
18
     * @var string
19
     */
20
    private $hashString = '';
21
22
    /**
23
     * Returns the hash string
24
     *
25
     * @return string
26
     */
27 3
    public function getHashString()
28
    {
29 3
        return $this->hashString;
30
    }
31
32
    /**
33
     * Sets the hash string
34
     *
35
     * @param string $hashString
36
     * @return HashContainerInterface
37
     */
38 2
    public function setHashString($hashString)
39
    {
40 2
        $this->hashString = $hashString;
41
42 2
        return $this;
43
    }
44
45
    /**
46
     * Magic string method for direct compare
47
     *
48
     * @return string
49
     */
50 2
    public function __toString()
51
    {
52 2
        return $this->getHashString();
53
    }
54
}