Completed
Push — master ( 89bfcf...4ab803 )
by Vladimir
02:41
created

FilePath::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * @copyright 2017 Vladimir Jimenez
5
 * @license   https://github.com/allejo/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\System;
9
10
/**
11
 * An object that will accept a *nix style path and return a cross-platform ready file path.
12
 */
13
class FilePath
14
{
15
    private $originalPath;
16
    private $pathNodes;
17
18
    public function __construct($filePath)
19
    {
20
        $this->originalPath = $filePath;
21
        $this->pathNodes = explode('/', $filePath);
22
    }
23
24
    public function __toString()
25
    {
26
        return implode(DIRECTORY_SEPARATOR, $this->pathNodes);
27
    }
28
}
29