protected function getWrapperInstance($base, $type = 'Directory')
    {
        $wrapper = $this->getWrapperClass($type);

        if ( ! $wrapper) {
            throw new \InvalidArgumentException(
                sprintf(
                    '<error>Unknown wrapper-type "%s"</error>',
                    $type
                )
            );
        }

        if (is_dir($base)) {
            $wrapper = $this->getWrapperClass('Directory');
        }

        $this->debug('Using wrapper "' . $wrapper . '" for "' . $base . '"');

        return new $wrapper($base);
    }
protected function getWrapperInstance($base, $type = 'Directory')
    {
        $wrapper = $this->getWrapperClass($type);

        if ( ! $wrapper) {
            throw new \InvalidArgumentException(
                sprintf(
                    '<error>Unknown wrapper-type "%s"</error>',
                    $type
                )
            );
        }

        if (is_dir($base)) {
            $wrapper = $this->getWrapperClass('Directory');
        }

        $this->debug('Using wrapper "' . $wrapper . '" for "' . $base . '"');

        return new $wrapper($base);
    }
protected function getWrapperInstance ( $ base , $ type = 'Directory' ) { $ wrapper = $ this -> getWrapperClass ( $ type ) ; if ( ! $ wrapper ) { throw new \ InvalidArgumentException ( sprintf ( '<error>Unknown wrapper-type "%s"</error>' , $ type ) ) ; } if ( is_dir ( $ base ) ) { $ wrapper = $ this -> getWrapperClass ( 'Directory' ) ; } $ this -> debug ( 'Using wrapper "' . $ wrapper . '" for "' . $ base . '"' ) ; return new $ wrapper ( $ base ) ; }
Create a wrapper for the given target.

When the target is a directory,
then the type overridden with "Directory".

@param string $base
@param string $type

@return AbstractWrapper
Create a wrapper for the given target .