src/IteratorDirectory.php
public static function wrap($source) {
		if ($source instanceof \Iterator) {
			$options = [
				'iterator' => $source
			];
		} else if (is_array($source)) {
			$options = [
				'array' => $source
			];
		} else {
			throw new \BadMethodCallException('$source should be an Iterator or array');
		}
		return self::wrapSource(self::NO_SOURCE_DIR, $options);
	}
public static function wrap($source) {
		if ($source instanceof \Iterator) {
			$options = [
				'iterator' => $source
			];
		} else if (is_array($source)) {
			$options = [
				'array' => $source
			];
		} else {
			throw new \BadMethodCallException('$source should be an Iterator or array');
		}
		return self::wrapSource(self::NO_SOURCE_DIR, $options);
	}
public static function wrap ( $ source ) { if ( $ source instanceof \ Iterator ) { $ options = [ 'iterator' => $ source ] ; } else if ( is_array ( $ source ) ) { $ options = [ 'array' => $ source ] ; } else { throw new \ BadMethodCallException ( '$source should be an Iterator or array' ) ; } return self :: wrapSource ( self :: NO_SOURCE_DIR , $ options ) ; }
Creates a directory handle from the provided array or iterator

@param \Iterator | array $source
@return resource|bool

@throws \BadMethodCallException
Creates a directory handle from the provided array or iterator