Total Complexity | 5 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class Info implements FileInfoInterface |
||
17 | { |
||
18 | /** @var mixed $fileInfo */ |
||
19 | private $fileInfo; |
||
20 | |||
21 | /** |
||
22 | * Info constructor. |
||
23 | * |
||
24 | * @param string $fileName |
||
25 | */ |
||
26 | public function __construct(string $fileName) |
||
27 | { |
||
28 | $this->fileInfo = pathinfo($fileName); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritDoc |
||
33 | */ |
||
34 | public function getBaseName(): string |
||
35 | { |
||
36 | return $this->fileInfo['basename']; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @inheritDoc |
||
41 | */ |
||
42 | public function getDirName(): string |
||
43 | { |
||
44 | return $this->fileInfo['dirname']; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @inheritDoc |
||
49 | */ |
||
50 | public function getExtension(): string |
||
51 | { |
||
52 | return $this->fileInfo['extension']; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @inheritDoc |
||
57 | */ |
||
58 | public function getFileName(): string |
||
61 | } |
||
62 | } |
||
63 |