$this->styleTestFileDir = FileUtil::getTemporaryFilename('style_');
FileUtil::makePath($this->styleTestFileDir);
- $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->apiVersion, false, $variables);
+ $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->styleName, $this->apiVersion, false, $variables);
if ($result !== null) {
rmdir($this->styleTestFileDir);
$this->styleTestFileDir = FileUtil::getTemporaryFilename('style_');
FileUtil::makePath($this->styleTestFileDir);
- $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->apiVersion, $this->style->imagePath, $variables);
+ $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->styleName, $this->apiVersion, $this->style->imagePath, $variables);
if ($result !== null) {
rmdir($this->styleTestFileDir);
$this->styleTestFileDir = FileUtil::getTemporaryFilename('style_');
FileUtil::makePath($this->styleTestFileDir);
- $errorMessage = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $defaultStyle->apiVersion, $defaultStyle->imagePath, $defaultStyle->getVariables(), $tmpFile);
+ $errorMessage = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $defaultStyle->styleName, $defaultStyle->apiVersion, $defaultStyle->imagePath, $defaultStyle->getVariables(), $tmpFile);
if ($errorMessage !== null) {
rmdir($this->styleTestFileDir);
* error, null is returned. Otherwise the exception is returned (!).
*
* @param string $testFileDir
+ * @param string $styleName
* @param string $apiVersion
* @param string $imagePath
* @param string[] $variables
* @return null|\Exception
* @since 5.3
*/
- public function testStyle($testFileDir, $apiVersion, $imagePath, array $variables, $customCustomSCSSFile = null) {
+ public function testStyle($testFileDir, $styleName, $apiVersion, $imagePath, array $variables, $customCustomSCSSFile = null) {
$individualScss = '';
if (isset($variables['individualScss'])) {
$individualScss = $variables['individualScss'];
$files,
$variables,
$individualScss . (!empty($parameters['scss']) ? "\n" . $parameters['scss'] : ''),
- function($content) {
- return "/* stylesheet, generated on ".gmdate('r')." -- DO NOT EDIT */\n\n" . $content;
+ function($content) use ($styleName) {
+ return "/* stylesheet for '". $styleName ."', generated on ".gmdate('r')." -- DO NOT EDIT */\n\n" . $content;
}
);
}