Completed
Push — master ( 482c5f...79d98c )
by Jan Philipp
13s queued 11s
created

ScriptsPath::isHidden()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Psh\Config;
4
5
class ScriptsPath
6
{
7
    /**
8
     * @var string
9
     */
10
    private $namespace;
11
12
    /**
13
     * @var bool
14
     */
15
    private $hidden;
16
17
    /**
18
     * @var string
19
     */
20
    private $path;
21
22
    /**
23
     * @param string $path
24
     * @param bool $hidden
25
     * @param string $namespace
26
     */
27
    public function __construct(
28
        string $path,
29
        bool $hidden,
30
        string $namespace = null
31
    ) {
32
        $this->namespace = $namespace;
33
        $this->hidden = $hidden;
34
        $this->path = $path;
35
    }
36
37
    /**
38
     * @return string|null
39
     */
40
    public function getNamespace()
41
    {
42
        return $this->namespace;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getPath(): string
49
    {
50
        return $this->path;
51
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function isHidden(): bool
57
    {
58
        return $this->hidden;
59
    }
60
61
    /**
62
     * @return bool
63
     */
64
    public function isValid(): bool
65
    {
66
        return is_dir($this->path);
67
    }
68
}
69