| 1 | <?php  | 
            ||
| 5 | class Path implements PathInterface  | 
            ||
| 6 | { | 
            ||
| 7 | /**  | 
            ||
| 8 | * @var string  | 
            ||
| 9 | */  | 
            ||
| 10 | protected $path;  | 
            ||
| 11 | |||
| 12 | /**  | 
            ||
| 13 | * @param null|string $path  | 
            ||
| 14 | */  | 
            ||
| 15 | 27 | public function __construct($path = null)  | 
            |
| 21 | |||
| 22 | /**  | 
            ||
| 23 | * @param string $path  | 
            ||
| 24 | * @return $this  | 
            ||
| 25 | * @throws PathNotFoundException  | 
            ||
| 26 | */  | 
            ||
| 27 | 27 | public function setPath($path)  | 
            |
| 36 | |||
| 37 | /**  | 
            ||
| 38 | * @return string  | 
            ||
| 39 | */  | 
            ||
| 40 | 21 | public function getPath()  | 
            |
| 44 | |||
| 45 | /**  | 
            ||
| 46 | * @return string  | 
            ||
| 47 | */  | 
            ||
| 48 | 18 | public function __toString()  | 
            |
| 52 | }  | 
            ||
| 53 | 
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: