FakeClock::advanceMillis()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace IntegerNet\DeployerTimer;
5
6
class FakeClock implements Clock
7
{
8
    /**
9
     * @var float
10
     */
11
    private $timestamp;
12
13 9
    public function __construct(float $timestamp)
14
    {
15 9
        $this->timestamp = $timestamp;
16 9
    }
17
18 9
    public function microtime(): float
19
    {
20 9
        return $this->timestamp;
21
    }
22
23 6
    public function advanceMillis(int $millis): void
24
    {
25 6
        $this->timestamp += ($millis * 0.001);
26 6
    }
27
}
28