Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

fix for ['parser']['cache_dir'] and ['css'] - #16

Open
dwilbanks wants to merge 1 commit into
elboletaire:masterfrom
dwilbanks:develop-1
Open

fix for ['parser']['cache_dir'] and ['css']#16
dwilbanks wants to merge 1 commit into
elboletaire:masterfrom
dwilbanks:develop-1

Conversation

@dwilbanks

Copy link
Copy Markdown

additional parameter ['css'] allows for passing to $this->Html->css()

Corrected processing of ['parser']['cache_dir'] parameter to allow for $this->Html->css() to generate links with the correct path.

additional parameter ['css'] allows for passing to $this->Html->css()

Corrected processing of ['parser']['cache_dir'] parameter to allow for $this->Html->css() to generate links with the correct path.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.9%) to 77.778% when pulling 96eaa02 on dwilbanks:develop-1 into 0cf60b3 on elboletaire:master.

@elboletaire elboletaire left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can fix these things I'll try to add the test to check the behavior of the cache_dir working as expected.


try {
$css = $this->compile($less, $options['cache'], $options['parser'], $modifyVars);
$cache_dir = isset($options['parser']['cache_dir']) ?$options['parser']['cache_dir']:"";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad indentation there + missing spaces in concatenation. BTW, this will be better inside a custom function, so we can properly test the cache behavior.

} else {
$options['cache_dir'] = trim($this->cssPath, '/') . $options['cache_dir'];
}
return \Less_Cache::Get($parse, $options, $modifyVars);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are spaces + tabs in many of these lines. Also, the spaces of the if are not properly set and you should avoid using else if. Instead use elseif.

It's also recommendable not to use else. Better define the variable before as a fallback.

}

if (empty($options['css'])) {
$options['css'] = [];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a tab here too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants