Completed
Push — master ( 8eb04e...f340f4 )
by Greg
04:24
created

FsUtils   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A realpath() 0 5 2
1
<?php
2
namespace Consolidation\SiteAlias\Util;
3
4
use Symfony\Component\Filesystem\Filesystem;
5
use Webmozart\PathUtil\Path;
6
7
class FsUtils
8
{
9
    /**
10
     * Returns canonicalized absolute pathname.
11
     *
12
     * The difference between this and PHP's realpath() is that this will
13
     * return the original path even if it doesn't exist.
14
     *
15
     * @param string $path
16
     *   The path being checked.
17
     *
18
     * @return string
19
     *   The canonicalized absolute pathname.
20
     */
21
    public static function realpath($path)
22
    {
23
        $realpath = realpath($path);
24
        return $realpath ?: $path;
25
    }
26
}
27