TestBasicObject   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A increment() 0 4 1
A getCounterValue() 0 4 1
A __construct() 0 4 1
A getMyHash() 0 4 1
A getCounter() 0 4 1
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