src/ObjectFactory.php
protected static function expandClosures( $list ) {
		return array_map( function ( $value ) {
			if ( is_object( $value ) && $value instanceof Closure ) {
				// If $value is a Closure, call it.
				return $value();
			} else {
				return $value;
			}
		}, $list );
	}
protected static function expandClosures( $list ) {
		return array_map( function ( $value ) {
			if ( is_object( $value ) && $value instanceof Closure ) {
				// If $value is a Closure, call it.
				return $value();
			} else {
				return $value;
			}
		}, $list );
	}
protected static function expandClosures ( $ list ) { return array_map ( function ( $ value ) { if ( is_object ( $ value ) && $ value instanceof Closure ) { // If $value is a Closure, call it. return $ value ( ) ; } else { return $ value ; } } , $ list ) ; }
Iterate a list and call any closures it contains.

@param array $list List of things
@return array List with any Closures replaced with their output
Iterate a list and call any closures it contains .