Completed
Push — master ( 81db43...f030be )
by Aleh
12s
created

File::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Padawan\Domain\Project;
4
5
6
use Padawan\Domain\Scope\FileScope;
7
8
/**
9
 * Class File
10
 */
11
class File
12
{
13
    /** @var FileScope */
14
    private $_scope;
15
    private $_path;
16
    private $hash;
17
    private $name;
0 ignored issues
show
Unused Code introduced by
The property $name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
18
19
    public function __construct($path)
20
    {
21
        $this->_path = $path;
22
    }
23
24
    public function updateScope(FileScope $scope, $hash)
25
    {
26
        $this->_scope = $scope;
27
        $this->hash = $hash;
28
    }
29
30
    /**
31
     * @return FileScope
32
     */
33
    public function scope()
34
    {
35
        return $this->_scope;
36
    }
37
38
    public function path()
39
    {
40
        return $this->_path;
41
    }
42
43
    public function isChanged($hash)
44
    {
45
        return $this->hash !== $hash;
46
    }
47
}
48