Completed
Push — master ( f0db75...7c3232 )
by Thierry
01:47
created
src/Jaxon.php 4 patches
Doc Comments   +5 added lines, -14 removed lines patch added patch discarded remove patch
@@ -189,15 +189,6 @@  discard block
 block discarded – undo
189 189
      *        - Jaxon::CALLABLE_OBJECT: an object who's methods are to be registered
190 190
      *        - Jaxon::BROWSER_EVENT: an event which will cause zero or more event handlers to be called
191 191
      *        - Jaxon::EVENT_HANDLER: register an event handler function.
192
-     * @param mixed        $sFunction | $objObject | $sEvent
193
-     *        When registering a function, this is the name of the function
194
-     *        When registering a callable object, this is the object being registered
195
-     *        When registering an event or event handler, this is the name of the event
196
-     * @param mixed        $sIncludeFile | $aCallOptions | $sEventHandler
197
-     *        When registering a function, this is the (optional) include file
198
-     *        When registering a callable object, this is an (optional) array
199
-     *             of call options for the functions being registered
200
-     *        When registering an event handler, this is the name of the function
201 192
      *
202 193
      * @return mixed
203 194
      */
@@ -473,7 +464,7 @@  discard block
 block discarded – undo
473 464
      * @param string        $sLibKey            The key of the library options in the file
474 465
      * @param string|null   $sAppKey            The key of the application options in the file
475 466
      *
476
-     * @return array
467
+     * @return null|Utils\Config\Config
477 468
      */
478 469
     public function readPhpConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null)
479 470
     {
@@ -487,7 +478,7 @@  discard block
 block discarded – undo
487 478
      * @param string        $sLibKey            The key of the library options in the file
488 479
      * @param string|null   $sAppKey            The key of the application options in the file
489 480
      *
490
-     * @return array
481
+     * @return null|Utils\Config\Config
491 482
      */
492 483
     public function readYamlConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null)
493 484
     {
@@ -501,7 +492,7 @@  discard block
 block discarded – undo
501 492
      * @param string        $sLibKey            The key of the library options in the file
502 493
      * @param string|null   $sAppKey            The key of the application options in the file
503 494
      *
504
-     * @return array
495
+     * @return Utils\Config\Config|null
505 496
      */
506 497
     public function readJsonConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null)
507 498
     {
@@ -515,7 +506,7 @@  discard block
 block discarded – undo
515 506
      * @param string        $sLibKey            The key of the library options in the file
516 507
      * @param string|null   $sAppKey            The key of the application options in the file
517 508
      *
518
-     * @return array
509
+     * @return null|Utils\Config\Config
519 510
      */
520 511
     public function readConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null)
