File::isFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AlreadyExtract\Utils\ExtractorCommandDecoder;
4
5
/**
6
 * Created by PhpStorm.
7
 * User: mhor
8
 * Date: 02/08/17
9
 * Time: 23:33
10
 */
11
class File
12
{
13
    /**
14
     * @var string
15
     */
16
    private $path;
17
18
    /**
19
     * @var string
20
     */
21
    private $unpackedSize;
22
23
    /**
24
     * @return bool
25
     */
26
    public function isDir()
27
    {
28
        return $this->unpackedSize === 0;
0 ignored issues
show
Unused Code Bug introduced by
The strict comparison === seems to always evaluate to false as the types of $this->unpackedSize (string) and 0 (integer) can never be identical. Maybe you want to use a loose comparison == instead?
Loading history...
29
    }
30
31
    /**
32
     * @return bool
33
     */
34
    public function isFile()
35
    {
36
        return $this->unpackedSize > 0;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getPath()
43
    {
44
        return $this->path;
45
    }
46
47
    /**
48
     * @param mixed $path
49
     * @return File
50
     */
51
    public function setPath($path)
52
    {
53
        $this->path = $path;
54
        return $this;
55
    }
56
57
    /**
58
     * @return mixed
59
     */
60
    public function getUnpackedSize()
61
    {
62
        return $this->unpackedSize;
63
    }
64
65
    /**
66
     * @param mixed $unpackedSize
67
     * @return File
68
     */
69
    public function setUnpackedSize($unpackedSize)
70
    {
71
        $this->unpackedSize = $unpackedSize;
72
        return $this;
73
    }
74
}