Passed
Push — v4.x ( 2c501a...67b817 )
by Thierry
02:26
created
src/Plugin/Code/AssetManager.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function shallIncludeAssets(Plugin $xPlugin): bool
72 72
     {
73 73
         $sPluginOptionName = 'assets.include.' . $xPlugin->getName();
74
-        if($this->xConfigManager->hasOption($sPluginOptionName))
74
+        if ($this->xConfigManager->hasOption($sPluginOptionName))
75 75
         {
76 76
             return $this->xConfigManager->getOption($sPluginOptionName);
77 77
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $sJsLibUri = rtrim($this->xConfigManager->getOption('js.lib.uri', self::JS_LIB_URL), '/') . '/';
91 91
         // Add component files to the javascript file array;
92 92
         $aJsFiles = [$sJsLibUri . 'jaxon.core' . $sJsExtension];
93
-        if($this->xConfigManager->getOption('core.debug.on'))
93
+        if ($this->xConfigManager->getOption('core.debug.on'))
94 94
         {
95 95
             $sLanguage = $this->xConfigManager->getOption('core.language');
96 96
             $aJsFiles[] = $sJsLibUri . 'jaxon.debug' . $sJsExtension;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function getOptionVars(): array
109 109
     {
110
-        if(!$this->xConfigManager->hasOption('core.request.uri'))
110
+        if (!$this->xConfigManager->hasOption('core.request.uri'))
111 111
         {
112 112
             $this->xConfigManager->setOption('core.request.uri', $this->xParameterReader->uri());
113 113
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         // Check config options
141 141
         // - The js.app.export option must be set to true
142 142
         // - The js.app.uri and js.app.dir options must be set to non null values
143
-        if(!$this->xConfigManager->getOption('js.app.export', false) ||
143
+        if (!$this->xConfigManager->getOption('js.app.export', false) ||
144 144
             !$this->xConfigManager->getOption('js.app.uri') ||
145 145
             !$this->xConfigManager->getOption('js.app.dir'))
146 146
         {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function createJsFiles(CodeGenerator $xCodeGenerator): string
160 160
     {
161
-        if(!$this->shallCreateJsFiles())
161
+        if (!$this->shallCreateJsFiles())
162 162
         {
163 163
             return '';
164 164
         }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $sJsFileName = $this->xConfigManager->getOption('js.app.file') ?: $xCodeGenerator->getHash();
168 168
         $sJsDirectory = rtrim($this->xConfigManager->getOption('js.app.dir'), '\/') . DIRECTORY_SEPARATOR;
169 169
         // - The js.app.dir must be writable
170
-        if(!$sJsFileName || !is_dir($sJsDirectory) || !is_writable($sJsDirectory))
170
+        if (!$sJsFileName || !is_dir($sJsDirectory) || !is_writable($sJsDirectory))
171 171
         {
172 172
             return '';
173 173
         }
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
         $sJsFilePath = $sJsDirectory . $sJsFileName . '.js';
176 176
         $sJsMinFilePath = $sJsDirectory . $sJsFileName . '.min.js';
177 177
         $sJsFileUri = rtrim($this->xConfigManager->getOption('js.app.uri'), '/') . "/$sJsFileName";
178
-        if(!is_file($sJsFilePath) && !@file_put_contents($sJsFilePath, $xCodeGenerator->getJsScript()))
178
+        if (!is_file($sJsFilePath) && !@file_put_contents($sJsFilePath, $xCodeGenerator->getJsScript()))
179 179
         {
180 180
             return '';
181 181
         }
182
-        if(!$this->xConfigManager->getOption('js.app.minify', false))
182
+        if (!$this->xConfigManager->getOption('js.app.minify', false))
183 183
         {
184 184
             return $sJsFileUri . '.js';
185 185
         }
186
-        if(!is_file($sJsMinFilePath) && !$this->xMinifier->minify($sJsFilePath, $sJsMinFilePath))
186
+        if (!is_file($sJsMinFilePath) && !$this->xMinifier->minify($sJsFilePath, $sJsMinFilePath))
187 187
         {
188 188
             // If the file cannot be minified, return the plain js file.
189 189
             return $sJsFileUri . '.js';
Please login to merge, or discard this patch.