src/main/php/Rootpath.php
public function contains($path)
    {
        $realpath = realpath($path);
        if (false === $realpath) {
            return false;
        }

        return substr($realpath, 0, strlen($this->rootpath)) === $this->rootpath;
    }
public function contains($path)
    {
        $realpath = realpath($path);
        if (false === $realpath) {
            return false;
        }

        return substr($realpath, 0, strlen($this->rootpath)) === $this->rootpath;
    }
checks if given path is located within root path

@param   string  $path
@return  bool