Inspekt\Inspekt::getPath PHP Method

getPath() public static method

Returns realpath(value).
public static getPath ( mixed $value ) : mixed
$value mixed
return mixed
    public static function getPath($value)
    {
        if (Inspekt::isArrayOrArrayObject($value)) {
            return Inspekt::walkArray($value, 'getPath');
        } else {
            return realpath($value);
        }
    }

Usage Example

Beispiel #1
0
 /**
  *
  */
 public function testGetPath()
 {
     $old_cwd = getcwd();
     chdir(dirname(__FILE__));
     $expected = dirname(__FILE__);
     $this->assertSame(Inspekt::getPath('./'), $expected);
     $expected = dirname(dirname(dirname(__FILE__)));
     $this->assertSame(Inspekt::getPath('./../../'), $expected);
     chdir($old_cwd);
 }