Completed
Push — master ( bcb23d...237738 )
by Thierry
01:30
created
src/Utils/Config/Php.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
26 26
     public static function read($sConfigFile)
27 27
     {
28 28
         $sConfigFile = realpath($sConfigFile);
29
-        if(!is_readable($sConfigFile))
29
+        if (!is_readable($sConfigFile))
30 30
         {
31 31
             throw new \Jaxon\Utils\Config\Exception\File(jaxon_trans('config.errors.file.access', ['path' => $sConfigFile]));
32 32
         }
33 33
         $aConfigOptions = include($sConfigFile);
34
-        if(!is_array($aConfigOptions))
34
+        if (!is_array($aConfigOptions))
35 35
         {
36 36
             throw new \Jaxon\Utils\Config\Exception\File(jaxon_trans('config.errors.file.content', ['path' => $sConfigFile]));
37 37
         }
Please login to merge, or discard this patch.
src/Utils/Config/Yaml.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@
 block discarded – undo
26 26
     public static function read($sConfigFile)
27 27
     {
28 28
         $sConfigFile = realpath($sConfigFile);
29
-        if(!extension_loaded('yaml'))
29
+        if (!extension_loaded('yaml'))
30 30
         {
31 31
             throw new \Jaxon\Utils\Config\Exception\Yaml(jaxon_trans('config.errors.yaml.install'));
32 32
         }
33
-        if(!is_readable($sConfigFile))
33
+        if (!is_readable($sConfigFile))
34 34
         {
35 35
             throw new \Jaxon\Utils\Config\Exception\File(jaxon_trans('config.errors.file.access', ['path' => $sConfigFile]));
36 36
         }
37 37
         $aConfigOptions = yaml_parse_file($sConfigFile);
38
-        if(!is_array($aConfigOptions))
38
+        if (!is_array($aConfigOptions))
39 39
         {
40 40
             throw new \Jaxon\Utils\Config\Exception\File(jaxon_trans('config.errors.file.content', ['path' => $sConfigFile]));
41 41
         }
Please login to merge, or discard this patch.
src/Utils/Config/Reader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     public function read($sConfigFile)
25 25
     {
26 26
         $sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION);
27
-        switch($sExt)
27
+        switch ($sExt)
28 28
         {
29 29
         case 'php':
30 30
             $aConfigOptions = Php::read($sConfigFile);
Please login to merge, or discard this patch.
src/Utils/View/Renderer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected function store()
42 42
     {
43
-        if(!$this->xStore)
43
+        if (!$this->xStore)
44 44
         {
45 45
             $this->xStore = new Store();
46 46
         }
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
         $sNamespace = $this->xManager->getDefaultNamespace();
94 94
         // Get the namespace from the view name
95 95
         $iSeparatorPosition = strrpos($sViewName, '::');
96
-        if($iSeparatorPosition !== false)
96
+        if ($iSeparatorPosition !== false)
97 97
         {
98 98
             $sNamespace = substr($sViewName, 0, $iSeparatorPosition);
99 99
         }
100 100
         $aRenderers = $this->xManager->getRenderers();
101
-        if(!key_exists($sNamespace, $aRenderers))
101
+        if (!key_exists($sNamespace, $aRenderers))
102 102
         {
103 103
             // Cannot render a view if there's no renderer corresponding to the namespace.
104 104
             return null;
Please login to merge, or discard this patch.
src/Utils/View/View.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $sViewName = $store->getViewName();
49 49
         $sNamespace = $store->getNamespace();
50 50
         // In this view renderer, the namespace must always be prepended to the view name.
51
-        if(substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::')
51
+        if (substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::')
52 52
         {
53 53
             $sViewName = $sNamespace . '::' . $sViewName;
54 54
         }
Please login to merge, or discard this patch.
src/Utils/View/Manager.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@
 block discarded – undo
81 81
         if(key_exists($sRenderer, $this->aNamespaces))
82 82
         {
83 83
             $this->aNamespaces[$sRenderer][] = $aNamespace;
84
-        }
85
-        else
84
+        } else
86 85
         {
87 86
             $this->aNamespaces[$sRenderer] = [$aNamespace];
88 87
         }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             'directory' => $sDirectory,
79 79
             'extension' => $sExtension,
80 80
         ];
81
-        if(key_exists($sRenderer, $this->aNamespaces))
81
+        if (key_exists($sRenderer, $this->aNamespaces))
82 82
         {
83 83
             $this->aNamespaces[$sRenderer][] = $aNamespace;
84 84
         }
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
     public function addNamespaces($xAppConfig)
100 100
     {
101 101
         $this->sDefaultNamespace = $xAppConfig->getOption('options.views.default', false);
102
-        if(is_array($namespaces = $xAppConfig->getOptionNames('views')))
102
+        if (is_array($namespaces = $xAppConfig->getOptionNames('views')))
103 103
         {
104
-            foreach($namespaces as $namespace => $option)
104
+            foreach ($namespaces as $namespace => $option)
105 105
             {
106 106
                 // If no default namespace is defined, use the first one as default.
107
-                if($this->sDefaultNamespace == false)
107
+                if ($this->sDefaultNamespace == false)
108 108
                 {
109 109
                     $this->sDefaultNamespace = (string)$namespace;
110 110
                 }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function getRenderer($sId = '')
128 128
     {
129
-        if(!$sId)
129
+        if (!$sId)
130 130
         {
131 131
             // Return the view renderer facade
132 132
             return jaxon()->di()->get(\Jaxon\Utils\View\Renderer::class);
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
         jaxon()->di()->set('jaxon.app.view.base.' . $sId, $xClosure);
150 150
 
151 151
         // Return the initialized view renderer
152
-        jaxon()->di()->set('jaxon.app.view.' . $sId, function ($c) use ($sId) {
152
+        jaxon()->di()->set('jaxon.app.view.' . $sId, function($c) use ($sId) {
153 153
             // Get the defined renderer
154 154
             $renderer = $c['jaxon.app.view.base.' . $sId];
155 155
 
156 156
             // Init the renderer with the template namespaces
157
-            if(key_exists($sId, $this->aNamespaces))
157
+            if (key_exists($sId, $this->aNamespaces))
158 158
             {
159
-                foreach($this->aNamespaces[$sId] as $ns)
159
+                foreach ($this->aNamespaces[$sId] as $ns)
160 160
                 {
161 161
                     $renderer->addNamespace($ns['namespace'], $ns['directory'], $ns['extension']);
162 162
                 }
Please login to merge, or discard this patch.
src/Utils/Dialogs/Confirm.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function confirm($question, $yesScript, $noScript)
24 24
     {
25
-        if(!$noScript)
25
+        if (!$noScript)
26 26
         {
27 27
             return 'if(confirm(' . $question . ')){' . $yesScript . ';}';
28 28
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
         if(!$noScript)
26 26
         {
27 27
             return 'if(confirm(' . $question . ')){' . $yesScript . ';}';
28
-        }
29
-        else
28
+        } else
30 29
         {
31 30
             return 'if(confirm(' . $question . ')){' . $yesScript . ';}else{' . $noScript . ';}';
32 31
         }
Please login to merge, or discard this patch.
src/Utils/Dialogs/Alert.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     protected function alert($message)
27 27
     {
28
-        if($this->getReturn())
28
+        if ($this->getReturn())
29 29
         {
30 30
             return 'alert(' . $message . ')';
31 31
         }
Please login to merge, or discard this patch.
src/Response/Response.php 3 patches
Braces   +43 added lines, -38 removed lines patch added patch discarded remove patch
@@ -169,20 +169,17 @@  discard block
 block discarded – undo
169 169
                             $aLastCommand['cmd'] == 'js')
170 170
                     {
171 171
                         $mData = $aLastCommand['data'].'; '.$mData;
172
-                    }
173
-                    elseif($this->getOption('core.response.merge.ap') &&
172
+                    } elseif($this->getOption('core.response.merge.ap') &&
174 173
                             $aLastCommand['cmd'] == 'ap' &&
175 174
                             $aLastCommand['id'] == $aAttributes['id'] &&
176 175
                             $aLastCommand['prop'] == $aAttributes['prop'])
177 176
                     {
178 177
                         $mData = $aLastCommand['data'].' '.$mData;
179
-                    }
180
-                    else
178
+                    } else
181 179
                     {
182 180
                         $this->aCommands[] = $aLastCommand;
183 181
                     }
184
-                }
185
-                else
182
+                } else
186 183
                 {
187 184
                     $this->aCommands[] = $aLastCommand;
188 185
                 }
@@ -237,12 +234,10 @@  discard block
 block discarded – undo
237 234
         {
238 235
             $this->returnValue = $mCommands->returnValue;
239 236
             $aCommands = $mCommands->aCommands;
240
-        }
241
-        elseif(is_array($mCommands))
237
+        } elseif(is_array($mCommands))
242 238
         {
243 239
             $aCommands = $mCommands;
244
-        }
245
-        else
240
+        } else
246 241
         {
247 242
             if(!empty($mCommands))
248 243
             {
@@ -255,8 +250,7 @@  discard block
 block discarded – undo
255 250
             if($bBefore)
256 251
             {
257 252
                 $this->aCommands = array_merge($aCommands, $this->aCommands);
258
-            }
259
-            else
253
+            } else
260 254
             {
261 255
                 $this->aCommands = array_merge($this->aCommands, $aCommands);
262 256
             }
@@ -534,8 +528,9 @@  discard block
 block discarded – undo
534 528
         {
535 529
             $queryStart++;
536 530
             $queryEnd = strpos($sURL, '#', $queryStart);
537
-            if($queryEnd === false)
538
-                $queryEnd = strlen($sURL);
531
+            if($queryEnd === false) {
532
+                            $queryEnd = strlen($sURL);
533
+            }
539 534
             $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart);
540 535
             parse_str($queryPart, $queryParts);
541 536
             $newQueryPart = "";
@@ -544,10 +539,11 @@  discard block
 block discarded – undo
544 539
                 $first = true;
545 540
                 foreach($queryParts as $key => $value)
546 541
                 {
547
-                    if($first)
548
-                        $first = false;
549
-                    else
550
-                        $newQueryPart .= '&';
542
+                    if($first) {
543
+                                            $first = false;
544
+                    } else {
545
+                                            $newQueryPart .= '&';
546
+                    }
551 547
                     $newQueryPart .= rawurlencode($key).'='.rawurlencode($value);
552 548
                 }
553 549
             } elseif($_SERVER['QUERY_STRING']) {
@@ -558,10 +554,11 @@  discard block
 block discarded – undo
558 554
                 }
559 555
             $sURL = str_replace($queryPart, $newQueryPart, $sURL);
560 556
         }
561
-        if($iDelay)
562
-            $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');');
563
-        else
564
-            $this->script('window.location = "' . $sURL . '";');
557
+        if($iDelay) {
558
+                    $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');');
559
+        } else {
560
+                    $this->script('window.location = "' . $sURL . '";');
561
+        }
565 562
         return $this;
566 563
     }
567 564
 
@@ -896,11 +893,13 @@  discard block
 block discarded – undo
896 893
     {
897 894
         $command = ['cmd'  =>  'in'];
898 895
 
899
-        if(($sType))
900
-            $command['type'] = trim((string)$sType, " \t");
896
+        if(($sType)) {
897
+                    $command['type'] = trim((string)$sType, " \t");
898
+        }
901 899
 
902
-        if(($sId))
903
-            $command['elm_id'] = trim((string)$sId, " \t");
900
+        if(($sId)) {
901
+                    $command['elm_id'] = trim((string)$sId, " \t");
902
+        }
904 903
 
905 904
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
906 905
     }
@@ -917,11 +916,13 @@  discard block
 block discarded – undo
917 916
     {
918 917
         $command = ['cmd' => 'ino'];
919 918
 
920
-        if(($sType))
921
-            $command['type'] = trim((string)$sType, " \t");
919
+        if(($sType)) {
920
+                    $command['type'] = trim((string)$sType, " \t");
921
+        }
922 922
 
923
-        if(($sId))
924
-            $command['elm_id'] = trim((string)$sId, " \t");
923
+        if(($sId)) {
924
+                    $command['elm_id'] = trim((string)$sId, " \t");
925
+        }
925 926
 
926 927
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
927 928
     }
@@ -961,8 +962,9 @@  discard block
 block discarded – undo
961 962
     {
962 963
         $command = ['cmd' => 'css'];
963 964
 
964
-        if(($sMedia))
965
-            $command['media'] = trim((string)$sMedia, " \t");
965
+        if(($sMedia)) {
966
+                    $command['media'] = trim((string)$sMedia, " \t");
967
+        }
966 968
 
967 969
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
968 970
     }
@@ -980,8 +982,9 @@  discard block
 block discarded – undo
980 982
     {
981 983
         $command = ['cmd' => 'rcss'];
982 984
 
983
-        if(($sMedia))
984
-            $command['media'] = trim((string)$sMedia, " \t");
985
+        if(($sMedia)) {
986
+                    $command['media'] = trim((string)$sMedia, " \t");
987
+        }
985 988
 
986 989
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
987 990
     }
@@ -1121,11 +1124,13 @@  discard block
 block discarded – undo
1121 1124
     {
1122 1125
         $command = ['cmd' => 'DRC'];
1123 1126
 
1124
-        if(($skip))
1125
-            $command['skip'] = $skip;
1127
+        if(($skip)) {
1128
+                    $command['skip'] = $skip;
1129
+        }
1126 1130
 
1127
-        if(($remove))
1128
-            $command['remove'] = $remove;
1131
+        if(($remove)) {
1132
+                    $command['remove'] = $remove;
1133
+        }
1129 1134
 
1130 1135
         return $this->addCommand($command, $parent);
1131 1136
     }
Please login to merge, or discard this patch.
Doc Comments   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     /**
177 177
      * Clear all the commands already added to the response
178 178
      *
179
-     * @return \Jaxon\Plugin\Response
179
+     * @return Response
180 180
      */
181 181
     public function clearCommands()
182 182
     {
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
      *
191 191
      * @param \Jaxon\Plugin\Plugin  $xPlugin            The plugin object
192 192
      * @param array                 $aAttributes        The attributes for this response command
193
-     * @param mixed                 $mData              The data to be sent with this command
193
+     * @param string                 $mData              The data to be sent with this command
194 194
      *
195
-     * @return \Jaxon\Plugin\Response
195
+     * @return Response
196 196
      */
197 197
     public function addPluginCommand($xPlugin, $aAttributes, $mData)
198 198
     {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      * @param integer        $iCmdNumber            The number of commands to skip upon cancel
252 252
      * @param string        $sMessage            The message to display to the user
253 253
      *
254
-     * @return \Jaxon\Plugin\Response
254
+     * @return Response
255 255
      */
256 256
     public function confirmCommands($iCmdNumber, $sMessage)
257 257
     {
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      * @param string        $sAttribute           The attribute to be assigned
272 272
      * @param string        $sData                The value to be assigned to the attribute
273 273
      *
274
-     * @return \Jaxon\Plugin\Response
274
+     * @return Response
275 275
      */
276 276
     public function assign($sTarget, $sAttribute, $sData)
277 277
     {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      * @param string        $sTarget              The id of the html element on the browser
294 294
      * @param string        $sData                The value to be assigned to the attribute
295 295
      *
296
-     * @return \Jaxon\Plugin\Response
296
+     * @return Response
297 297
      */
298 298
     public function html($sTarget, $sData)
299 299
     {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      * @param string        $sAttribute            The name of the attribute to be appended to
308 308
      * @param string        $sData                The data to be appended to the attribute
309 309
      *
310
-     * @return \Jaxon\Plugin\Response
310
+     * @return Response
311 311
      */
312 312
     public function append($sTarget, $sAttribute, $sData)
313 313
     {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      * @param string        $sAttribute            The name of the attribute to be prepended to
329 329
      * @param string        $sData                The value to be prepended to the attribute
330 330
      *
331
-     * @return \Jaxon\Plugin\Response
331
+     * @return Response
332 332
      */
333 333
     public function prepend($sTarget, $sAttribute, $sData)
334 334
     {
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
      * @param string        $sSearch            The needle to search for
351 351
      * @param string        $sData                The data to use in place of the needle
352 352
      *
353
-     * @return \Jaxon\Plugin\Response
353
+     * @return Response
354 354
      */
355 355
     public function replace($sTarget, $sAttribute, $sSearch, $sData)
356 356
     {
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      * @param string        $sTarget            The id of the element to be updated.
374 374
      * @param string        $sAttribute            The attribute to be cleared
375 375
      *
376
-     * @return \Jaxon\Plugin\Response
376
+     * @return Response
377 377
      */
378 378
     public function clear($sTarget, $sAttribute)
379 379
     {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
      * @param string        $sAttribute            The attribute to be updated
390 390
      * @param string        $sData                The value to assign
391 391
      *
392
-     * @return \Jaxon\Plugin\Response
392
+     * @return Response
393 393
      */
394 394
     public function contextAssign($sAttribute, $sData)
395 395
     {
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      * @param string        $sAttribute            The attribute to be appended to
412 412
      * @param string        $sData                The value to append
413 413
      *
414
-     * @return \Jaxon\Plugin\Response
414
+     * @return Response
415 415
      */
416 416
     public function contextAppend($sAttribute, $sData)
417 417
     {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      * @param string        $sAttribute            The attribute to be updated
434 434
      * @param string        $sData                The value to be prepended
435 435
      *
436
-     * @return \Jaxon\Plugin\Response
436
+     * @return Response
437 437
      */
438 438
     public function contextPrepend($sAttribute, $sData)
439 439
     {
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      *
455 455
      * @param string        $sAttribute            The attribute to be cleared
456 456
      *
457
-     * @return \Jaxon\Plugin\Response
457
+     * @return Response
458 458
      */
459 459
     public function contextClear($sAttribute)
460 460
     {
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
      *
467 467
      * @param string        $sMessage            The message to be displayed
468 468
      *
469
-     * @return \Jaxon\Plugin\Response
469
+     * @return Response
470 470
      */
471 471
     public function alert($sMessage)
472 472
     {
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
      *
484 484
      * @param string        $sMessage            The message to be displayed
485 485
      *
486
-     * @return \Jaxon\Plugin\Response
486
+     * @return Response
487 487
      */
488 488
     public function debug($sMessage)
489 489
     {
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
      * @param string        $sURL                The relative or fully qualified URL
502 502
      * @param integer        $iDelay                Number of seconds to delay before the redirect occurs
503 503
      *
504
-     * @return \Jaxon\Plugin\Response
504
+     * @return Response
505 505
      */
506 506
     public function redirect($sURL, $iDelay=0)
507 507
     {
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
      *
555 555
      * @param string        $sJS                The script to execute
556 556
      *
557
-     * @return \Jaxon\Plugin\Response
557
+     * @return Response
558 558
      */
559 559
     public function script($sJS)
560 560
     {
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
      *
572 572
      * @param string        $sFunc                The name of the function to call
573 573
      *
574
-     * @return \Jaxon\Plugin\Response
574
+     * @return Response
575 575
      */
576 576
     public function call($sFunc)
577 577
     {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
      *
592 592
      * @param string        $sTarget            The id of the element to be removed
593 593
      *
594
-     * @return \Jaxon\Plugin\Response
594
+     * @return Response
595 595
      */
596 596
     public function remove($sTarget)
597 597
     {
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
      * @param string        $sTag                The tag name to be used for the new element
612 612
      * @param string        $sId                The id to assign to the new element
613 613
      *
614
-     * @return \Jaxon\Plugin\Response
614
+     * @return Response
615 615
      */
616 616
     public function create($sParent, $sTag, $sId)
617 617
     {
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
      * @param string        $sTag               The tag name to be used for the new element
633 633
      * @param string        $sId                The id to assign to the new element
634 634
      *
635
-     * @return \Jaxon\Plugin\Response
635
+     * @return Response
636 636
      */
637 637
     public function insert($sBefore, $sTag, $sId)
638 638
     {
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
      * @param string        $sTag               The tag name to be used for the new element
654 654
      * @param string        $sId                The id to assign to the new element
655 655
      *
656
-     * @return \Jaxon\Plugin\Response
656
+     * @return Response
657 657
      */
658 658
     public function insertAfter($sAfter, $sTag, $sId)
659 659
     {
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
      * @param string        $sName                The name of the new input element
676 676
      * @param string        $sId                The id of the new element
677 677
      *
678
-     * @return \Jaxon\Plugin\Response
678
+     * @return Response
679 679
      */
680 680
     public function createInput($sParent, $sType, $sName, $sId)
681 681
     {
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
      * @param string        $sName                The name of the new input element
699 699
      * @param string        $sId                The id of the new element
700 700
      *
701
-     * @return \Jaxon\Plugin\Response
701
+     * @return Response
702 702
      */
703 703
     public function insertInput($sBefore, $sType, $sName, $sId)
704 704
     {
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
      * @param string        $sName                The name of the new input element
722 722
      * @param string        $sId                The id of the new element
723 723
      *
724
-     * @return \Jaxon\Plugin\Response
724
+     * @return Response
725 725
      */
726 726
     public function insertInputAfter($sAfter, $sType, $sName, $sId)
727 727
     {
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
      * @param string        $sEvent                The name of the event
744 744
      * @param string        $sScript            The javascript to execute when the event is fired
745 745
      *
746
-     * @return \Jaxon\Plugin\Response
746
+     * @return Response
747 747
      */
748 748
     public function setEvent($sTarget, $sEvent, $sScript)
749 749
     {
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
      * @param string        $sTarget            The id of the element that contains the event
764 764
      * @param string        $sScript            The javascript to execute when the event is fired
765 765
      *
766
-     * @return \Jaxon\Plugin\Response
766
+     * @return Response
767 767
      */
768 768
     public function onClick($sTarget, $sScript)
769 769
     {
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
      * @param string        $sEvent              The name of the event
780 780
      * @param string        $sHandler            The name of the javascript function to call when the event is fired
781 781
      *
782
-     * @return \Jaxon\Plugin\Response
782
+     * @return Response
783 783
      */
784 784
     public function addHandler($sTarget, $sEvent, $sHandler)
785 785
     {
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
      * @param string        $sEvent              The name of the event
801 801
      * @param string        $sHandler            The name of the javascript function called when the event is fired
802 802
      *
803
-     * @return \Jaxon\Plugin\Response
803
+     * @return Response
804 804
      */
805 805
     public function removeHandler($sTarget, $sEvent, $sHandler)
806 806
     {
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
      * @param string        $sArgs                Comma separated list of parameter names
822 822
      * @param string        $sScript            The javascript code that will become the body of the function
823 823
      *
824
-     * @return \Jaxon\Plugin\Response
824
+     * @return Response
825 825
      */
826 826
     public function setFunction($sFunction, $sArgs, $sScript)
827 827
     {
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
      * @param string        $sReturnValueVar    The name of the variable that will retain the return value
849 849
      *                                             from the call to the original function
850 850
      *
851
-     * @return \Jaxon\Plugin\Response
851
+     * @return Response
852 852
      */
853 853
     public function wrapFunction($sFunction, $sArgs, $aScripts, $sReturnValueVar)
854 854
     {
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
      * @param string        $sFileName            The relative or fully qualified URI of the javascript file
870 870
      * @param string        $sType                Determines the script type. Defaults to 'text/javascript'
871 871
      *
872
-     * @return \Jaxon\Plugin\Response
872
+     * @return Response
873 873
      */
874 874
     public function includeScript($sFileName, $sType = null, $sId = null)
875 875
     {
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
      * @param string        $sFileName            The relative or fully qualified URI of the javascript file
891 891
      * @param string        $sType                Determines the script type. Defaults to 'text/javascript'
892 892
      *
893
-     * @return \Jaxon\Plugin\Response
893
+     * @return Response
894 894
      */
895 895
     public function includeScriptOnce($sFileName, $sType = null, $sId = null)
896 896
     {
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
      * @param string        $sFileName            The relative or fully qualified URI of the javascript file
914 914
      * @param string        $sUnload            Name of a javascript function to call prior to unlaoding the file
915 915
      *
916
-     * @return \Jaxon\Plugin\Response
916
+     * @return Response
917 917
      */
918 918
     public function removeScript($sFileName, $sUnload = '')
919 919
     {
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
      * @param string        $sFileName            The relative or fully qualified URI of the css file
935 935
      * @param string        $sMedia                The media type of the CSS file. Defaults to 'screen'
936 936
      *
937
-     * @return \Jaxon\Plugin\Response
937
+     * @return Response
938 938
      */
939 939
     public function includeCSS($sFileName, $sMedia = null)
940 940
     {
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
      *
954 954
      * @param string        $sFileName            The relative or fully qualified URI of the css file
955 955
      *
956
-     * @return \Jaxon\Plugin\Response
956
+     * @return Response
957 957
      */
958 958
     public function removeCSS($sFileName, $sMedia = null)
959 959
     {
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
      * @param integer        $iTimeout            The number of 1/10ths of a second to pause before timing out
979 979
      *                                             and continuing with the execution of the response commands
980 980
      *
981
-     * @return \Jaxon\Plugin\Response
981
+     * @return Response
982 982
      */
983 983
     public function waitForCSS($iTimeout = 600)
984 984
     {
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
      * @param integer        $tenths                The number of 1/10ths of a second to wait before timing out
1004 1004
      *                                             and continuing with the execution of the response commands.
1005 1005
      *
1006
-     * @return \Jaxon\Plugin\Response
1006
+     * @return Response
1007 1007
      */
1008 1008
     public function waitFor($script, $tenths)
1009 1009
     {
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
      *
1025 1025
      * @param integer        $tenths                The number of 1/10ths of a second to sleep
1026 1026
      *
1027
-     * @return \Jaxon\Plugin\Response
1027
+     * @return Response
1028 1028
      */
1029 1029
     public function sleep($tenths)
1030 1030
     {
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
      * @param string        $variable            The DOM element name (id or class)
1054 1054
      * @param string        $tag                The HTML tag of the new DOM element
1055 1055
      *
1056
-     * @return \Jaxon\Plugin\Response
1056
+     * @return Response
1057 1057
      */
1058 1058
     public function domCreateElement($variable, $tag)
1059 1059
     {
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
      * @param string        $key                The name of the attribute
1074 1074
      * @param string        $value                The value of the attribute
1075 1075
      *
1076
-     * @return \Jaxon\Plugin\Response
1076
+     * @return Response
1077 1077
      */
1078 1078
     public function domSetAttribute($variable, $key, $value)
1079 1079
     {
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
      * @param string        $skip                The ??
1095 1095
      * @param string        $remove                The ??
1096 1096
      *
1097
-     * @return \Jaxon\Plugin\Response
1097
+     * @return Response
1098 1098
      */
1099 1099
     public function domRemoveChildren($parent, $skip = null, $remove = null)
1100 1100
     {
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
      * @param string        $parent                The DOM parent element
1116 1116
      * @param string        $variable            The DOM element name (id or class)
1117 1117
      *
1118
-     * @return \Jaxon\Plugin\Response
1118
+     * @return Response
1119 1119
      */
1120 1120
     public function domAppendChild($parent, $variable)
1121 1121
     {
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
      * @param string        $target                The DOM target element
1135 1135
      * @param string        $variable            The DOM element name (id or class)
1136 1136
      *
1137
-     * @return \Jaxon\Plugin\Response
1137
+     * @return Response
1138 1138
      */
1139 1139
     public function domInsertBefore($target, $variable)
1140 1140
     {
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
      * @param string        $target                The DOM target element
1154 1154
      * @param string        $variable            The DOM element name (id or class)
1155 1155
      *
1156
-     * @return \Jaxon\Plugin\Response
1156
+     * @return Response
1157 1157
      */
1158 1158
     public function domInsertAfter($target, $variable)
1159 1159
     {
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
      * @param string        $parent                The DOM parent element
1173 1173
      * @param string        $text                The HTML text to append
1174 1174
      *
1175
-     * @return \Jaxon\Plugin\Response
1175
+     * @return Response
1176 1176
      */
1177 1177
     public function domAppendText($parent, $text)
1178 1178
     {
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
      *
1214 1214
      * @param mixed        $value                Any value
1215 1215
      *
1216
-     * @return \Jaxon\Plugin\Response
1216
+     * @return Response
1217 1217
      */
1218 1218
     public function setReturnValue($value)
1219 1219
     {
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function plugin($sName)
76 76
     {
77 77
         $xPlugin = $this->getPluginManager()->getResponsePlugin($sName);
78
-        if(!$xPlugin)
78
+        if (!$xPlugin)
79 79
         {
80 80
             return null;
81 81
         }
@@ -138,23 +138,23 @@  discard block
 block discarded – undo
138 138
     public function addCommand($aAttributes, $mData)
139 139
     {
140 140
         /* merge commands if possible */
141
-        if(in_array($aAttributes['cmd'], ['js', 'ap']))
141
+        if (in_array($aAttributes['cmd'], ['js', 'ap']))
142 142
         {
143
-            if(($aLastCommand = array_pop($this->aCommands)))
143
+            if (($aLastCommand = array_pop($this->aCommands)))
144 144
             {
145
-                if($aLastCommand['cmd'] == $aAttributes['cmd'])
145
+                if ($aLastCommand['cmd'] == $aAttributes['cmd'])
146 146
                 {
147
-                    if($this->getOption('core.response.merge.js') &&
147
+                    if ($this->getOption('core.response.merge.js') &&
148 148
                             $aLastCommand['cmd'] == 'js')
149 149
                     {
150
-                        $mData = $aLastCommand['data'].'; '.$mData;
150
+                        $mData = $aLastCommand['data'] . '; ' . $mData;
151 151
                     }
152
-                    elseif($this->getOption('core.response.merge.ap') &&
152
+                    elseif ($this->getOption('core.response.merge.ap') &&
153 153
                             $aLastCommand['cmd'] == 'ap' &&
154 154
                             $aLastCommand['id'] == $aAttributes['id'] &&
155 155
                             $aLastCommand['prop'] == $aAttributes['prop'])
156 156
                     {
157
-                        $mData = $aLastCommand['data'].' '.$mData;
157
+                        $mData = $aLastCommand['data'] . ' ' . $mData;
158 158
                     }
159 159
                     else
160 160
                     {
@@ -212,26 +212,26 @@  discard block
 block discarded – undo
212 212
     public function appendResponse(AbstractResponse $mCommands, $bBefore = false)
213 213
     {
214 214
         $aCommands = [];
215
-        if($mCommands instanceof Response)
215
+        if ($mCommands instanceof Response)
216 216
         {
217 217
             $this->returnValue = $mCommands->returnValue;
218 218
             $aCommands = $mCommands->aCommands;
219 219
         }
220
-        elseif(is_array($mCommands))
220
+        elseif (is_array($mCommands))
221 221
         {
222 222
             $aCommands = $mCommands;
223 223
         }
224 224
         else
225 225
         {
226
-            if(!empty($mCommands))
226
+            if (!empty($mCommands))
227 227
             {
228 228
                 throw new \Jaxon\Exception\Error($this->trans('errors.response.data.invalid'));
229 229
             }
230 230
         }
231 231
 
232
-        if(count($aCommands) > 0)
232
+        if (count($aCommands) > 0)
233 233
         {
234
-            if($bBefore)
234
+            if ($bBefore)
235 235
             {
236 236
                 $this->aCommands = array_merge($aCommands, $this->aCommands);
237 237
             }
@@ -503,33 +503,33 @@  discard block
 block discarded – undo
503 503
      *
504 504
      * @return \Jaxon\Plugin\Response
505 505
      */
506
-    public function redirect($sURL, $iDelay=0)
506
+    public function redirect($sURL, $iDelay = 0)
507 507
     {
508 508
         // we need to parse the query part so that the values are rawurlencode()'ed
509 509
         // can't just use parse_url() cos we could be dealing with a relative URL which
510 510
         // parse_url() can't deal with.
511 511
         $queryStart = strpos($sURL, '?', strrpos($sURL, '/'));
512
-        if($queryStart !== false)
512
+        if ($queryStart !== false)
513 513
         {
514 514
             $queryStart++;
515 515
             $queryEnd = strpos($sURL, '#', $queryStart);
516
-            if($queryEnd === false)
516
+            if ($queryEnd === false)
517 517
                 $queryEnd = strlen($sURL);
518
-            $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart);
518
+            $queryPart = substr($sURL, $queryStart, $queryEnd - $queryStart);
519 519
             parse_str($queryPart, $queryParts);
520 520
             $newQueryPart = "";
521
-            if($queryParts)
521
+            if ($queryParts)
522 522
             {
523 523
                 $first = true;
524
-                foreach($queryParts as $key => $value)
524
+                foreach ($queryParts as $key => $value)
525 525
                 {
526
-                    if($first)
526
+                    if ($first)
527 527
                         $first = false;
528 528
                     else
529 529
                         $newQueryPart .= '&';
530
-                    $newQueryPart .= rawurlencode($key).'='.rawurlencode($value);
530
+                    $newQueryPart .= rawurlencode($key) . '=' . rawurlencode($value);
531 531
                 }
532
-            } elseif($_SERVER['QUERY_STRING']) {
532
+            } elseif ($_SERVER['QUERY_STRING']) {
533 533
                     //couldn't break up the query, but there's one there
534 534
                     //possibly "http://url/page.html?query1234" type of query?
535 535
                     //just encode it and hope it works
@@ -537,8 +537,8 @@  discard block
 block discarded – undo
537 537
                 }
538 538
             $sURL = str_replace($queryPart, $newQueryPart, $sURL);
539 539
         }
540
-        if($iDelay)
541
-            $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');');
540
+        if ($iDelay)
541
+            $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay * 1000) . ');');
542 542
         else
543 543
             $this->script('window.location = "' . $sURL . '";');
544 544
         return $this;
@@ -875,10 +875,10 @@  discard block
 block discarded – undo
875 875
     {
876 876
         $command = ['cmd'  =>  'in'];
877 877
 
878
-        if(($sType))
878
+        if (($sType))
879 879
             $command['type'] = trim((string)$sType, " \t");
880 880
 
881
-        if(($sId))
881
+        if (($sId))
882 882
             $command['elm_id'] = trim((string)$sId, " \t");
883 883
 
884 884
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
@@ -896,10 +896,10 @@  discard block
 block discarded – undo
896 896
     {
897 897
         $command = ['cmd' => 'ino'];
898 898
 
899
-        if(($sType))
899
+        if (($sType))
900 900
             $command['type'] = trim((string)$sType, " \t");
901 901
 
902
-        if(($sId))
902
+        if (($sId))
903 903
             $command['elm_id'] = trim((string)$sId, " \t");
904 904
 
905 905
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
     {
941 941
         $command = ['cmd' => 'css'];
942 942
 
943
-        if(($sMedia))
943
+        if (($sMedia))
944 944
             $command['media'] = trim((string)$sMedia, " \t");
945 945
 
946 946
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
     {
960 960
         $command = ['cmd' => 'rcss'];
961 961
 
962
-        if(($sMedia))
962
+        if (($sMedia))
963 963
             $command['media'] = trim((string)$sMedia, " \t");
964 964
 
965 965
         return $this->addCommand($command, trim((string)$sFileName, " \t"));
@@ -1100,10 +1100,10 @@  discard block
 block discarded – undo
1100 1100
     {
1101 1101
         $command = ['cmd' => 'DRC'];
1102 1102
 
1103
-        if(($skip))
1103
+        if (($skip))
1104 1104
             $command['skip'] = $skip;
1105 1105
 
1106
-        if(($remove))
1106
+        if (($remove))
1107 1107
             $command['remove'] = $remove;
1108 1108
 
1109 1109
         return $this->addCommand($command, $parent);
@@ -1230,13 +1230,13 @@  discard block
 block discarded – undo
1230 1230
     {
1231 1231
         $response = [];
1232 1232
 
1233
-        if(($this->returnValue))
1233
+        if (($this->returnValue))
1234 1234
         {
1235 1235
             $response['jxnrv'] = $this->returnValue;
1236 1236
         }
1237 1237
         $response['jxnobj'] = [];
1238 1238
 
1239
-        foreach($this->aCommands as $xCommand)
1239
+        foreach ($this->aCommands as $xCommand)
1240 1240
         {
1241 1241
             $response['jxnobj'][] = $xCommand;
1242 1242
         }
Please login to merge, or discard this patch.