@@ -89,24 +89,24 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function addNamespaces(Config $xAppConfig, ?Config $xUserConfig = null) |
91 | 91 | { |
92 | - if(empty($aNamespaces = $xAppConfig->getOptionNames('views'))) |
|
92 | + if (empty($aNamespaces = $xAppConfig->getOptionNames('views'))) |
|
93 | 93 | { |
94 | 94 | return; |
95 | 95 | } |
96 | 96 | $sPackage = $xAppConfig->getOption('package', ''); |
97 | - foreach($aNamespaces as $sNamespace => $sOption) |
|
97 | + foreach ($aNamespaces as $sNamespace => $sOption) |
|
98 | 98 | { |
99 | 99 | // Save the namespace |
100 | 100 | $aNamespace = $xAppConfig->getOption($sOption); |
101 | 101 | $aNamespace['package'] = $sPackage; |
102 | - if(!isset($aNamespace['renderer'])) |
|
102 | + if (!isset($aNamespace['renderer'])) |
|
103 | 103 | { |
104 | 104 | $aNamespace['renderer'] = 'jaxon'; // 'jaxon' is the default renderer. |
105 | 105 | } |
106 | 106 | |
107 | 107 | // If the lib config has defined a template option, then its value must be |
108 | 108 | // read from the app config. |
109 | - if($xUserConfig !== null && isset($aNamespace['template']) && is_array($aNamespace['template'])) |
|
109 | + if ($xUserConfig !== null && isset($aNamespace['template']) && is_array($aNamespace['template'])) |
|
110 | 110 | { |
111 | 111 | $sTemplateOption = $xAppConfig->getOption($sOption . '.template.option'); |
112 | 112 | $sTemplateDefault = $xAppConfig->getOption($sOption . '.template.default'); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $aNamespaces = array_filter($this->aNamespaces, function($aNamespace) use($sId) { |
150 | 150 | return $aNamespace['renderer'] === $sId; |
151 | 151 | }); |
152 | - foreach($aNamespaces as $sNamespace => $aNamespace) |
|
152 | + foreach ($aNamespaces as $sNamespace => $aNamespace) |
|
153 | 153 | { |
154 | 154 | $xRenderer->addNamespace($sNamespace, $aNamespace['directory'], $aNamespace['extension']); |
155 | 155 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function getNamespaceRenderer(string $sNamespace): ?ViewInterface |
184 | 184 | { |
185 | - if(!isset($this->aNamespaces[$sNamespace])) |
|
185 | + if (!isset($this->aNamespaces[$sNamespace])) |
|
186 | 186 | { |
187 | 187 | return null; |
188 | 188 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | protected function store(): Store |
209 | 209 | { |
210 | - if(!$this->xStore) |
|
210 | + if (!$this->xStore) |
|
211 | 211 | { |
212 | 212 | $this->xStore = new Store(); |
213 | 213 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function shareValues(array $aValues): ViewRenderer |
253 | 253 | { |
254 | - foreach($aValues as $sName => $xValue) |
|
254 | + foreach ($aValues as $sName => $xValue) |
|
255 | 255 | { |
256 | 256 | $this->share($sName, $xValue); |
257 | 257 | } |
@@ -275,12 +275,12 @@ discard block |
||
275 | 275 | $sNamespace = $this->sDefaultNamespace; |
276 | 276 | // Get the namespace from the view name |
277 | 277 | $nSeparatorPosition = strrpos($sViewName, '::'); |
278 | - if($nSeparatorPosition !== false) |
|
278 | + if ($nSeparatorPosition !== false) |
|
279 | 279 | { |
280 | 280 | $sNamespace = substr($sViewName, 0, $nSeparatorPosition); |
281 | 281 | } |
282 | 282 | $xRenderer = $this->getNamespaceRenderer($sNamespace); |
283 | - if(!$xRenderer) |
|
283 | + if (!$xRenderer) |
|
284 | 284 | { |
285 | 285 | // Cannot render a view if there's no renderer corresponding to the namespace. |
286 | 286 | return null; |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
45 | 45 | { |
46 | - return empty($sNoScript) ? 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}' : |
|
47 | - 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}else{' . $sNoScript . ';}'; |
|
46 | + return empty($sNoScript) ? 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}' : 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}else{' . $sNoScript . ';}'; |
|
48 | 47 | } |
49 | 48 | |
50 | 49 | /** |
@@ -57,11 +56,11 @@ discard block |
||
57 | 56 | */ |
58 | 57 | private function alert(string $sMessage, string $sTitle): string |
59 | 58 | { |
60 | - if(!empty($sTitle)) |
|
59 | + if (!empty($sTitle)) |
|
61 | 60 | { |
62 | 61 | $sMessage = '<b>' . $sTitle . '</b><br/>' . $sMessage; |
63 | 62 | } |
64 | - if($this->returnCode()) |
|
63 | + if ($this->returnCode()) |
|
65 | 64 | { |
66 | 65 | return 'alert(' . $sMessage . ')'; |
67 | 66 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public static function getInstance(): Ajax |
85 | 85 | { |
86 | - if(self::$xInstance === null) |
|
86 | + if (self::$xInstance === null) |
|
87 | 87 | { |
88 | 88 | // First call: create and initialize the instances. |
89 | 89 | self::$xInstance = new Ajax(); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function config(string $sConfigFile = '', string $sConfigSection = ''): ConfigManager |
123 | 123 | { |
124 | - if(!empty(($sConfigFile = trim($sConfigFile)))) |
|
124 | + if (!empty(($sConfigFile = trim($sConfigFile)))) |
|
125 | 125 | { |
126 | 126 | $this->xConfigManager->load($sConfigFile, trim($sConfigSection)); |
127 | 127 | } |
@@ -33,24 +33,24 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function sendResponse() |
35 | 35 | { |
36 | - if(!$this->xConfigManager->getOption('core.response.send', false)) |
|
36 | + if (!$this->xConfigManager->getOption('core.response.send', false)) |
|
37 | 37 | { |
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
41 | 41 | // Check to see if headers have already been sent out, in which case we can't do our job |
42 | - if(headers_sent($sFilename, $nLineNumber)) |
|
42 | + if (headers_sent($sFilename, $nLineNumber)) |
|
43 | 43 | { |
44 | 44 | throw new RequestException($this->xTranslator->trans('errors.output.already-sent', |
45 | 45 | ['location' => $sFilename . ':' . $nLineNumber]) . "\n" . |
46 | 46 | $this->xTranslator->trans('errors.output.advice')); |
47 | 47 | } |
48 | - if(empty($sContent = $this->xResponseManager->getOutput())) |
|
48 | + if (empty($sContent = $this->xResponseManager->getOutput())) |
|
49 | 49 | { |
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - if($this->di()->getRequest()->getMethod() === 'GET') |
|
53 | + if ($this->di()->getRequest()->getMethod() === 'GET') |
|
54 | 54 | { |
55 | 55 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
56 | 56 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | print $sContent; |
63 | 63 | |
64 | - if($this->xConfigManager->getOption('core.process.exit', false)) |
|
64 | + if ($this->xConfigManager->getOption('core.process.exit', false)) |
|
65 | 65 | { |
66 | 66 | exit(); |
67 | 67 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function setup(string $sConfigFile) |
52 | 52 | { |
53 | - if(!file_exists($sConfigFile)) |
|
53 | + if (!file_exists($sConfigFile)) |
|
54 | 54 | { |
55 | 55 | $sMessage = $this->xTranslator->trans('errors.file.access', ['path' => $sConfigFile]); |
56 | 56 | throw new SetupException($sMessage); |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | $aOptions = $this->xConfigManager->read($sConfigFile); |
61 | 61 | $aLibOptions = $aOptions['lib'] ?? []; |
62 | 62 | $aAppOptions = $aOptions['app'] ?? []; |
63 | - if(!is_array($aLibOptions) || !is_array($aAppOptions)) |
|
63 | + if (!is_array($aLibOptions) || !is_array($aAppOptions)) |
|
64 | 64 | { |
65 | 65 | $sMessage = $this->xTranslator->trans('errors.file.content', ['path' => $sConfigFile]); |
66 | 66 | throw new SetupException($sMessage); |
67 | 67 | } |
68 | 68 | // The bootstrap set this to false. It needs to be changed. |
69 | - if(!isset($aLibOptions['core']['response']['send'])) |
|
69 | + if (!isset($aLibOptions['core']['response']['send'])) |
|
70 | 70 | { |
71 | 71 | $aLibOptions['core']['response']['send'] = true; |
72 | 72 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | // and the other classes will get this request from there. |
73 | 73 | $this->di->val(ServerRequestInterface::class, $request); |
74 | 74 | |
75 | - if(!$this->xRequestHandler->canProcessRequest()) |
|
75 | + if (!$this->xRequestHandler->canProcessRequest()) |
|
76 | 76 | { |
77 | 77 | // Unable to find a plugin to process the request |
78 | 78 | throw new RequestException($this->xTranslator->trans('errors.request.plugin')); |
@@ -64,7 +64,7 @@ |
||
64 | 64 | // and the other classes will get this request from there. |
65 | 65 | $this->di->val(ServerRequestInterface::class, $request); |
66 | 66 | |
67 | - if(!$this->xRequestHandler->canProcessRequest()) |
|
67 | + if (!$this->xRequestHandler->canProcessRequest()) |
|
68 | 68 | { |
69 | 69 | // Unable to find a plugin to process the request |
70 | 70 | return $handler->handle($request); |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | if(isset($aServerParams['CONTENT_TYPE'])) |
111 | 111 | { |
112 | 112 | $sContentType = $aServerParams['CONTENT_TYPE']; |
113 | - } |
|
114 | - elseif(isset($aServerParams['HTTP_CONTENT_TYPE'])) |
|
113 | + } elseif(isset($aServerParams['HTTP_CONTENT_TYPE'])) |
|
115 | 114 | { |
116 | 115 | $sContentType = $aServerParams['HTTP_CONTENT_TYPE']; |
117 | 116 | } |
@@ -142,20 +141,17 @@ discard block |
||
142 | 141 | $this->cUtf8Decoder = function($sStr) use($sEncoding) { |
143 | 142 | return iconv("UTF-8", $sEncoding . '//TRANSLIT', $sStr); |
144 | 143 | }; |
145 | - } |
|
146 | - elseif(function_exists('mb_convert_encoding')) |
|
144 | + } elseif(function_exists('mb_convert_encoding')) |
|
147 | 145 | { |
148 | 146 | $this->cUtf8Decoder = function($sStr) use($sEncoding) { |
149 | 147 | return mb_convert_encoding($sStr, $sEncoding, "UTF-8"); |
150 | 148 | }; |
151 | - } |
|
152 | - elseif($sEncoding === "ISO-8859-1") |
|
149 | + } elseif($sEncoding === "ISO-8859-1") |
|
153 | 150 | { |
154 | 151 | $this->cUtf8Decoder = function($sStr) { |
155 | 152 | return utf8_decode($sStr); |
156 | 153 | }; |
157 | - } |
|
158 | - else |
|
154 | + } else |
|
159 | 155 | { |
160 | 156 | throw new RequestException($this->xTranslator->trans('errors.request.conversion')); |
161 | 157 | } |
@@ -251,8 +247,7 @@ discard block |
||
251 | 247 | { |
252 | 248 | $aParams = $aBody['jxnargs']; |
253 | 249 | } |
254 | - } |
|
255 | - else |
|
250 | + } else |
|
256 | 251 | { |
257 | 252 | $aParams = $xRequest->getQueryParams(); |
258 | 253 | if(isset($aParams['jxnargs'])) |
@@ -196,15 +196,15 @@ |
||
196 | 196 | $sValue = substr($sValue, 1); |
197 | 197 | switch($cType) |
198 | 198 | { |
199 | - case 'S': |
|
200 | - return $sValue; |
|
201 | - case 'B': |
|
202 | - return $this->convertStringToBool($sValue); |
|
203 | - case 'N': |
|
204 | - return ($sValue == floor($sValue) ? (int)$sValue : (float)$sValue); |
|
205 | - case '*': |
|
206 | - default: |
|
207 | - return null; |
|
199 | + case 'S': |
|
200 | + return $sValue; |
|
201 | + case 'B': |
|
202 | + return $this->convertStringToBool($sValue); |
|
203 | + case 'N': |
|
204 | + return ($sValue == floor($sValue) ? (int)$sValue : (float)$sValue); |
|
205 | + case '*': |
|
206 | + default: |
|
207 | + return null; |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 |
@@ -107,16 +107,16 @@ discard block |
||
107 | 107 | // Parameters are url encoded when uploading files |
108 | 108 | $aServerParams = $this->di->getRequest()->getServerParams(); |
109 | 109 | $sContentType = ''; |
110 | - if(isset($aServerParams['CONTENT_TYPE'])) |
|
110 | + if (isset($aServerParams['CONTENT_TYPE'])) |
|
111 | 111 | { |
112 | 112 | $sContentType = $aServerParams['CONTENT_TYPE']; |
113 | 113 | } |
114 | - elseif(isset($aServerParams['HTTP_CONTENT_TYPE'])) |
|
114 | + elseif (isset($aServerParams['HTTP_CONTENT_TYPE'])) |
|
115 | 115 | { |
116 | 116 | $sContentType = $aServerParams['HTTP_CONTENT_TYPE']; |
117 | 117 | } |
118 | 118 | $sType = 'multipart/form-data'; |
119 | - if(strncmp($sContentType, $sType, strlen($sType)) !== 0) |
|
119 | + if (strncmp($sContentType, $sType, strlen($sType)) !== 0) |
|
120 | 120 | { |
121 | 121 | $this->cParamDecoder = function($sParam) { return $sParam; }; |
122 | 122 | return; |
@@ -137,19 +137,19 @@ discard block |
||
137 | 137 | return $sStr; |
138 | 138 | }; |
139 | 139 | $sEncoding = $this->xConfigManager->getOption('core.encoding', ''); |
140 | - if(function_exists('iconv')) |
|
140 | + if (function_exists('iconv')) |
|
141 | 141 | { |
142 | 142 | $this->cUtf8Decoder = function($sStr) use($sEncoding) { |
143 | 143 | return iconv("UTF-8", $sEncoding . '//TRANSLIT', $sStr); |
144 | 144 | }; |
145 | 145 | } |
146 | - elseif(function_exists('mb_convert_encoding')) |
|
146 | + elseif (function_exists('mb_convert_encoding')) |
|
147 | 147 | { |
148 | 148 | $this->cUtf8Decoder = function($sStr) use($sEncoding) { |
149 | 149 | return mb_convert_encoding($sStr, $sEncoding, "UTF-8"); |
150 | 150 | }; |
151 | 151 | } |
152 | - elseif($sEncoding === "ISO-8859-1") |
|
152 | + elseif ($sEncoding === "ISO-8859-1") |
|
153 | 153 | { |
154 | 154 | $this->cUtf8Decoder = function($sStr) { |
155 | 155 | return utf8_decode($sStr); |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | */ |
171 | 171 | private function convertStringToBool(string $sValue): bool |
172 | 172 | { |
173 | - if(strcasecmp($sValue, 'true') === 0) |
|
173 | + if (strcasecmp($sValue, 'true') === 0) |
|
174 | 174 | { |
175 | 175 | return true; |
176 | 176 | } |
177 | - if(strcasecmp($sValue, 'false') === 0) |
|
177 | + if (strcasecmp($sValue, 'false') === 0) |
|
178 | 178 | { |
179 | 179 | return false; |
180 | 180 | } |
@@ -194,14 +194,14 @@ discard block |
||
194 | 194 | { |
195 | 195 | $cType = substr($sValue, 0, 1); |
196 | 196 | $sValue = substr($sValue, 1); |
197 | - switch($cType) |
|
197 | + switch ($cType) |
|
198 | 198 | { |
199 | 199 | case 'S': |
200 | 200 | return $sValue; |
201 | 201 | case 'B': |
202 | 202 | return $this->convertStringToBool($sValue); |
203 | 203 | case 'N': |
204 | - return ($sValue == floor($sValue) ? (int)$sValue : (float)$sValue); |
|
204 | + return ($sValue == floor($sValue) ? (int) $sValue : (float) $sValue); |
|
205 | 205 | case '*': |
206 | 206 | default: |
207 | 207 | return null; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | private function decodeRequestParameter(string $sParam) |
219 | 219 | { |
220 | - if($sParam === '') |
|
220 | + if ($sParam === '') |
|
221 | 221 | { |
222 | 222 | return $sParam; |
223 | 223 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $sParam = call_user_func($this->cParamDecoder, $sParam); |
226 | 226 | |
227 | 227 | $xJson = json_decode($sParam, true); |
228 | - if($xJson !== null && $sParam != $xJson) |
|
228 | + if ($xJson !== null && $sParam != $xJson) |
|
229 | 229 | { |
230 | 230 | return $xJson; |
231 | 231 | } |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | $aParams = []; |
241 | 241 | $xRequest = $this->di->getRequest(); |
242 | 242 | $aBody = $xRequest->getParsedBody(); |
243 | - if(is_array($aBody)) |
|
243 | + if (is_array($aBody)) |
|
244 | 244 | { |
245 | - if(isset($aBody['jxnargs'])) |
|
245 | + if (isset($aBody['jxnargs'])) |
|
246 | 246 | { |
247 | 247 | $aParams = $aBody['jxnargs']; |
248 | 248 | } |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | else |
251 | 251 | { |
252 | 252 | $aParams = $xRequest->getQueryParams(); |
253 | - if(isset($aParams['jxnargs'])) |
|
253 | + if (isset($aParams['jxnargs'])) |
|
254 | 254 | { |
255 | 255 | $aParams = $aParams['jxnargs']; |
256 | 256 | } |
257 | 257 | } |
258 | 258 | return array_map(function($sParam) { |
259 | - return $this->decodeRequestParameter((string)$sParam); |
|
259 | + return $this->decodeRequestParameter((string) $sParam); |
|
260 | 260 | }, $aParams); |
261 | 261 | } |
262 | 262 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | private function decodeUtf8Parameter($xValue) |
271 | 271 | { |
272 | - if(is_string($xValue)) |
|
272 | + if (is_string($xValue)) |
|
273 | 273 | { |
274 | 274 | return call_user_func($this->cUtf8Decoder, $xValue); |
275 | 275 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | private function decodeUtf8Parameters(array $aParams): array |
290 | 290 | { |
291 | 291 | $aValues = []; |
292 | - foreach($aParams as $sKey => $xValue) |
|
292 | + foreach ($aParams as $sKey => $xValue) |
|
293 | 293 | { |
294 | 294 | // Decode the key |
295 | 295 | $sKey = call_user_func($this->cUtf8Decoder, $sKey); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | { |
311 | 311 | $this->setParamDecoder(); |
312 | 312 | $aParams = $this->getRequestParameters(); |
313 | - if(!$this->xConfigManager->getOption('core.decode_utf8')) |
|
313 | + if (!$this->xConfigManager->getOption('core.decode_utf8')) |
|
314 | 314 | { |
315 | 315 | return $aParams; |
316 | 316 | } |
@@ -125,8 +125,7 @@ |
||
125 | 125 | if(is_string($xOptions)) |
126 | 126 | { |
127 | 127 | $xOptions = ['include' => $xOptions]; |
128 | - } |
|
129 | - elseif(!is_array($xOptions)) |
|
128 | + } elseif(!is_array($xOptions)) |
|
130 | 129 | { |
131 | 130 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
132 | 131 | } |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function checkOptions(string $sCallable, $xOptions): array |
130 | 130 | { |
131 | - if(!$this->xValidator->validateFunction(trim($sCallable))) |
|
131 | + if (!$this->xValidator->validateFunction(trim($sCallable))) |
|
132 | 132 | { |
133 | 133 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
134 | 134 | } |
135 | - if(is_string($xOptions)) |
|
135 | + if (is_string($xOptions)) |
|
136 | 136 | { |
137 | 137 | $xOptions = ['include' => $xOptions]; |
138 | 138 | } |
139 | - elseif(!is_array($xOptions)) |
|
139 | + elseif (!is_array($xOptions)) |
|
140 | 140 | { |
141 | 141 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
142 | 142 | } |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | $sPhpFunction = trim($sCallable); |
158 | 158 | $sFunction = $sPhpFunction; |
159 | 159 | // Check if an alias is defined |
160 | - if(isset($aOptions['alias'])) |
|
160 | + if (isset($aOptions['alias'])) |
|
161 | 161 | { |
162 | - $sFunction = (string)$aOptions['alias']; |
|
162 | + $sFunction = (string) $aOptions['alias']; |
|
163 | 163 | unset($aOptions['alias']); |
164 | 164 | } |
165 | 165 | $this->aFunctions[$sFunction] = $sPhpFunction; |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | public function getCallable(string $sCallable) |
182 | 182 | { |
183 | 183 | $sFunction = trim($sCallable); |
184 | - if(!isset($this->aFunctions[$sFunction])) |
|
184 | + if (!isset($this->aFunctions[$sFunction])) |
|
185 | 185 | { |
186 | 186 | return null; |
187 | 187 | } |
188 | 188 | $xCallable = new CallableFunction($this->di, $sFunction, |
189 | 189 | $this->sPrefix . $sFunction, $this->aFunctions[$sFunction]); |
190 | - foreach($this->aOptions[$sFunction] as $sName => $sValue) |
|
190 | + foreach ($this->aOptions[$sFunction] as $sName => $sValue) |
|
191 | 191 | { |
192 | 192 | $xCallable->configure($sName, $sValue); |
193 | 193 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | public function getScript(): string |
217 | 217 | { |
218 | 218 | $code = ''; |
219 | - foreach(array_keys($this->aFunctions) as $sFunction) |
|
219 | + foreach (array_keys($this->aFunctions) as $sFunction) |
|
220 | 220 | { |
221 | 221 | $xFunction = $this->getCallable($sFunction); |
222 | 222 | $code .= $this->getCallableScript($xFunction); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | public static function canProcessRequest(ServerRequestInterface $xRequest): bool |
231 | 231 | { |
232 | 232 | $aBody = $xRequest->getParsedBody(); |
233 | - if(is_array($aBody)) |
|
233 | + if (is_array($aBody)) |
|
234 | 234 | { |
235 | 235 | return isset($aBody['jxnfun']); |
236 | 236 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | public function setTarget(ServerRequestInterface $xRequest) |
245 | 245 | { |
246 | 246 | $aBody = $xRequest->getParsedBody(); |
247 | - if(is_array($aBody)) |
|
247 | + if (is_array($aBody)) |
|
248 | 248 | { |
249 | 249 | $this->xTarget = Target::makeFunction(trim($aBody['jxnfun'])); |
250 | 250 | return; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $sRequestedFunction = $this->xTarget->getFunctionName(); |
263 | 263 | |
264 | 264 | // Security check: make sure the requested function was registered. |
265 | - if(!$this->xValidator->validateFunction($sRequestedFunction) || |
|
265 | + if (!$this->xValidator->validateFunction($sRequestedFunction) || |
|
266 | 266 | !isset($this->aFunctions[$sRequestedFunction])) |
267 | 267 | { |
268 | 268 | // Unable to find the requested function |