public function getPath($key, $default = null)
    {
        if (!parent::offsetExists($key)) {
            if (!$default) {
                return $default;
            }

            if (!($default instanceof PathLocatorInterface)) {
                $default = new PathLocator($default);
            }

            return $default;
        }

        return parent::offsetGet($key);
    }
public function getPath($key, $default = null)
    {
        if (!parent::offsetExists($key)) {
            if (!$default) {
                return $default;
            }

            if (!($default instanceof PathLocatorInterface)) {
                $default = new PathLocator($default);
            }

            return $default;
        }

        return parent::offsetGet($key);
    }
public function getPath ( $ key , $ default = null ) { if ( ! parent :: offsetExists ( $ key ) ) { if ( ! $ default ) { return $ default ; } if ( ! ( $ default instanceof PathLocatorInterface ) ) { $ default = new PathLocator ( $ default ) ; } return $ default ; } return parent :: offsetGet ( $ key ) ; }
Using key to get a path.

@param  string $key       The key of path you want to get.
@param  string $default   If path not exists, return this default path.
Default value can be PathLocator object string or null.
String will auto wrapped by object, if is null, just return null.

@return  PathLocator  The path which you want.

@since  2.0
Using key to get a path .