@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $cachedOutput = $this->loadTemplate(); |
39 | 39 | //To be a valid XML document it must have a root element, automatically wrap it in <template> to ensure it does |
40 | - $template = new Template($this->isValidDoc($cachedOutput['body']) ? $cachedOutput['body'] : '<template>' . $cachedOutput['body'] . '</template>' ); |
|
40 | + $template = new Template($this->isValidDoc($cachedOutput['body']) ? $cachedOutput['body'] : '<template>'.$cachedOutput['body'].'</template>'); |
|
41 | 41 | |
42 | 42 | //Allow $time to be set via arguments to spoof time passage during tests |
43 | 43 | foreach ($this->getRules($template) as $rule) { |
@@ -78,11 +78,11 @@ discard block |
||
78 | 78 | //N.b. only files can be cached |
79 | 79 | private function getRules($template) { |
80 | 80 | if (is_file($this->tss)) { |
81 | - $this->baseDir = dirname(realpath($this->tss)) . DIRECTORY_SEPARATOR; |
|
81 | + $this->baseDir = dirname(realpath($this->tss)).DIRECTORY_SEPARATOR; |
|
82 | 82 | //The cache for the key: the filename and template prefix |
83 | 83 | //Each template may have a different prefix which changes the parsed TSS, |
84 | 84 | //Because of this the cache needs to be generated for each template prefix. |
85 | - $key = $this->tss . $template->getPrefix() . $this->baseDir; |
|
85 | + $key = $this->tss.$template->getPrefix().$this->baseDir; |
|
86 | 86 | //Try to load the cached rules, if not set in the cache (or expired) parse the supplied sheet |
87 | 87 | $rules = $this->cache->load($key, filemtime($this->tss)); |
88 | 88 | if (!$rules) return $this->cache->write($key, (new Sheet(file_get_contents($this->tss), $this->baseDir, $template->getPrefix()))->parse()); |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | |
108 | 108 | private function getLocale() { |
109 | 109 | if (is_array($this->locale)) return $this->locale; |
110 | - else if (strlen($this->locale) > 0) return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . $this->locale . '.json'), true); |
|
111 | - else return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . 'enGB.json'), true); |
|
110 | + else if (strlen($this->locale) > 0) return json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'Formatter'.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.$this->locale.'.json'), true); |
|
111 | + else return json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'Formatter'.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.'enGB.json'), true); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function registerProperties($object) { |