Passed
Pull Request — master (#301)
by Fabien
01:59
created

NoVcsChangesCountProcess::getFilename()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
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
class NoVcsChangesCountProcess implements ChangesCountInterface
11
{
12
13
    /**
14
     * The file the process will be executed on.
15
     *
16
     * @var File
17
     */
18
    private $file;
19
20
    /**
21
     * Class constructor.
22
     *
23
     * @param File $file The file the process is being executed on.
24
     */
25
    public function __construct(File $file)
26
    {
27
        $this->file = $file;
28
    }
29
30
    /**
31
     * Returns the number of changes for a file.
32
     */
33
    public function countChanges(): int
34
    {
35
        return 1;
36
    }
37
38
    /**
39
     * Start the process.
40
     */
41
    public function start(): void
42
    {
43
        // nothing to do
44
    }
45
46
    /**
47
     * Determines if the process was successful.
48
     */
49
    public function isSuccessful(): bool
50
    {
51
        return true;
52
    }
53
54
    /**
55
     * Gets the file the process is being executed on.
56
     */
57
    public function getFile(): File
58
    {
59
        return $this->file;
60
    }
61
}
62