private function normalizePath($path)
    {
        $path = rtrim($path, '/');

        if (empty($path) or '/' !== substr($path, 0, 1)) {
            $path = '/';
        }

        return $path;
    }
private function normalizePath($path)
    {
        $path = rtrim($path, '/');

        if (empty($path) or '/' !== substr($path, 0, 1)) {
            $path = '/';
        }

        return $path;
    }
private function normalizePath ( $ path ) { $ path = rtrim ( $ path , '/' ) ; if ( empty ( $ path ) or '/' !== substr ( $ path , 0 , 1 ) ) { $ path = '/' ; } return $ path ; }
Processes path as per spec in RFC 6265.

@see http://tools.ietf.org/html/rfc6265#section-5.1.4
@see http://tools.ietf.org/html/rfc6265#section-5.2.4

@param string|null $path

@return string
Processes path as per spec in RFC 6265 .