NoVcsChangesCountProcess::countChanges()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Churn\Process\ChangesCount;
6
7
use Churn\File\File;
8
use Churn\Process\ChangesCountInterface;
9
10
/**
11
 * @internal
12
 */
13
final class NoVcsChangesCountProcess implements ChangesCountInterface
14
{
15
    /**
16
     * The file the process will be executed on.
17
     *
18
     * @var File
19
     */
20
    private $file;
21
22
    /**
23
     * Class constructor.
24
     *
25
     * @param File $file The file the process is being executed on.
26
     */
27
    public function __construct(File $file)
28
    {
29
        $this->file = $file;
30
    }
31
32
    /**
33
     * Returns the number of changes for a file.
34
     */
35
    #[\Override]
36
    public function countChanges(): int
37
    {
38
        return 1;
39
    }
40
41
    /**
42
     * Start the process.
43
     */
44
    #[\Override]
45
    public function start(): void
46
    {
47
        // nothing to do
48
    }
49
50
    /**
51
     * Determines if the process was successful.
52
     */
53
    #[\Override]
54
    public function isSuccessful(): bool
55
    {
56
        return true;
57
    }
58
59
    /**
60
     * Gets the file the process is being executed on.
61
     */
62
    #[\Override]
63
    public function getFile(): File
64
    {
65
        return $this->file;
66
    }
67
}
68