getRoot() 공개 정적인 메소드

The result is a canonical path.
부터: 1.0 Added method.
부터: 2.0 Method now fails if $path is not a string.
public static getRoot ( string $path ) : string
$path string A path string.
리턴 string The canonical root directory. Returns an empty string if the given path is relative or empty.
예제 #1
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage The path must be a string. Got: array
  */
 public function testGetRootFailsIfInvalidPath()
 {
     Path::getRoot(array());
 }