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

File   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 37
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A updateScope() 0 5 1
A scope() 0 4 1
A path() 0 4 1
A isChanged() 0 4 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