src/DirectoryFactory.php
public static function build(ServerInterface $server)
    {
        if ($server instanceof SftpServer) {
            return new SftpDirectory($server);
        } elseif ($server instanceof FtpServer || $server instanceof SslServer) {
            return new FtpDirectory($server);
        } else {
            throw new \InvalidArgumentException('The argument is must instance of server class');
        }
    }
public static function build(ServerInterface $server)
    {
        if ($server instanceof SftpServer) {
            return new SftpDirectory($server);
        } elseif ($server instanceof FtpServer || $server instanceof SslServer) {
            return new FtpDirectory($server);
        } else {
            throw new \InvalidArgumentException('The argument is must instance of server class');
        }
    }
public static function build ( ServerInterface $ server ) { if ( $ server instanceof SftpServer ) { return new SftpDirectory ( $ server ) ; } elseif ( $ server instanceof FtpServer || $ server instanceof SslServer ) { return new FtpDirectory ( $ server ) ; } else { throw new \ InvalidArgumentException ( 'The argument is must instance of server class' ) ; } }
Build method for Directory classes
Build method for Directory classes