Passed
Push — master ( 593da9...7cea35 )
by Laurent
01:55
created
programs/app.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2018 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once dirname(__FILE__) . '/define.php';
25
-require_once dirname(__FILE__) . '/functions.php';
24
+require_once dirname(__FILE__).'/define.php';
25
+require_once dirname(__FILE__).'/functions.php';
26 26
 
27 27
 
28 28
 
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
         $this->addonName = 'libapp';
56 56
         $this->addonPrefix = 'app';
57 57
 
58
-        $this->classPrefix = $this->addonPrefix . '_';
59
-        $this->controllerTg = 'addon/' . $this->addonName . '/main';
58
+        $this->classPrefix = $this->addonPrefix.'_';
59
+        $this->controllerTg = 'addon/'.$this->addonName.'/main';
60 60
 
61 61
         $addon = bab_getAddonInfosInstance($this->addonName);
62 62
         $this->phpPath = $addon->getPhpPath();
63 63
         $this->recordSetPath = $this->phpPath;
64 64
         $this->ctrlPath = $this->phpPath;
65
-        $this->uiPath = $this->phpPath . 'ui/';
65
+        $this->uiPath = $this->phpPath.'ui/';
66 66
 
67 67
         $babDB = bab_getDB();
68 68
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
     public function getRecordSetPathname($class)
110 110
     {
111 111
         // $App->MyRecordSet() -> myrecord.class.php
112
-        $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php';
113
-        return $this->recordSetPath . $file;
112
+        $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php';
113
+        return $this->recordSetPath.$file;
114 114
     }
115 115
 
116 116
     /**
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
     public function getRecordPathname($class)
123 123
     {
124 124
         // $App->MyRecord() -> myrecord.class.php
125
-        $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php';
126
-        return $this->recordSetPath . $file;
125
+        $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php';
126
+        return $this->recordSetPath.$file;
127 127
     }
128 128
 
129 129
     /**
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
             if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') {
229 229
                 $incl = $method;
230
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
230
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
231 231
 
232 232
 
233 233
                 $classname = $this->$classNameMethod();
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                                 // We need to revert to multilang fields before synchronizing.
250 250
                                 $set->useLang(false);
251 251
                             }
252
-                            $sql .= $mysqlbackend->setToSql($set) . "\n";
252
+                            $sql .= $mysqlbackend->setToSql($set)."\n";
253 253
                         }
254 254
                     }
255 255
                 }
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
             if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') {
282 282
                 $incl = $method;
283
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
283
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
284 284
 
285 285
                 $classname = $this->$classNameMethod();
286 286
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
                             if (class_exists($classname) && method_exists($this, $call)) {
296 296
                                 $set = $this->$call();
297
-                                $sql .= $mysqlbackend->setToSql($set) . "\n";
297
+                                $sql .= $mysqlbackend->setToSql($set)."\n";
298 298
                             }
299 299
                         }
300 300
                     }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
     public function includeBase()
310 310
     {
311
-        require_once APP_PHP_PATH . 'base.class.php';
311
+        require_once APP_PHP_PATH.'base.class.php';
312 312
     }
313 313
 
314 314
     /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     public function includeRecordSet()
318 318
     {
319
-        require_once APP_SET_PATH . 'record.class.php';
319
+        require_once APP_SET_PATH.'record.class.php';
320 320
     }
321 321
 
322 322
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
      */
326 326
     public function includeTraceableRecordSet()
327 327
     {
328
-        require_once APP_SET_PATH . 'traceablerecord.class.php';
328
+        require_once APP_SET_PATH.'traceablerecord.class.php';
329 329
     }
330 330
 
331 331
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     public function includeLinkSet()
339 339
     {
340
-        require_once APP_SET_PATH . 'link.class.php';
340
+        require_once APP_SET_PATH.'link.class.php';
341 341
     }
342 342
 
343 343
     /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
      */
354 354
     public function LinkSetClassName()
355 355
     {
356
-        return $this->LinkClassName() . 'Set';
356
+        return $this->LinkClassName().'Set';
357 357
     }
358 358
 
359 359
     /**
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             return null;
388 388
         }
389 389
         list($classname, $id) = $refParts;
390
-        $classSet = $classname . 'Set';
390
+        $classSet = $classname.'Set';
391 391
         $set = $this->$classSet();
392 392
         if (isset($set)) {
393 393
             return $set->get($id);
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     {
407 407
         $fullClassName = get_class($record);
408 408
         list(, $className) = explode('_', $fullClassName);
409
-        return $className . ':' . $record->id;
409
+        return $className.':'.$record->id;
410 410
     }
411 411
 
412 412
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      */
434 434
     public function translate($str, $str_plurals = null, $number = null)
