Passed
Branch updateSoftMocks (a05b0f)
by Mougrim
06:28
created

Example   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A stringLength() 0 3 1
A factorial() 0 7 2
1
<?php
2
3
namespace Mougrim\PhpunitSoftMocks\Example;
4
5
define('SOME_CONSTANT', 3);
6
7
/**
8
 * @author Mougrim <[email protected]>
9
 */
10
class Example
11
{
12
    const CLASS_CONSTANT = 5;
13
14
    public $property;
15
16 3
    public function __construct($value = 0)
17
    {
18 3
        $this->property = $value;
19
    }
20
21 1
    public function factorial($number)
22
    {
23 1
        if ($number <= 1) {
24 1
            return 1;
25
        }
26
27 1
        return $number * $this->factorial($number - 1);
28
    }
29
30 1
    public function stringLength()
31
    {
32 1
        return strlen('a');
33
    }
34
}
35