521 512
     {
@@ -547,7 +538,7 @@  discard block
 block discarded – undo
547 538
      * - 1000 thru 8999: User created plugins, typically, these plugins don't care about order
548 539
      * - 9000 thru 9999: Plugins that generally need to be last or near the end of the plugin list
549 540
      *
550
-     * @param Plugin         $xPlugin               An instance of a plugin
541
+     * @param Plugin\Plugin         $xPlugin               An instance of a plugin
551 542
      * @param integer        $nPriority             The plugin priority, used to order the plugins
552 543
      *
553 544
      * @return void
Please login to merge, or discard this patch.
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -25,10 +25,6 @@
 block discarded – undo
25 25
 
26 26
 namespace Jaxon;
27 27
 
28
-use Jaxon\Plugin\Manager as PluginManager;
29
-use Jaxon\Request\Manager as RequestManager;
30
-use Jaxon\Response\Manager as ResponseManager;
31
-
32 28
 use Jaxon\Utils\URI;
33 29
 use Exception;
34 30
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -212,8 +212,9 @@  discard block
 block discarded – undo
212 212
             {
213 213
                 $sEvent = $aArgs[1];
214 214
                 $xUserFunction = $aArgs[2];
215
-                if(!is_a($xUserFunction, 'Request\\Support\\UserFunction'))
216
-                    $xUserFunction = new Request\Support\UserFunction($xUserFunction);
215
+                if(!is_a($xUserFunction, 'Request\\Support\\UserFunction')) {
216
+                                    $xUserFunction = new Request\Support\UserFunction($xUserFunction);
217
+                }
217 218
                 $this->aProcessingEvents[$sEvent] = $xUserFunction;
218 219
                 return true;
219 220
             }
@@ -324,8 +325,7 @@  discard block
 block discarded – undo
324 325
             try
325 326
             {
326 327
                 $mResult = $this->getPluginManager()->processRequest();
327
-            }
328
-            catch(Exception $e)
328
+            } catch(Exception $e)
329 329
             {
330 330
                 // An exception was thrown while processing the request.
331 331
                 // The request missed the corresponding handler function,
@@ -342,8 +342,7 @@  discard block
 block discarded – undo
342 342
                 {
343 343
                     $sEvent = self::PROCESSING_EVENT_INVALID;
344 344
                     $aParams = array($e->getMessage());
345
-                }
346
-                else
345
+                } else
347 346
                 {
348 347
                     $sEvent = self::PROCESSING_EVENT_ERROR;
349 348
                     $aParams = array($e);
@@ -353,8 +352,7 @@  discard block
 block discarded – undo
353 352
                 {
354 353
                     // Call the processing event
355 354
                     $this->aProcessingEvents[$sEvent]->call($aParams);
356
-                }
357
-                else
355
+                } else
358 356
                 {
359 357
                     // The exception is not to be processed here.
360 358
                     throw $e;
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             'core.prefix.event'                 => 'jaxon_event_',
130 130
             // 'core.request.uri'               => '',
131 131
             'core.request.mode'                 => 'asynchronous',
132
-            'core.request.method'               => 'POST',    // W3C: Method is case sensitive
132
+            'core.request.method'               => 'POST', // W3C: Method is case sensitive
133 133
             'core.debug.on'                     => false,
134 134
             'core.debug.verbose'                => false,
135 135
             'core.process.exit'                 => true,
@@ -206,13 +206,13 @@  discard block
 block discarded – undo
206 206
         $aArgs = func_get_args();
207 207
         $nArgs = func_num_args();
208 208
 
209
-        if(self::PROCESSING_EVENT == $aArgs[0])
209
+        if (self::PROCESSING_EVENT == $aArgs[0])
210 210
         {
211
-            if($nArgs > 2)
211
+            if ($nArgs > 2)
212 212
             {
213 213
                 $sEvent = $aArgs[1];
214 214
                 $xUserFunction = $aArgs[2];
215
-                if(!is_a($xUserFunction, 'Request\\Support\\UserFunction'))
215
+                if (!is_a($xUserFunction, 'Request\\Support\\UserFunction'))
216 216
                     $xUserFunction = new Request\Support\UserFunction($xUserFunction);
217 217
                 $this->aProcessingEvents[$sEvent] = $xUserFunction;
218 218
                 return true;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     public function processRequest()
297 297
     {
298 298
         // Check to see if headers have already been sent out, in which case we can't do our job
299
-        if(headers_sent($filename, $linenumber))
299
+        if (headers_sent($filename, $linenumber))
300 300
         {
301 301
             echo $this->trans('errors.output.already-sent', array(
302 302
                 'location' => $filename . ':' . $linenumber
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         }
306 306
 
307 307
         // Check if there is a plugin to process this request
308
-        if(!$this->canProcessRequest())
308
+        if (!$this->canProcessRequest())
309 309
         {
310 310
             return;
311 311
         }
@@ -314,18 +314,18 @@  discard block
 block discarded – undo
314 314
         $mResult = true;
315 315
 
316 316
         // Handle before processing event
317
-        if(isset($this->aProcessingEvents[self::PROCESSING_EVENT_BEFORE]))
317
+        if (isset($this->aProcessingEvents[self::PROCESSING_EVENT_BEFORE]))
318 318
         {
319 319
             $this->aProcessingEvents[self::PROCESSING_EVENT_BEFORE]->call(array(&$bEndRequest));
320 320
         }
321 321
 
322
-        if(!$bEndRequest)
322
+        if (!$bEndRequest)
323 323
         {
324 324
             try
325 325
             {
326 326
                 $mResult = $this->getPluginManager()->processRequest();
327 327
             }
328
-            catch(Exception $e)
328
+            catch (Exception $e)
329 329
             {
330 330
                 // An exception was thrown while processing the request.
331 331
                 // The request missed the corresponding handler function,
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
                 $xResponseManager->debug($e->getMessage());
339 339
                 $mResult = false;
340 340
 
341
-                if($e instanceof \Jaxon\Exception\Error)
341
+                if ($e instanceof \Jaxon\Exception\Error)
342 342
                 {
343 343
                     $sEvent = self::PROCESSING_EVENT_INVALID;
344 344
                     $aParams = array($e->getMessage());
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                     $aParams = array($e);
350 350
                 }
351 351
 
352
-                if(isset($this->aProcessingEvents[$sEvent]))
352
+                if (isset($this->aProcessingEvents[$sEvent]))
353 353
                 {
354 354
                     // Call the processing event
355 355
                     $this->aProcessingEvents[$sEvent]->call($aParams);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
             }
363 363
         }
364 364
         // Clean the processing buffer
365
-        if(($this->getOption('core.process.clean')))
365
+        if (($this->getOption('core.process.clean')))
366 366
         {
367 367
             $er = error_reporting(0);
368 368
             while (ob_get_level() > 0)
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
             error_reporting($er);
373 373
         }
374 374
 
375
-        if($mResult === true)
375
+        if ($mResult === true)
376 376
         {
377 377
             // Handle after processing event
378
-            if(isset($this->aProcessingEvents[self::PROCESSING_EVENT_AFTER]))
378
+            if (isset($this->aProcessingEvents[self::PROCESSING_EVENT_AFTER]))
379 379
             {
380 380
                 $bEndRequest = false;
381 381
                 $this->aProcessingEvents[self::PROCESSING_EVENT_AFTER]->call(array($bEndRequest));
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
         $this->getResponseManager()->printDebug();
386 386
 
387
-        if(($this->getOption('core.process.exit')))
387
+        if (($this->getOption('core.process.exit')))
388 388
         {
389 389
             $this->getResponseManager()->sendOutput();
390 390
             exit();
@@ -434,16 +434,16 @@  discard block
 block discarded – undo
434 434
      */
435 435
     public function getScript($bIncludeJs = false, $bIncludeCss = false)
436 436
     {
437
-        if(!$this->getOption('core.request.uri'))
437
+        if (!$this->getOption('core.request.uri'))
438 438
         {
439 439
             $this->setOption('core.request.uri', URI::detect());
440 440
         }
441 441
         $sCode = '';
442
-        if(($bIncludeCss))
442
+        if (($bIncludeCss))
443 443
         {
444 444
             $sCode .= $this->getPluginManager()->getCss() . "\n";
445 445
         }
446
-        if(($bIncludeJs))
446
+        if (($bIncludeJs))
447 447
         {
448 448
             $sCode .= $this->getPluginManager()->getJs() . "\n";
449 449
         }
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
     public function readConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null)
542 542
     {
543 543
         $sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION);
544
-        switch($sExt)
544
+        switch ($sExt)
545 545
         {
546 546
         case 'php':
547 547
             return $this->readPhpConfigFile($sConfigFile, $sLibKey, $sAppKey);
Please login to merge, or discard this patch.
src/Plugin/Manager.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,6 @@
 block discarded – undo
24 24
 use Jaxon\Jaxon;
25 25
 use RecursiveDirectoryIterator;
26 26
 use RecursiveIteratorIterator;
27
-use RegexIterator;
28
-use RecursiveRegexIterator;
29 27
 
30 28
 class Manager
31 29
 {
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -258,32 +258,32 @@  discard block
 block discarded – undo
258 258
     {
259 259
         $bIsAlert = ($xPlugin instanceof \Jaxon\Request\Interfaces\Alert);
260 260
         $bIsConfirm = ($xPlugin instanceof \Jaxon\Request\Interfaces\Confirm);
261
-        if($xPlugin instanceof Request)
261
+        if ($xPlugin instanceof Request)
262 262
         {
263 263
             // The name of a request plugin is used as key in the plugin table
264 264
             $this->aRequestPlugins[$xPlugin->getName()] = $xPlugin;
265 265
         }
266
-        else if( $xPlugin instanceof Response)
266
+        else if ($xPlugin instanceof Response)
267 267
         {
268 268
             // The name of a response plugin is used as key in the plugin table
269 269
             $this->aResponsePlugins[$xPlugin->getName()] = $xPlugin;
270 270
         }
271
-        else if(!$bIsConfirm && !$bIsAlert)
271
+        else if (!$bIsConfirm && !$bIsAlert)
272 272
         {
273 273
             throw new \Jaxon\Exception\Error($this->trans('errors.register.invalid', array('name' => get_class($xPlugin))));
274 274
         }
275 275
         // This plugin implements the Alert interface
276
-        if($bIsAlert)
276
+        if ($bIsAlert)
277 277
         {
278 278
             $this->setAlert($xPlugin);
279 279
         }
280 280
         // This plugin implements the Confirm interface
281
-        if($bIsConfirm)
281
+        if ($bIsConfirm)
282 282
         {
283 283
             $this->setConfirm($xPlugin);
284 284
         }
285 285
         // Register the plugin as an event listener
286
-        if($xPlugin instanceof \Jaxon\Utils\Interfaces\EventListener)
286
+        if ($xPlugin instanceof \Jaxon\Utils\Interfaces\EventListener)
287 287
         {
288 288
             $this->addEventListener($xPlugin);
289 289
         }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     private function generateHash()
300 300
     {
301 301
         $sHash = $this->getVersion();
302
-        foreach($this->aPlugins as $xPlugin)
302
+        foreach ($this->aPlugins as $xPlugin)
303 303
         {
304 304
             $sHash .= $xPlugin->generateHash();
305 305
         }
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
      */
317 317
     public function canProcessRequest()
318 318
     {
319
-        foreach($this->aRequestPlugins as $xPlugin)
319
+        foreach ($this->aRequestPlugins as $xPlugin)
320 320
         {
321
-            if($xPlugin->canProcessRequest())
321
+            if ($xPlugin->canProcessRequest())
322 322
             {
323 323
                 return true;
324 324
             }
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
      */
337 337
     public function processRequest()
338 338
     {
339
-        foreach($this->aRequestPlugins as $xPlugin)
339
+        foreach ($this->aRequestPlugins as $xPlugin)
340 340
         {
341
-            if($xPlugin->canProcessRequest())
341
+            if ($xPlugin->canProcessRequest())
342 342
             {
343 343
                 return $xPlugin->processRequest();
344 344
             }
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
      */
360 360
     public function register($aArgs)
361 361
     {
362
-        foreach($this->aRequestPlugins as $xPlugin)
362
+        foreach ($this->aRequestPlugins as $xPlugin)
363 363
         {
364 364
             $mResult = $xPlugin->register($aArgs);
365
-            if($mResult instanceof \Jaxon\Request\Request || is_array($mResult) || $mResult === true)
365
+            if ($mResult instanceof \Jaxon\Request\Request || is_array($mResult) || $mResult === true)
366 366
             {
367 367
                 return $mResult;
368 368
             }
@@ -382,38 +382,38 @@  discard block
 block discarded – undo
382 382
      */
383 383
     public function addClassDir($sDirectory, $sNamespace = null, $sSeparator = '.', array $aProtected = array())
384 384
     {
385
-        if(!is_dir(($sDirectory = trim($sDirectory))))
385
+        if (!is_dir(($sDirectory = trim($sDirectory))))
386 386
         {
387 387
             return false;
388 388
         }
389 389
         // Only '.' and '_' are allowed to be used as separator. Any other value is ignored and '.' is used instead.
390
-        if(($sSeparator = trim($sSeparator)) != '_')
390
+        if (($sSeparator = trim($sSeparator)) != '_')
391 391
         {
392 392
             $sSeparator = '.';
393 393
         }
394
-        if(!($sNamespace = trim($sNamespace)))
394
+        if (!($sNamespace = trim($sNamespace)))
395 395
         {
396 396
             $sNamespace = null;
397 397
         }
398
-        if(($sNamespace))
398
+        if (($sNamespace))
399 399
         {
400 400
             $sNamespace = trim($sNamespace, '\\');
401 401
             // If there is an autoloader, register the dir with PSR4 autoloading
402
-            if(($this->xAutoloader))
402
+            if (($this->xAutoloader))
403 403
             {
404 404
                 $this->xAutoloader->setPsr4($sNamespace . '\\', $sDirectory);
405 405
             }
406 406
         }
407
-        else if(($this->xAutoloader))
407
+        else if (($this->xAutoloader))
408 408
         {
409 409
             // If there is an autoloader, register the dir with classmap autoloading
410 410
             $itDir = new RecursiveDirectoryIterator($sDirectory);
411 411
             $itFile = new RecursiveIteratorIterator($itDir);
412 412
             // Iterate on dir content
413
-            foreach($itFile as $xFile)
413
+            foreach ($itFile as $xFile)
414 414
             {
415 415
                 // skip everything except PHP files
416
-                if(!$xFile->isFile() || $xFile->getExtension() != 'php')
416
+                if (!$xFile->isFile() || $xFile->getExtension() != 'php')
417 417
                 {
418 418
                     continue;
419 419
                 }
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
         $sClassPath = trim(substr($xFile->getPath(), strlen($sDirectory)), DIRECTORY_SEPARATOR);
445 445
         $sClassPath = str_replace(array(DIRECTORY_SEPARATOR), array($sSeparator), $sClassPath);
446 446
         $sClassName = $xFile->getBasename('.php');
447
-        if(($sNamespace))
447
+        if (($sNamespace))
448 448
         {
449 449
             $sNamespace = trim($sNamespace, '\\');
450 450
             $sClassPath = str_replace(array('\\'), array($sSeparator), $sNamespace) . $sSeparator . $sClassPath;
@@ -452,27 +452,27 @@  discard block
 block discarded – undo
452 452
             $sClassName = '\\' . str_replace(array($sSeparator), array('\\'), $sClassPath) . '\\' . $sClassName;
453 453
         }
454 454
         // Require the file only if autoload is enabled but there is no autoloader
455
-        if(($this->bAutoloadEnabled) && !($this->xAutoloader))
455
+        if (($this->bAutoloadEnabled) && !($this->xAutoloader))
456 456
         {
457 457
             require_once($xFile->getPathname());
458 458
         }
459 459
         // Create and register an instance of the class
460
-        if(!array_key_exists('*', $aOptions) || !is_array($aOptions['*']))
460
+        if (!array_key_exists('*', $aOptions) || !is_array($aOptions['*']))
461 461
         {
462 462
             $aOptions['*'] = array();
463 463
         }
464 464
         $aOptions['*']['separator'] = $sSeparator;
465
-        if(($sNamespace))
465
+        if (($sNamespace))
466 466
         {
467 467
             $aOptions['*']['namespace'] = $sNamespace;
468 468
         }
469
-        if(($sClassPath))
469
+        if (($sClassPath))
470 470
         {
471 471
             $aOptions['*']['classpath'] = $sClassPath;
472 472
         }
473 473
         // Filter excluded methods
474
-        $aProtected = array_filter($aProtected, function($sName){return is_string($sName);});
475
-        if(count($aProtected) > 0)
474
+        $aProtected = array_filter($aProtected, function($sName) {return is_string($sName); });
475
+        if (count($aProtected) > 0)
476 476
         {
477 477
             $aOptions['*']['protected'] = $aProtected;
478 478
         }
@@ -486,15 +486,15 @@  discard block
 block discarded – undo
486 486
      */
487 487
     public function registerClasses()
488 488
     {
489
-        foreach($this->aClassDirs as $sClassDir)
489
+        foreach ($this->aClassDirs as $sClassDir)
490 490
         {
491 491
             $itDir = new RecursiveDirectoryIterator($sClassDir['directory']);
492 492
             $itFile = new RecursiveIteratorIterator($itDir);
493 493
             // Iterate on dir content
494
-            foreach($itFile as $xFile)
494
+            foreach ($itFile as $xFile)
495 495
             {
496 496
                 // skip everything except PHP files
497
-                if(!$xFile->isFile() || $xFile->getExtension() != 'php')
497
+                if (!$xFile->isFile() || $xFile->getExtension() != 'php')
498 498
                 {
499 499
                     continue;
500 500
                 }
@@ -514,18 +514,18 @@  discard block
 block discarded – undo
514 514
      */
515 515
     public function registerClass($sClassName, array $aOptions = array())
516 516
     {
517
-        if(!($sInitialClassName = trim($sClassName)))
517
+        if (!($sInitialClassName = trim($sClassName)))
518 518
         {
519 519
             return false;
520 520
         }
521
-        foreach($this->aClassDirs as $aClassDir)
521
+        foreach ($this->aClassDirs as $aClassDir)
522 522
         {
523 523
             // Get the separator
524 524
             $sSeparator = $aClassDir['separator'];
525 525
             // Replace / and \ with dots, and trim the string
526 526
             $sClassName = trim(str_replace(array('\\', '/'), array($sSeparator, $sSeparator), $sInitialClassName), $sSeparator);
527 527
             $sClassPath = '';
528
-            if(($nLastDotPosition = strrpos($sClassName, $sSeparator)) !== false)
528
+            if (($nLastDotPosition = strrpos($sClassName, $sSeparator)) !== false)
529 529
             {
530 530
                 $sClassPath = substr($sClassName, 0, $nLastDotPosition);
531 531
                 $sClassName = substr($sClassName, $nLastDotPosition + 1);
@@ -537,17 +537,17 @@  discard block
 block discarded – undo
537 537
             $nLen = strlen($sNamespace);
538 538
             $bRegister = false;
539 539
             // Check if the class belongs to the namespace
540
-            if(($sNamespace) && substr($sClassPath, 0, $nLen) == str_replace(array('\\'), array($sSeparator), $sNamespace))
540
+            if (($sNamespace) && substr($sClassPath, 0, $nLen) == str_replace(array('\\'), array($sSeparator), $sNamespace))
541 541
             {
542 542
                 $sClassFile = $aClassDir['directory'] . DIRECTORY_SEPARATOR . substr($sClassFile, $nLen);
543 543
                 $bRegister = true;
544 544
             }
545
-            else if(!($sNamespace))
545
+            else if (!($sNamespace))
546 546
             {
547 547
                 $sClassFile = $aClassDir['directory'] . DIRECTORY_SEPARATOR . $sClassFile;
548 548
                 $bRegister = true;
549 549
             }
550
-            if($bRegister && is_file($sClassFile))
550
+            if ($bRegister && is_file($sClassFile))
551 551
             {
552 552
                 // Found the file in this directory
553 553
                 $xFileInfo = new \SplFileInfo($sClassFile);
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
     {
572 572
         $xObject = null; // The user registered object
573 573
         $xPlugin = $this->getRequestPlugin('CallableObject'); // The CallableObject plugin
574
-        if(($xPlugin))
574
+        if (($xPlugin))
575 575
         {
576 576
             $xObject = $xPlugin->getRegisteredObject($sClassName);
577 577
         }
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
      */
586 586
     private function getJsLibUri()
587 587
     {
588
-        if(!$this->hasOption('js.lib.uri'))
588
+        if (!$this->hasOption('js.lib.uri'))
589 589
         {
590 590
             return 'https://cdn.jsdelivr.net/jaxon/1.2.0/';
591 591
         }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
         $jsDelivrUri = 'https://cdn.jsdelivr.net';
606 606
         $nLen = strlen($jsDelivrUri);
607 607
         // The jsDelivr CDN only hosts minified files
608
-        if(($this->getOption('js.app.minify')) || substr($this->getJsLibUri(), 0, $nLen) == $jsDelivrUri)
608
+        if (($this->getOption('js.app.minify')) || substr($this->getJsLibUri(), 0, $nLen) == $jsDelivrUri)
609 609
         {
610 610
             return '.min.js';
611 611
         }
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
         // Check config options
623 623
         // - The js.app.extern option must be set to true
624 624
         // - The js.app.uri and js.app.dir options must be set to non null values
625
-        if(!$this->getOption('js.app.extern') ||
625
+        if (!$this->getOption('js.app.extern') ||
626 626
             !$this->getOption('js.app.uri') ||
627 627
             !$this->getOption('js.app.dir'))
628 628
         {
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
         // Check dir access
632 632
         // - The js.app.dir must be writable
633 633
         $sJsAppDir = $this->getOption('js.app.dir');
634
-        if(!is_dir($sJsAppDir) || !is_writable($sJsAppDir))
634
+        if (!is_dir($sJsAppDir) || !is_writable($sJsAppDir))
635 635
         {
636 636
             return false;
637 637
         }
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
      */
646 646
     private function setTemplateCacheDir()
647 647
     {
648
-        if($this->hasOption('core.template.cache_dir'))
648
+        if ($this->hasOption('core.template.cache_dir'))
649 649
         {
650 650
             $this->setCacheDir($this->getOption('core.template.cache_dir'));
651 651
         }
@@ -667,11 +667,11 @@  discard block
 block discarded – undo
667 667
 
668 668
         // Add component files to the javascript file array;
669 669
         $aJsFiles = array($sJsCoreUrl);
670
-        if($this->getOption('core.debug.on'))
670
+        if ($this->getOption('core.debug.on'))
671 671
         {
672 672
             $aJsFiles[] = $sJsDebugUrl;
673 673
             $aJsFiles[] = $sJsLanguageUrl;
674
-            if($this->getOption('core.debug.verbose'))
674
+            if ($this->getOption('core.debug.verbose'))
675 675
             {
676 676
                 $aJsFiles[] = $sJsVerboseUrl;
677 677
             }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
             'sJsOptions' => $this->getOption('js.app.options'),
684 684
             'aUrls' => $aJsFiles,
685 685
         ));
686
-        foreach($this->aResponsePlugins as $xPlugin)
686
+        foreach ($this->aResponsePlugins as $xPlugin)
687 687
         {
688 688
             $sCode .= rtrim($xPlugin->getJs(), " \n") . "\n";
689 689
         }
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
         $this->setTemplateCacheDir();
702 702
 
703 703
         $sCode = '';
704
-        foreach($this->aResponsePlugins as $xPlugin)
704
+        foreach ($this->aResponsePlugins as $xPlugin)
705 705
         {
706 706
             $sCode .= rtrim($xPlugin->getCss(), " \n") . "\n";
707 707
         }
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
         ));
790 790
 
791 791
         $sPluginScript = '';
792
-        foreach($this->aResponsePlugins as $xPlugin)
792
+        foreach ($this->aResponsePlugins as $xPlugin)
793 793
         {
794 794
             $sPluginScript .= "\n" . trim($xPlugin->getScript(), " \n");
795 795
         }
@@ -821,11 +821,11 @@  discard block
 block discarded – undo
821 821
 
822 822
         // Get the config and plugins scripts
823 823
         $sScript = $this->getConfigScript() . "\n" . $this->getReadyScript() . "\n";
824
-        foreach($this->aRequestPlugins as $xPlugin)
824
+        foreach ($this->aRequestPlugins as $xPlugin)
825 825
         {
826 826
             $sScript .= "\n" . trim($xPlugin->getScript(), " \n");
827 827
         }
828
-        if($this->canExportJavascript())
828
+        if ($this->canExportJavascript())
829 829
         {
830 830
             $sJsAppURI = rtrim($this->getOption('js.app.uri'), '/') . '/';
831 831
             $sJsAppDir = rtrim($this->getOption('js.app.dir'), '/') . '/';
@@ -834,13 +834,13 @@  discard block
 block discarded – undo
834 834
             $sHash = $this->generateHash();
835 835
             $sOutFile = $sHash . '.js';
836 836
             $sMinFile = $sHash . '.min.js';
837
-            if(!is_file($sJsAppDir . $sOutFile))
837
+            if (!is_file($sJsAppDir . $sOutFile))
838 838
             {
839 839
                 file_put_contents($sJsAppDir . $sOutFile, $sScript);
840 840
             }
841
-            if(($this->getOption('js.app.minify')))
841
+            if (($this->getOption('js.app.minify')))
842 842
             {
843
-                if(($this->minify($sJsAppDir . $sOutFile, $sJsAppDir . $sMinFile)))
843
+                if (($this->minify($sJsAppDir . $sOutFile, $sJsAppDir . $sMinFile)))
844 844
                 {
845 845
                     $sOutFile = $sMinFile;
846 846
                 }
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
      */
874 874
     public function getResponsePlugin($sName)
875 875
     {
876
-        if(array_key_exists($sName, $this->aResponsePlugins))
876
+        if (array_key_exists($sName, $this->aResponsePlugins))
877 877
         {
878 878
             return $this->aResponsePlugins[$sName];
879 879
         }
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
      */
890 890
     public function getRequestPlugin($sName)
891 891
     {
892
-        if(array_key_exists($sName, $this->aRequestPlugins))
892
+        if (array_key_exists($sName, $this->aRequestPlugins))
893 893
         {
894 894
             return $this->aRequestPlugins[$sName];
895 895
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -262,13 +262,11 @@  discard block
 block discarded – undo
262 262
         {
263 263
             // The name of a request plugin is used as key in the plugin table
264 264
             $this->aRequestPlugins[$xPlugin->getName()] = $xPlugin;
265
-        }
266
-        else if( $xPlugin instanceof Response)
265
+        } else if( $xPlugin instanceof Response)
267 266
         {
268 267
             // The name of a response plugin is used as key in the plugin table
269 268
             $this->aResponsePlugins[$xPlugin->getName()] = $xPlugin;
270
-        }
271
-        else if(!$bIsConfirm && !$bIsAlert)
269
+        } else if(!$bIsConfirm && !$bIsAlert)
272 270
         {
273 271
             throw new \Jaxon\Exception\Error($this->trans('errors.register.invalid', array('name' => get_class($xPlugin))));
274 272
         }
@@ -403,8 +401,7 @@  discard block
 block discarded – undo
403 401
             {
404 402
                 $this->xAutoloader->setPsr4($sNamespace . '\\', $sDirectory);
405 403
             }
406
-        }
407
-        else if(($this->xAutoloader))
404
+        } else if(($this->xAutoloader))
408 405
         {
409 406
             // If there is an autoloader, register the dir with classmap autoloading
410 407
             $itDir = new RecursiveDirectoryIterator($sDirectory);
@@ -541,8 +538,7 @@  discard block
 block discarded – undo
541 538
             {
542 539
                 $sClassFile = $aClassDir['directory'] . DIRECTORY_SEPARATOR . substr($sClassFile, $nLen);
543 540
                 $bRegister = true;
544
-            }
545
-            else if(!($sNamespace))
541
+            } else if(!($sNamespace))
546 542
             {
547 543
                 $sClassFile = $aClassDir['directory'] . DIRECTORY_SEPARATOR . $sClassFile;
548 544
                 $bRegister = true;
@@ -851,8 +847,7 @@  discard block
 block discarded – undo
851 847
                 'sJsOptions' => $this->getOption('js.app.options'),
852 848
                 'sUrl' => $sJsAppURI . $sOutFile,
853 849
             ));
854
-        }
855
-        else
850
+        } else
856 851
         {
857 852
             // The plugins scripts are wrapped with javascript tags
858 853
             $sScript = $this->render('jaxon::plugins/wrapper.js', array(
Please login to merge, or discard this patch.
src/Request/Manager.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
      *
153 153
      * @param string        $sArg                The Jaxon request argument
154 154
      *
155
-     * @return mixed
155
+     * @return string|null
156 156
      */
157 157
     private function __argumentDecode(&$sArg)
158 158
     {
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
         $this->aArgs = array();
56 56
         $this->nMethod = Jaxon::METHOD_UNKNOWN;
57 57
         
58
-        if(isset($_POST['jxnargs']))
58
+        if (isset($_POST['jxnargs']))
59 59
         {
60 60
             $this->nMethod = Jaxon::METHOD_POST;
61 61
             $this->aArgs = $_POST['jxnargs'];
62 62
         }
63
-        else if(isset($_GET['jxnargs']))
63
+        else if (isset($_GET['jxnargs']))
64 64
         {
65 65
             $this->nMethod = Jaxon::METHOD_GET;
66 66
             $this->aArgs = $_GET['jxnargs'];
67 67
         }
68
-        if(get_magic_quotes_gpc() == 1)
68
+        if (get_magic_quotes_gpc() == 1)
69 69
         {
70 70
             array_walk($this->aArgs, array(&$this, '__argumentStripSlashes'));
71 71
         }
@@ -81,17 +81,17 @@  discard block
 block discarded – undo
81 81
      */
82 82
     private function __convertStringToBool($sValue)
83 83
     {
84
-        if(strcasecmp($sValue, 'true') == 0)
84
+        if (strcasecmp($sValue, 'true') == 0)
85 85
         {
86 86
             return true;
87 87
         }
88
-        if(strcasecmp($sValue, 'false') == 0)
88
+        if (strcasecmp($sValue, 'false') == 0)
89 89
         {
90 90
             return false;
91 91
         }
92
-        if(is_numeric($sValue))
92
+        if (is_numeric($sValue))
93 93
         {
94
-            if($sValue == 0)
94
+            if ($sValue == 0)
95 95
             {
96 96
                 return false;
97 97
             }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     private function __argumentStripSlashes(&$sArg)
111 111
     {
112
-        if(!is_string($sArg))
112
+        if (!is_string($sArg))
113 113
         {
114 114
             return '';
115 115
         }
@@ -156,14 +156,14 @@  discard block
 block discarded – undo
156 156
      */
157 157
     private function __argumentDecode(&$sArg)
158 158
     {
159
-        if($sArg == '')
159
+        if ($sArg == '')
160 160
         {
161 161
             return '';
162 162
         }
163 163
 
164 164
         $data = json_decode($sArg, true);
165 165
 
166
-        if($data !== null && $sArg != $data)
166
+        if ($data !== null && $sArg != $data)
167 167
         {
168 168
             $sArg = $data;
169 169
         }
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
      */
183 183
     private function __argumentDecodeUTF8_iconv(&$mArg)
184 184
     {
185
-        if(is_array($mArg))
185
+        if (is_array($mArg))
186 186
         {
187
-            foreach($mArg as $sKey => $xArg)
187
+            foreach ($mArg as $sKey => $xArg)
188 188
             {
189 189
                 $sNewKey = $sKey;
190 190
                 $this->__argumentDecodeUTF8_iconv($sNewKey);
191
-                if($sNewKey != $sKey)
191
+                if ($sNewKey != $sKey)
192 192
                 {
193 193
                     $mArg[$sNewKey] = $xArg;
194 194
                     unset($mArg[$sKey]);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 $this->__argumentDecodeUTF8_iconv($xArg);
198 198
             }
199 199
         }
200
-        else if(is_string($mArg))
200
+        else if (is_string($mArg))
201 201
         {
202 202
             $mArg = iconv("UTF-8", $this->getOption('core.encoding') . '//TRANSLIT', $mArg);
203 203
         }
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
      */
213 213
     private function __argumentDecodeUTF8_mb_convert_encoding(&$mArg)
214 214
     {
215
-        if(is_array($mArg))
215
+        if (is_array($mArg))
216 216
         {
217
-            foreach($mArg as $sKey => $xArg)
217
+            foreach ($mArg as $sKey => $xArg)
218 218
             {
219 219
                 $sNewKey = $sKey;
220 220
                 $this->__argumentDecodeUTF8_mb_convert_encoding($sNewKey);
221
-                if($sNewKey != $sKey)
221
+                if ($sNewKey != $sKey)
222 222
                 {
223 223
                     $mArg[$sNewKey] = $xArg;
224 224
                     unset($mArg[$sKey]);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 $this->__argumentDecodeUTF8_mb_convert_encoding($xArg);
228 228
             }
229 229
         }
230
-        else if(is_string($mArg))
230
+        else if (is_string($mArg))
231 231
         {
232 232
             $mArg = mb_convert_encoding($mArg, $this->getOption('core.encoding'), "UTF-8");
233 233
         }
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
      */
243 243
     private function __argumentDecodeUTF8_utf8_decode(&$mArg)
244 244
     {
245
-        if(is_array($mArg))
245
+        if (is_array($mArg))
246 246
         {
247
-            foreach($mArg as $sKey => $xArg)
247
+            foreach ($mArg as $sKey => $xArg)
248 248
             {
249 249
                 $sNewKey = $sKey;
250 250
                 $this->__argumentDecodeUTF8_utf8_decode($sNewKey);
251 251
                 
252
-                if($sNewKey != $sKey)
252
+                if ($sNewKey != $sKey)
253 253
                 {
254 254
                     $mArg[$sNewKey] = $xArg;
255 255
                     unset($mArg[$sKey]);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                 $this->__argumentDecodeUTF8_utf8_decode($xArg);
260 260
             }
261 261
         }
262
-        else if(is_string($mArg))
262
+        else if (is_string($mArg))
263 263
         {
264 264
             $mArg = utf8_decode($mArg);
265 265
         }
@@ -284,19 +284,19 @@  discard block
 block discarded – undo
284 284
      */
285 285
     public function process()
286 286
     {
287
-        if(($this->getOption('core.decode_utf8')))
287
+        if (($this->getOption('core.decode_utf8')))
288 288
         {
289 289
             $sFunction = '';
290 290
             
291
-            if(function_exists('iconv'))
291
+            if (function_exists('iconv'))
292 292
             {
293 293
                 $sFunction = "iconv";
294 294
             }
295
-            else if(function_exists('mb_convert_encoding'))
295
+            else if (function_exists('mb_convert_encoding'))
296 296
             {
297 297
                 $sFunction = "mb_convert_encoding";
298 298
             }
299
-            else if($this->getOption('core.encoding') == "ISO-8859-1")
299
+            else if ($this->getOption('core.encoding') == "ISO-8859-1")
300 300
             {
301 301
                 $sFunction = "utf8_decode";
302 302
             }
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
         {
60 60
             $this->nMethod = Jaxon::METHOD_POST;
61 61
             $this->aArgs = $_POST['jxnargs'];
62
-        }
63
-        else if(isset($_GET['jxnargs']))
62
+        } else if(isset($_GET['jxnargs']))
64 63
         {
65 64
             $this->nMethod = Jaxon::METHOD_GET;
66 65
             $this->aArgs = $_GET['jxnargs'];
@@ -166,8 +165,7 @@  discard block
 block discarded – undo
166 165
         if($data !== null && $sArg != $data)
167 166
         {
168 167
             $sArg = $data;
169
-        }
170
-        else
168
+        } else
171 169
         {
172 170
             $sArg = $this->__convertValue($sArg);
173 171
         }
@@ -196,8 +194,7 @@  discard block
 block discarded – undo
196 194
                 }
197 195
                 $this->__argumentDecodeUTF8_iconv($xArg);
198 196
             }
199
-        }
200
-        else if(is_string($mArg))
197
+        } else if(is_string($mArg))
201 198
         {
202 199
             $mArg = iconv("UTF-8", $this->getOption('core.encoding') . '//TRANSLIT', $mArg);
203 200
         }
@@ -226,8 +223,7 @@  discard block
 block discarded – undo
226 223
                 }
227 224
                 $this->__argumentDecodeUTF8_mb_convert_encoding($xArg);
228 225
             }
229
-        }
230
-        else if(is_string($mArg))
226
+        } else if(is_string($mArg))
231 227
         {
232 228
             $mArg = mb_convert_encoding($mArg, $this->getOption('core.encoding'), "UTF-8");
233 229
         }
@@ -258,8 +254,7 @@  discard block
 block discarded – undo
258 254
                 
259 255
                 $this->__argumentDecodeUTF8_utf8_decode($xArg);
260 256
             }
261
-        }
262
-        else if(is_string($mArg))
257
+        } else if(is_string($mArg))
263 258
         {
264 259
             $mArg = utf8_decode($mArg);
265 260
         }
@@ -291,16 +286,13 @@  discard block
 block discarded – undo
291 286
             if(function_exists('iconv'))
292 287
             {
293 288
                 $sFunction = "iconv";
294
-            }
295
-            else if(function_exists('mb_convert_encoding'))
289
+            } else if(function_exists('mb_convert_encoding'))
296 290
             {
297 291
                 $sFunction = "mb_convert_encoding";
298
-            }
299
-            else if($this->getOption('core.encoding') == "ISO-8859-1")
292
+            } else if($this->getOption('core.encoding') == "ISO-8859-1")
300 293
             {
301 294
                 $sFunction = "utf8_decode";
302
-            }
303
-            else
295
+            } else
304 296
             {
305 297
                 throw new \Jaxon\Exception\Error($this->trans('errors.request.conversion'));
306 298
             }
Please login to merge, or discard this patch.
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -131,19 +131,19 @@
 block discarded – undo
131 131
         $sValue = substr($sValue, 1);
132 132
         switch ($cType)
133 133
         {
134
-            case 'S':
135
-                $value = ($sValue === false ? '' : $sValue);
136
-                break;
137
-            case 'B':
138
-                $value = $this->__convertStringToBool($sValue);
139
-                break;
140
-            case 'N':
141
-                $value = ($sValue == floor($sValue) ? (int)$sValue : (float)$sValue);
142
-                break;
143
-            case '*':
144
-            default:
145
-                $value = null;
146
-                break;
134
+        case 'S':
135
+            $value = ($sValue === false ? '' : $sValue);
136
+            break;
137
+        case 'B':
138
+            $value = $this->__convertStringToBool($sValue);
139
+            break;
140
+        case 'N':
141
+            $value = ($sValue == floor($sValue) ? (int)$sValue : (float)$sValue);
142
+            break;
143
+        case '*':
144
+        default:
145
+            $value = null;
146
+            break;
147 147
         }
148 148
         return $value;
149 149
     }
Please login to merge, or discard this patch.
src/Request/Plugin/BrowserEvent.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
 namespace Jaxon\Request\Plugin;
24 24
 
25
-use Jaxon\Jaxon;
25
+use Jaxon\Jaxon;
26 26
 use Jaxon\Plugin\Request as RequestPlugin;
27 27
 
28 28
 class BrowserEvent extends RequestPlugin
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -100,8 +100,7 @@  discard block
 block discarded – undo
100 100
                     $this->aEvents[$sEvent] = $xBrowserEvent;
101 101
                     return $xBrowserEvent->generateRequest();
102 102
                 }
103
-            }
104
-            else if($sType == Jaxon::EVENT_HANDLER)
103
+            } else if($sType == Jaxon::EVENT_HANDLER)
105 104
             {
106 105
                 $sEvent = $aArgs[1];
107 106
                 if(isset($this->aEvents[$sEvent]) && isset($aArgs[2]))
@@ -173,8 +172,9 @@  discard block
 block discarded – undo
173 172
      */
174 173
     public function processRequest()
175 174
     {
176
-        if(!$this->canProcessRequest())
177
-            return false;
175
+        if(!$this->canProcessRequest()) {
176
+                    return false;
177
+        }
178 178
 
179 179
         $aArgs = $this->getRequestManager()->process();
180 180
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->sRequestedEvent = NULL;
53 53
 
54
-        if(isset($_GET['jxnevt']))
54
+        if (isset($_GET['jxnevt']))
55 55
         {
56 56
             $this->sRequestedEvent = $_GET['jxnevt'];
57 57
         }
58
-        if(isset($_POST['jxnevt']))
58
+        if (isset($_POST['jxnevt']))
59 59
         {
60 60
             $this->sRequestedEvent = $_POST['jxnevt'];
61 61
         }
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function register($aArgs)
82 82
     {
83
-        if(count($aArgs) > 1)
83
+        if (count($aArgs) > 1)
84 84
         {
85 85
             $sType = $aArgs[0];
86 86
 
87
-            if($sType == Jaxon::BROWSER_EVENT)
87
+            if ($sType == Jaxon::BROWSER_EVENT)
88 88
             {
89 89
                 $sEvent = $aArgs[1];
90
-                if(!isset($this->aEvents[$sEvent]))
90
+                if (!isset($this->aEvents[$sEvent]))
91 91
                 {
92 92
                     $xBrowserEvent = new \Jaxon\Support\BrowserEvent($sEvent);
93
-                    if(count($aArgs) > 2 && is_array($aArgs[2]))
93
+                    if (count($aArgs) > 2 && is_array($aArgs[2]))
94 94
                     {
95
-                        foreach($aArgs[2] as $sKey => $sValue)
95
+                        foreach ($aArgs[2] as $sKey => $sValue)
96 96
                         {
97 97
                             $xBrowserEvent->configure($sKey, $sValue);
98 98
                         }
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
                     return $xBrowserEvent->generateRequest();
102 102
                 }
103 103
             }
104
-            else if($sType == Jaxon::EVENT_HANDLER)
104
+            else if ($sType == Jaxon::EVENT_HANDLER)
105 105
             {
106 106
                 $sEvent = $aArgs[1];
107
-                if(isset($this->aEvents[$sEvent]) && isset($aArgs[2]))
107
+                if (isset($this->aEvents[$sEvent]) && isset($aArgs[2]))
108 108
                 {
109 109
                     $xUserFunction = $aArgs[2];
110
-                    if(!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction))
110
+                    if (!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction))
111 111
                     {
112 112
                         $xUserFunction = new \Jaxon\Request\Support\UserFunction($xUserFunction);
113 113
                     }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     public function generateHash()
130 130
     {
131 131
         $sHash = '';
132
-        foreach($this->aEvents as $xEvent)
132
+        foreach ($this->aEvents as $xEvent)
133 133
         {
134 134
             $sHash .= $xEvent->getName();
135 135
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     public function getScript()
145 145
     {
146 146
         $sCode = '';
147
-        foreach($this->aEvents as $xEvent)
147
+        foreach ($this->aEvents as $xEvent)
148 148
         {
149 149
             $sCode .= $xEvent->getScript();
150 150
         }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     public function canProcessRequest()
160 160
     {
161 161
         // Check the validity of the event name
162
-        if(($this->sRequestedEvent) && !$this->validateEvent($this->sRequestedEvent))
162
+        if (($this->sRequestedEvent) && !$this->validateEvent($this->sRequestedEvent))
163 163
         {
164 164
             $this->sRequestedEvent = null;
165 165
         }
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public function processRequest()
175 175
     {
176
-        if(!$this->canProcessRequest())
176
+        if (!$this->canProcessRequest())
177 177
             return false;
178 178
 
179 179
         $aArgs = $this->getRequestManager()->process();
180 180
 
181
-        if(array_key_exists($this->sRequestedEvent, $this->aEvents))
181
+        if (array_key_exists($this->sRequestedEvent, $this->aEvents))
182 182
         {
183 183
             $this->aEvents[$this->sRequestedEvent]->fire($aArgs);
184 184
             return true;
Please login to merge, or discard this patch.
src/Request/Plugin/CallableObject.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
      *
101 101
      * @param array         $aArgs                An array containing the callable object specification
102 102
      *
103
-     * @return array
103
+     * @return boolean
104 104
      */
105 105
     public function register($aArgs)
106 106
     {
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
 namespace Jaxon\Request\Plugin;
23 23
 
24
-use Jaxon\Jaxon;
24
+use Jaxon\Jaxon;
25 25
 use Jaxon\Plugin\Request as RequestPlugin;
26 26
 
27 27
 class CallableObject extends RequestPlugin
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -130,8 +130,9 @@  discard block
 block discarded – undo
130 130
                     {
131 131
                         foreach($aValue as $sName => $sValue)
132 132
                         {
133
-                            if($sName == 'classpath' && $sValue != '')
134
-                                $this->aClassPaths[] = $sValue;
133
+                            if($sName == 'classpath' && $sValue != '') {
134
+                                                            $this->aClassPaths[] = $sValue;
135
+                            }
135 136
                             $xCallableObject->configure($sKey, $sName, $sValue);
136 137
                         }
137 138
                     }
@@ -226,8 +227,9 @@  discard block
 block discarded – undo
226 227
      */
227 228
     public function processRequest()
228 229
     {
229
-        if(!$this->canProcessRequest())
230
-            return false;
230
+        if(!$this->canProcessRequest()) {
231
+                    return false;
232
+        }
231 233
 
232 234
         $aArgs = $this->getRequestManager()->process();
233 235
 
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
         $this->sRequestedClass = null;
68 68
         $this->sRequestedMethod = null;
69 69
 
70
-        if(!empty($_GET['jxncls']))
70
+        if (!empty($_GET['jxncls']))
71 71
         {
72 72
             $this->sRequestedClass = $_GET['jxncls'];
73 73
         }
74
-        if(!empty($_GET['jxnmthd']))
74
+        if (!empty($_GET['jxnmthd']))
75 75
         {
76 76
             $this->sRequestedMethod = $_GET['jxnmthd'];
77 77
         }
78
-        if(!empty($_POST['jxncls']))
78
+        if (!empty($_POST['jxncls']))
79 79
         {
80 80
             $this->sRequestedClass = $_POST['jxncls'];
81 81
         }
82
-        if(!empty($_POST['jxnmthd']))
82
+        if (!empty($_POST['jxnmthd']))
83 83
         {
84 84
             $this->sRequestedMethod = $_POST['jxnmthd'];
85 85
         }
@@ -104,33 +104,33 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function register($aArgs)
106 106
     {
107
-        if(count($aArgs) > 1)
107
+        if (count($aArgs) > 1)
108 108
         {
109 109
             $sType = $aArgs[0];
110 110
 
111
-            if($sType == Jaxon::CALLABLE_OBJECT)
111
+            if ($sType == Jaxon::CALLABLE_OBJECT)
112 112
             {
113 113
                 $xCallableObject = $aArgs[1];
114 114
 
115
-                if(!is_object($xCallableObject) && !is_string($xCallableObject))
115
+                if (!is_object($xCallableObject) && !is_string($xCallableObject))
116 116
                 {
117 117
                     throw new \Jaxon\Exception\Error($this->trans('errors.objects.instance'));
118 118
                 }
119
-                if(is_string($xCallableObject) && !class_exists($xCallableObject))
119
+                if (is_string($xCallableObject) && !class_exists($xCallableObject))
120 120
                 {
121 121
                     throw new \Jaxon\Exception\Error($this->trans('errors.objects.instance'));
122 122
                 }
123
-                if(!($xCallableObject instanceof \Jaxon\Request\Support\CallableObject))
123
+                if (!($xCallableObject instanceof \Jaxon\Request\Support\CallableObject))
124 124
                 {
125 125
                     $xCallableObject = new \Jaxon\Request\Support\CallableObject($xCallableObject);
126 126
                 }
127
-                if(count($aArgs) > 2 && is_array($aArgs[2]))
127
+                if (count($aArgs) > 2 && is_array($aArgs[2]))
128 128
                 {
129
-                    foreach($aArgs[2] as $sKey => $aValue)
129
+                    foreach ($aArgs[2] as $sKey => $aValue)
130 130
                     {
131
-                        foreach($aValue as $sName => $sValue)
131
+                        foreach ($aValue as $sName => $sValue)
132 132
                         {
133
-                            if($sName == 'classpath' && $sValue != '')
133
+                            if ($sName == 'classpath' && $sValue != '')
134 134
                                 $this->aClassPaths[] = $sValue;
135 135
                             $xCallableObject->configure($sKey, $sName, $sValue);
136 136
                         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     public function generateHash()
154 154
     {
155 155
         $sHash = '';
156
-        foreach($this->aCallableObjects as $xCallableObject)
156
+        foreach ($this->aCallableObjects as $xCallableObject)
157 157
         {
158 158
             $sHash .= $xCallableObject->getName();
159 159
             $sHash .= implode('|', $xCallableObject->getMethods());
@@ -172,15 +172,15 @@  discard block
 block discarded – undo
172 172
         // Generate code for javascript classes declaration
173 173
         $code = '';
174 174
         $classes = array();
175
-        foreach($this->aClassPaths as $sClassPath)
175
+        foreach ($this->aClassPaths as $sClassPath)
176 176
         {
177 177
             $offset = 0;
178 178
             $sClassPath .= '.Null'; // This is a sentinel. The last token is not processed in the while loop.
179
-            while(($dotPosition = strpos($sClassPath, '.', $offset)) !== false)
179
+            while (($dotPosition = strpos($sClassPath, '.', $offset)) !== false)
180 180
             {
181 181
                 $class = substr($sClassPath, 0, $dotPosition);
182 182
                 // Generate code for this class
183
-                if(!array_key_exists($class, $classes))
183
+                if (!array_key_exists($class, $classes))
184 184
                 {
185 185
                     $code .= "$sJaxonPrefix$class = {};\n";
186 186
                     $classes[$class] = $class;
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             }
190 190
         }
191 191
 
192
-        foreach($this->aCallableObjects as $xCallableObject)
192
+        foreach ($this->aCallableObjects as $xCallableObject)
193 193
         {
194 194
             $code .= $xCallableObject->getScript();
195 195
         }
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
     public function canProcessRequest()
205 205
     {
206 206
         // Check the validity of the class name
207
-        if(($this->sRequestedClass) && !$this->validateClass($this->sRequestedClass))
207
+        if (($this->sRequestedClass) && !$this->validateClass($this->sRequestedClass))
208 208
         {
209 209
             $this->sRequestedClass = null;
210 210
             $this->sRequestedMethod = null;
211 211
         }
212 212
         // Check the validity of the method name
213
-        if(($this->sRequestedMethod) && !$this->validateMethod($this->sRequestedMethod))
213
+        if (($this->sRequestedMethod) && !$this->validateMethod($this->sRequestedMethod))
214 214
         {
215 215
             $this->sRequestedClass = null;
216 216
             $this->sRequestedMethod = null;
@@ -225,21 +225,21 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function processRequest()
227 227
     {
228
-        if(!$this->canProcessRequest())
228
+        if (!$this->canProcessRequest())
229 229
             return false;
230 230
 
231 231
         $aArgs = $this->getRequestManager()->process();
232 232
 
233 233
         // Try to register an instance of the requested class, if it isn't yet
234
-        if(!array_key_exists($this->sRequestedClass, $this->aCallableObjects))
234
+        if (!array_key_exists($this->sRequestedClass, $this->aCallableObjects))
235 235
         {
236 236
             $this->getPluginManager()->registerClass($this->sRequestedClass);
237 237
         }
238 238
 
239
-        if(array_key_exists($this->sRequestedClass, $this->aCallableObjects))
239
+        if (array_key_exists($this->sRequestedClass, $this->aCallableObjects))
240 240
         {
241 241
             $xCallableObject = $this->aCallableObjects[$this->sRequestedClass];
242
-            if($xCallableObject->hasMethod($this->sRequestedMethod))
242
+            if ($xCallableObject->hasMethod($this->sRequestedMethod))
243 243
             {
244 244
                 $xCallableObject->call($this->sRequestedMethod, $aArgs);
245 245
                 return true;
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
     public function getRegisteredObject($sClassName = null)
261 261
     {
262 262
         $sClassName = (string)$sClassName;
263
-        if(!$sClassName)
263
+        if (!$sClassName)
264 264
         {
265 265
             $sClassName = $this->sRequestedClass;
266 266
         }
267
-        if(!array_key_exists($sClassName, $this->aCallableObjects))
267
+        if (!array_key_exists($sClassName, $this->aCallableObjects))
268 268
         {
269 269
             return null;
270 270
         }
Please login to merge, or discard this patch.
src/Request/Plugin/UserFunction.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,6 @@
 block discarded – undo
23 23
 
24 24
 use Jaxon\Jaxon;
25 25
 use Jaxon\Plugin\Request as RequestPlugin;
26
-use Jaxon\Request\Manager as RequestManager;
27 26
 
28 27
 class UserFunction extends RequestPlugin
29 28
 {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->sRequestedFunction = null;
53 53
         
54
-        if(isset($_GET['jxnfun']))
54
+        if (isset($_GET['jxnfun']))
55 55
         {
56 56
             $this->sRequestedFunction = $_GET['jxnfun'];
57 57
         }
58
-        if(isset($_POST['jxnfun']))
58
+        if (isset($_POST['jxnfun']))
59 59
         {
60 60
             $this->sRequestedFunction = $_POST['jxnfun'];
61 61
         }
@@ -80,22 +80,22 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function register($aArgs)
82 82
     {
83
-        if(count($aArgs) > 1)
83
+        if (count($aArgs) > 1)
84 84
         {
85 85
             $sType = $aArgs[0];
86 86
 
87
-            if($sType == Jaxon::USER_FUNCTION)
87
+            if ($sType == Jaxon::USER_FUNCTION)
88 88
             {
89 89
                 $xUserFunction = $aArgs[1];
90 90
 
91
-                if(!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction))
91
+                if (!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction))
92 92
                     $xUserFunction = new \Jaxon\Request\Support\UserFunction($xUserFunction);
93 93
 
94
-                if(count($aArgs) > 2)
94
+                if (count($aArgs) > 2)
95 95
                 {
96
-                    if(is_array($aArgs[2]))
96
+                    if (is_array($aArgs[2]))
97 97
                     {
98
-                        foreach($aArgs[2] as $sName => $sValue)
98
+                        foreach ($aArgs[2] as $sName => $sValue)
99 99
                         {
100 100
                             $xUserFunction->configure($sName, $sValue);
101 101
                         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     public function generateHash()
123 123
     {
124 124
         $sHash = '';
125
-        foreach($this->aFunctions as $xFunction)
125
+        foreach ($this->aFunctions as $xFunction)
126 126
         {
127 127
             $sHash .= $xFunction->getName();
128 128
         }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function getScript()
138 138
     {
139 139
         $code = '';
140
-        foreach($this->aFunctions as $xFunction)
140
+        foreach ($this->aFunctions as $xFunction)
141 141
         {
142 142
             $code .= $xFunction->getScript();
143 143
         }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     public function canProcessRequest()
153 153
     {
154 154
         // Check the validity of the function name
155
-        if(($this->sRequestedFunction) && !$this->validateFunction($this->sRequestedFunction))
155
+        if (($this->sRequestedFunction) && !$this->validateFunction($this->sRequestedFunction))
156 156
         {
157 157
             $this->sRequestedFunction = null;
158 158
         }
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function processRequest()
168 168
     {
169
-        if(!$this->canProcessRequest())
169
+        if (!$this->canProcessRequest())
170 170
             return false;
171 171
 
172 172
         $aArgs = $this->getRequestManager()->process();
173 173
 
174
-        if(array_key_exists($this->sRequestedFunction, $this->aFunctions))
174
+        if (array_key_exists($this->sRequestedFunction, $this->aFunctions))
175 175
         {
176 176
             $this->aFunctions[$this->sRequestedFunction]->call($aArgs);
177 177
             return true;
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,8 +88,9 @@  discard block
 block discarded – undo
88 88
             {
89 89
                 $xUserFunction = $aArgs[1];
90 90
 
91
-                if(!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction))
92
-                    $xUserFunction = new \Jaxon\Request\Support\UserFunction($xUserFunction);
91
+                if(!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction)) {
92
+                                    $xUserFunction = new \Jaxon\Request\Support\UserFunction($xUserFunction);
93
+                }
93 94
 
94 95
                 if(count($aArgs) > 2)
95 96
                 {
@@ -99,8 +100,7 @@  discard block
 block discarded – undo
99 100
                         {
100 101
                             $xUserFunction->configure($sName, $sValue);
101 102
                         }
102
-                    }
103
-                    else
103
+                    } else
104 104
                     {
105 105
                         $xUserFunction->configure('include', $aArgs[2]);
106 106
                     }
@@ -166,8 +166,9 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function processRequest()
168 168
     {
169
-        if(!$this->canProcessRequest())
170
-            return false;
169
+        if(!$this->canProcessRequest()) {
170
+                    return false;
171
+        }
171 172
 
172 173
         $aArgs = $this->getRequestManager()->process();
173 174
 
Please login to merge, or discard this patch.
src/Request/Request.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 
21 21
 namespace Jaxon\Request;
22 22
 
23
-use JsonSerializable;
24 23
 use Jaxon\Jaxon;
25 24
 
26 25
 class Request extends JsCall
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function hasPageNumber()
71 71
     {
72
-        foreach($this->aParameters as $xParameter)
72
+        foreach ($this->aParameters as $xParameter)
73 73
         {
74
-            if($xParameter->getType() == Jaxon::PAGE_NUMBER)
74
+            if ($xParameter->getType() == Jaxon::PAGE_NUMBER)
75 75
             {
76 76
                 return true;
77 77
             }
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
     public function setPageNumber($nPageNumber)
90 90
     {
91 91
         // Set the value of the Jaxon::PAGE_NUMBER parameter
92
-        foreach($this->aParameters as $xParameter)
92
+        foreach ($this->aParameters as $xParameter)
93 93
         {
94
-            if($xParameter->getType() == Jaxon::PAGE_NUMBER)
94
+            if ($xParameter->getType() == Jaxon::PAGE_NUMBER)
95 95
             {
96 96
                 $xParameter->setValue(intval($nPageNumber));
97 97
                 break;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $this->sCondition = '__confirm__';
113 113
         $this->aMessageArgs = func_get_args();
114
-        array_walk($this->aMessageArgs, function(&$xParameter){
114
+        array_walk($this->aMessageArgs, function(&$xParameter) {
115 115
             $xParameter = Parameter::make($xParameter);
116 116
         });
117 117
         return $this;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $this->sCondition = Parameter::make($sCondition)->getScript();
133 133
         $this->aMessageArgs = func_get_args();
134 134
         array_shift($this->aMessageArgs); // Remove the first entry (the condition) from the array
135
-        array_walk($this->aMessageArgs, function(&$xParameter){
135
+        array_walk($this->aMessageArgs, function(&$xParameter) {
136 136
             $xParameter = Parameter::make($xParameter);
137 137
         });
138 138
         return $this;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $this->sCondition = '!(' . Parameter::make($sCondition)->getScript() . ')';
154 154
         $this->aMessageArgs = func_get_args();
155 155
         array_shift($this->aMessageArgs); // Remove the first entry (the condition) from the array
156
-        array_walk($this->aMessageArgs, function(&$xParameter){
156
+        array_walk($this->aMessageArgs, function(&$xParameter) {
157 157
             $xParameter = Parameter::make($xParameter);
158 158
         });
159 159
         return $this;
@@ -178,12 +178,12 @@  discard block
 block discarded – undo
178 178
         // This array will avoid declaring many variables with the same value.
179 179
         // The array key is the variable value, while the array value is the variable name.
180 180
         $aVariables = array(); // Array of local variables.
181
-        foreach($this->aParameters as &$xParameter)
181
+        foreach ($this->aParameters as &$xParameter)
182 182
         {
183 183
             $sParameterStr = $xParameter->getScript();
184
-            if($xParameter instanceof \Jaxon\JQuery\Dom\Element)
184
+            if ($xParameter instanceof \Jaxon\JQuery\Dom\Element)
185 185
             {
186
-                if(!array_key_exists($sParameterStr, $aVariables))
186
+                if (!array_key_exists($sParameterStr, $aVariables))
187 187
                 {
188 188
                     // The value is not yet defined. A new variable is created.
189 189
                     $sVarName = "jxnVar$nVarId";
@@ -201,19 +201,19 @@  discard block
 block discarded – undo
201 201
         }
202 202
 
203 203
         $sPhrase = '';
204
-        if(count($this->aMessageArgs) > 0)
204
+        if (count($this->aMessageArgs) > 0)
205 205
         {
206 206
             $sPhrase = array_shift($this->aMessageArgs); // The first array entry is the question.
207 207
             // $sPhrase = "'" . addslashes($sPhrase) . "'"; // Wrap the phrase with single quotes
208
-            if(count($this->aMessageArgs) > 0)
208
+            if (count($this->aMessageArgs) > 0)
209 209
             {
210 210
                 $nParamId = 1;
211
-                foreach($this->aMessageArgs as &$xParameter)
211
+                foreach ($this->aMessageArgs as &$xParameter)
212 212
                 {
213 213
                     $sParameterStr = $xParameter->getScript();
214
-                    if($xParameter instanceof \Jaxon\JQuery\Dom\Element)
214
+                    if ($xParameter instanceof \Jaxon\JQuery\Dom\Element)
215 215
                     {
216
-                        if(!array_key_exists($sParameterStr, $aVariables))
216
+                        if (!array_key_exists($sParameterStr, $aVariables))
217 217
                         {
218 218
                             // The value is not yet defined. A new variable is created.
219 219
                             $sVarName = "jxnVar$nVarId";
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
         }
237 237
 
238 238
         $sScript = $this->getOption('core.prefix.' . $this->sType) . parent::getScript();
239
-        if($this->sCondition == '__confirm__')
239
+        if ($this->sCondition == '__confirm__')
240 240
         {
241 241
             $xConfirm = $this->getPluginManager()->getConfirm();
242 242
             $sScript = $xConfirm->confirm($sPhrase, $sScript, '');
243 243
         }
244
-        else if($this->sCondition !== null)
244
+        else if ($this->sCondition !== null)
245 245
         {
246 246
             $xAlert = $this->getPluginManager()->getAlert();
247 247
             $xAlert->setReturn(true);
248 248
             $sScript = 'if(' . $this->sCondition . '){' . $sScript . ';}';
249
-            if(($sPhrase))
249
+            if (($sPhrase))
250 250
             {
251 251
                 $sScript .= 'else{' . $xAlert->warning($sPhrase) . ';}';
252 252
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -190,8 +190,7 @@  discard block
 block discarded – undo
190 190
                     $aVariables[$sParameterStr] = $sVarName;
191 191
                     $sVars .= "$sVarName=$xParameter;";
192 192
                     $nVarId++;
193
-                }
194
-                else
193
+                } else
195 194
                 {
196 195
                     // The value is already defined. The corresponding variable is assigned.
197 196
                     $sVarName = $aVariables[$sParameterStr];
@@ -220,8 +219,7 @@  discard block
 block discarded – undo
220 219
                             $aVariables[$sParameterStr] = $sVarName;
221 220
                             $sVars .= "$sVarName=$xParameter;";
222 221
                             $nVarId++;
223
-                        }
224
-                        else
222
+                        } else
225 223
                         {
226 224
                             // The value is already defined. The corresponding variable is assigned.
227 225
                             $sVarName = $aVariables[$sParameterStr];
@@ -240,8 +238,7 @@  discard block
 block discarded – undo
240 238
         {
241 239
             $xConfirm = $this->getPluginManager()->getConfirm();
242 240
             $sScript = $xConfirm->confirm($sPhrase, $sScript, '');
243
-        }
244
-        else if($this->sCondition !== null)
241
+        } else if($this->sCondition !== null)
245 242
         {
246 243
             $xAlert = $this->getPluginManager()->getAlert();
247 244
             $xAlert->setReturn(true);
Please login to merge, or discard this patch.
src/Request/Support/UserFunction.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@
 block discarded – undo
158 158
     /**
159 159
      * Constructs and returns a <Jaxon\Request\Request> object which is capable of generating the javascript call to invoke this jaxon enabled function
160 160
      *
161
-     * @return Jaxon\Request\Request
161
+     * @return Request
162 162
      */
163 163
     public function generateRequest()
164 164
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $this->aConfiguration = array();
92 92
         $this->sAlias = '';
93
-        if(is_array($sUserFunction))
93
+        if (is_array($sUserFunction))
94 94
         {
95
-            if(count($sUserFunction) != 2 && count($sUserFunction) != 3)
95
+            if (count($sUserFunction) != 2 && count($sUserFunction) != 3)
96 96
             {
97 97
                 throw new \Jaxon\Exception\Error($this->trans('errors.functions.invalid-declaration'));
98 98
             }
99
-            if(count($sUserFunction) == 3)
99
+            if (count($sUserFunction) == 3)
100 100
             {
101 101
                 $this->sAlias = $sUserFunction[0];
102 102
                 $this->sUserFunction = array_slice($sUserFunction, 1);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 $this->sUserFunction = $sUserFunction;
107 107
             }
108 108
         }
109
-        else if(is_string($sUserFunction))
109
+        else if (is_string($sUserFunction))
110 110
         {
111 111
             $this->sUserFunction = $sUserFunction;
112 112
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     public function getName()
125 125
     {
126 126
         // Do not use sAlias here!
127
-        if(is_array($this->sUserFunction))
127
+        if (is_array($this->sUserFunction))
128 128
         {
129 129
             return $this->sUserFunction[1];
130 130
         }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function configure($sName, $sValue)
143 143
     {
144
-        switch($sName)
144
+        switch ($sName)
145 145
         {
146 146
         case 'alias':
147 147
             $this->sAlias = $sValue;
@@ -195,12 +195,12 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function call($aArgs = array())
197 197
     {
198
-        if(($this->sInclude))
198
+        if (($this->sInclude))
199 199
         {
200 200
             ob_start();
201 201
             require_once $this->sInclude;
202 202
             $sOutput = ob_get_clean();
203
-            if(($sOutput))
203
+            if (($sOutput))
204 204
             {
205 205
                 $sOutput = $this->trans('debug.function.include', array(
206 206
                     'file' => $this->sInclude,
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,17 +100,14 @@
 block discarded – undo
100 100
             {
101 101
                 $this->sAlias = $sUserFunction[0];
102 102
                 $this->sUserFunction = array_slice($sUserFunction, 1);
103
-            }
104
-            else
103
+            } else
105 104
             {
106 105
                 $this->sUserFunction = $sUserFunction;
107 106
             }
108
-        }
109
-        else if(is_string($sUserFunction))
107
+        } else if(is_string($sUserFunction))
110 108
         {
111 109
             $this->sUserFunction = $sUserFunction;
112
-        }
113
-        else
110
+        } else
114 111
         {
115 112
             throw new \Jaxon\Exception\Error($this->trans('errors.functions.invalid-declaration'));
116 113
         }
Please login to merge, or discard this patch.
src/Request/Traits/Factory.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,6 @@  discard block
 block discarded – undo
89 89
      * Return the javascript call to an Jaxon object method
90 90
      *
91 91
      * @param string         $sMethod           The method (without class) name
92
-     * @param ...            $xParams           The parameters of the method
93 92
      *
94 93
      * @return object
95 94
      */
@@ -110,7 +109,6 @@  discard block
 block discarded – undo
110 109
      * @param integer $nItemsPerPage the number of items per page
111 110
      * @param integer $nCurrentPage the current page
112 111
      * @param string  $sMethod the name of the method
113
-     * @param ... $parameters the parameters of the method
114 112
      *
115 113
      * @return string the pagination links
116 114
      */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function getJaxonClassName()
46 46
     {
47
-        if(!$this->xJaxonCallable)
47
+        if (!$this->xJaxonCallable)
48 48
         {
49 49
             // Make the Jaxon class name for a class without an associated callable
50 50
             // !! Warning !! This can happen only if this object is not registered with the Jaxon libary
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function getJaxonNamespace()
64 64
     {
65
-        if(!$this->xJaxonCallable)
65
+        if (!$this->xJaxonCallable)
66 66
         {
67 67
             // Return an empty string.
68 68
             return '';
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function getJaxonClassPath()
79 79
     {
80
-        if(!$this->xJaxonCallable)
80
+        if (!$this->xJaxonCallable)
81 81
         {
82 82
             // Return an empty string.
83 83
             return '';
Please login to merge, or discard this patch.