ResourceLoaderFileModule::readStyleFile can throw exceptions which
produces warnings when using array_map.
Produces useful stacktraces when there are issues with style file like LESS compilation errors
Bug: 47844
Bug: 59858
Change-Id: I7c48b2c94752eee81f0eeb8e00d1f2b526d80dfc
*
* @param bool $flip
*
+ * @throws MWException
* @return array: List of concatenated and remapped CSS data from $styles,
* keyed by media type
*/
}
foreach ( $styles as $media => $files ) {
$uniqueFiles = array_unique( $files );
- $styles[$media] = implode(
- "\n",
- array_map(
- array( $this, 'readStyleFile' ),
- $uniqueFiles,
- array_fill( 0, count( $uniqueFiles ), $flip )
- )
- );
+ $styleFiles = array();
+ foreach ( $uniqueFiles as $file ) {
+ $styleFiles[] = $this->readStyleFile( $file, $flip );
+ }
+ $styles[$media] = implode( "\n", $styleFiles );
}
return $styles;
}