435 435
     {
436
-        require_once APP_PHP_PATH . 'functions.php';
436
+        require_once APP_PHP_PATH.'functions.php';
437 437
         $translation = $str;
438 438
         if ($translate = bab_functionality::get('Translate/Gettext')) {
439 439
             /* @var $translate Func_Translate_Gettext */
@@ -484,16 +484,16 @@  discard block
 block discarded – undo
484 484
      */
485 485
     public function mailTo($addr, $subject = null, $body = null)
486 486
     {
487
-        $mailTo = 'mailto:' . $addr;
487
+        $mailTo = 'mailto:'.$addr;
488 488
         $parameters = array();
489 489
         if (isset($subject)) {
490
-            $parameters[] = 'subject=' . $subject;
490
+            $parameters[] = 'subject='.$subject;
491 491
         }
492 492
         if (isset($body)) {
493
-            $parameters[] = 'body=' . $body;
493
+            $parameters[] = 'body='.$body;
494 494
         }
495 495
         if (!empty($parameters)) {
496
-            $mailTo .= '?' . implode('&', $parameters);
496
+            $mailTo .= '?'.implode('&', $parameters);
497 497
         }
498 498
 
499 499
         return $mailTo;
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
         }
545 545
 
546 546
         $number = number_format($number, $decimals, ',', ' ');
547
-        return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol);
547
+        return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol);
548 548
     }
549 549
 
550 550
 
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
         }
565 565
 
566 566
         if (!isset($format)) {
567
-            $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat());
567
+            $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat());
568 568
         }
569 569
         $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil();
570 570
 
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
      */
586 586
     public function includeController()
587 587
     {
588
-        require_once APP_PHP_PATH . '/controller.class.php';
588
+        require_once APP_PHP_PATH.'/controller.class.php';
589 589
     }
590 590
 
591 591
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
      */
595 595
     public function includeRecordController()
596 596
     {
597
-        require_once APP_CTRL_PATH . '/record.ctrl.php';
597
+        require_once APP_CTRL_PATH.'/record.ctrl.php';
598 598
     }
599 599
 
600 600
 
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
      */
635 635
     public function includeUi()
636 636
     {
637
-        require_once APP_UI_PATH . 'ui.class.php';
637
+        require_once APP_UI_PATH.'ui.class.php';
638 638
     }
639 639
 
640 640
 
@@ -646,14 +646,14 @@  discard block
 block discarded – undo
646 646
     public function Ui()
647 647
     {
648 648
         $this->includeUi();
649
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
649
+        return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this);
650 650
     }
651 651
 
652 652
 
653 653
 
654 654
     protected function includeAccess()
655 655
     {
656
-        require_once WORKSPACE_PHP_PATH . '/access.class.php';
656
+        require_once WORKSPACE_PHP_PATH.'/access.class.php';
657 657
     }
658 658
 
659 659
 
@@ -685,29 +685,29 @@  discard block
 block discarded – undo
685 685
 
686 686
             case substr($name, -strlen('SetClassName')) === 'SetClassName':
687 687
                 $setName = substr($name, 0, strlen($name) - strlen('ClassName'));
688
-                return $this->classPrefix . $setName;
688
+                return $this->classPrefix.$setName;
689 689
 
690 690
             case substr($name, -strlen('ClassName')) === 'ClassName':
691 691
                 $recordName = substr($name, 0, strlen($name) - strlen('ClassName'));
692
-                return $this->classPrefix . $recordName;
692
+                return $this->classPrefix.$recordName;
693 693
 
694 694
             case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set':
695 695
                 $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include')));
696
-                require_once PHP_SET_PATH . $fileNameBase . '.class.php';
696
+                require_once PHP_SET_PATH.$fileNameBase.'.class.php';
697 697
                 return;
698 698
 
699 699
             case substr($name, -strlen('Set')) === 'Set':
700
-                $includeMethod = 'include' . $name;
700
+                $includeMethod = 'include'.$name;
701 701
                 $this->$includeMethod();
702
-                $setClassNameMethod = $name . 'ClassName';
702
+                $setClassNameMethod = $name.'ClassName';
703 703
                 $className = $this->$setClassNameMethod();
704 704
                 $set = new $className($this);
705 705
                 return $set;
706 706
 
707 707
                 //case method_exists($this, $name . 'Set'):
708 708
             default:
709
-                $setName = $name . 'Set';
710
-                $recordClassNameMethod = $name . 'ClassName';
709
+                $setName = $name.'Set';
710
+                $recordClassNameMethod = $name.'ClassName';
711 711
                 $recordClassName = $this->$recordClassNameMethod();
712 712
                 if (isset($arguments[0])) {
713 713
                     if ($arguments[0] instanceof $recordClassName) {
Please login to merge, or discard this patch.