@@ -27,7 +27,9 @@ discard block |
||
27 | 27 | $this->cache = new Cache(new \ArrayObject()); |
28 | 28 | $this->filePath = new FilePath(); |
29 | 29 | $modules = is_array($modules) ? $modules : $this->defaultModules; |
30 | - foreach ($modules as $module) $this->loadModule(new $module); |
|
30 | + foreach ($modules as $module) { |
|
31 | + $this->loadModule(new $module); |
|
32 | + } |
|
31 | 33 | } |
32 | 34 | |
33 | 35 | //Allow setting the time used by Transphporm for caching. This is for testing purposes |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | $valueParser = new Parser\Value($functionSet); |
62 | 64 | $this->config = new Config($functionSet, $valueParser, $elementData, new Hook\Formatter(), new Parser\CssToXpath($functionSet, $template->getPrefix(), md5($this->tss)), $this->filePath, $headers); |
63 | 65 | |
64 | - foreach ($this->modules as $module) $module->load($this->config); |
|
66 | + foreach ($this->modules as $module) { |
|
67 | + $module->load($this->config); |
|
68 | + } |
|
65 | 69 | |
66 | 70 | $this->processRules($template, $this->config); |
67 | 71 | |
@@ -75,7 +79,9 @@ discard block |
||
75 | 79 | $rules = $this->getRules($template, $config); |
76 | 80 | |
77 | 81 | foreach ($rules as $rule) { |
78 | - if ($rule->shouldRun($this->time)) $this->executeTssRule($rule, $template, $config); |
|
82 | + if ($rule->shouldRun($this->time)) { |
|
83 | + $this->executeTssRule($rule, $template, $config); |
|
84 | + } |
|
79 | 85 | } |
80 | 86 | } |
81 | 87 | |
@@ -98,7 +104,9 @@ discard block |
||
98 | 104 | //Load a template, firstly check if it's a file or a valid string |
99 | 105 | private function loadTemplate() { |
100 | 106 | $result = ['body' => $this->template, 'headers' => []]; |
101 | - if (strpos($this->template, "\n") === false && is_file($this->template)) $result = $this->loadTemplateFromFile($this->template); |
|
107 | + if (strpos($this->template, "\n") === false && is_file($this->template)) { |
|
108 | + $result = $this->loadTemplateFromFile($this->template); |
|
109 | + } |
|
102 | 110 | return $result; |
103 | 111 | } |
104 | 112 | |
@@ -124,6 +132,8 @@ discard block |
||
124 | 132 | |
125 | 133 | public function __destruct() { |
126 | 134 | //Required hack as DomXPath can only register static functions clear the statically stored instance to avoid memory leaks |
127 | - if (isset($this->config)) $this->config->getCssToXpath()->cleanup(); |
|
135 | + if (isset($this->config)) { |
|
136 | + $this->config->getCssToXpath()->cleanup(); |
|
137 | + } |
|
128 | 138 | } |
129 | 139 | } |