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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dwilbanks
Copy link

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

Coverage Status

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

Copy link
Owner

@elboletaire elboletaire left a comment

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.

@@ -147,14 +147,16 @@ public function less($less = 'styles.less', array $options = [], array $modifyVa
}

try {
$css = $this->compile($less, $options['cache'], $options['parser'], $modifyVars);
$cache_dir = isset($options['parser']['cache_dir']) ?$options['parser']['cache_dir']:"";
Copy link
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
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.

@@ -327,7 +336,10 @@ protected function setOptions(array $options)
if (!isset($options['cache'])) {
$options['cache'] = true;
}

if (empty($options['css'])) {
$options['css'] = [];
Copy link
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