TestBasicObject::getMyHash()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace DimshTests\Models\Collections;
4
5
class TestBasicObject
6
{
7
    /**
8
     * @var int
9
     */
10
    protected static $counter = 0;
11
12
    public $public_property;
13
14
    public static function increment()
15
    {
16
        self::$counter++;
17
    }
18
19
    public static function getCounterValue()
20
    {
21
        return self::$counter;
22
    }
23
24
    public function __construct()
25
    {
26
        TestBasicObject::increment();
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getMyHash()
33
    {
34
        return md5(spl_object_hash($this));
35
    }
36
37
    /**
38
     * @return int
39
     */
40
    public function getCounter()
41
    {
42
        return TestBasicObject::getCounterValue();
43
    }
44
}
45