protected static function listAssets($directory) {

        if (false === is_dir($directory)) {
            throw new InvalidArgumentException(sprintf("\"%s\" is not a directory", $directory));
        }

        $assets = [];

        foreach (new DirectoryIterator(realpath($directory)) as $current) {

            // Check the filename and his extension.
            if (true === in_array($current->getFilename(), [".", ".."]) || 0 === preg_match("/\.zip$/", $current->getFilename())) {
                continue;
            }

            $assets[] = $current->getPathname();
        }

        sort($assets);

        return $assets;
    }
protected static function listAssets($directory) {

        if (false === is_dir($directory)) {
            throw new InvalidArgumentException(sprintf("\"%s\" is not a directory", $directory));
        }

        $assets = [];

        foreach (new DirectoryIterator(realpath($directory)) as $current) {

            // Check the filename and his extension.
            if (true === in_array($current->getFilename(), [".", ".."]) || 0 === preg_match("/\.zip$/", $current->getFilename())) {
                continue;
            }

            $assets[] = $current->getPathname();
        }

        sort($assets);

        return $assets;
    }
protected static function listAssets ( $ directory ) { if ( false === is_dir ( $ directory ) ) { throw new InvalidArgumentException ( sprintf ( "\"%s\" is not a directory" , $ directory ) ) ; } $ assets = [ ] ; foreach ( new DirectoryIterator ( realpath ( $ directory ) ) as $ current ) { // Check the filename and his extension. if ( true === in_array ( $ current -> getFilename ( ) , [ "." , ".." ] ) || 0 === preg_match ( "/\.zip$/" , $ current -> getFilename ( ) ) ) { continue ; } $ assets [ ] = $ current -> getPathname ( ) ; } sort ( $ assets ) ; return $ assets ; }
List all assets.

@param string $directory The directory.
@return array Returns the assets.
@throws InvalidArgumentException Throw an invalid argument exception if the directory is not a directory.
List all assets .