Passed
Push — master ( 7cea35...9f4668 )
by Laurent
01:50
created
programs/app.php 1 patch
Spacing   +41 added lines, -41 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
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
      */
342 342
     public function includeLogSet()
343 343
     {
344
-        require_once APP_SET_PATH . 'log.class.php';
344
+        require_once APP_SET_PATH.'log.class.php';
345 345
     }
346 346
 
347 347
     /**
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public function LogSetClassName()
359 359
     {
360
-        return $this->LogClassName() . 'Set';
360
+        return $this->LogClassName().'Set';
361 361
     }
362 362
 
363 363
     /**
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      */
380 380
     public function includeLinkSet()
381 381
     {
382
-        require_once APP_SET_PATH . 'link.class.php';
382
+        require_once APP_SET_PATH.'link.class.php';
383 383
     }
384 384
 
385 385
     /**
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
      */
396 396
     public function LinkSetClassName()
397 397
     {
398
-        return $this->LinkClassName() . 'Set';
398
+        return $this->LinkClassName().'Set';
399 399
     }
400 400
 
401 401
     /**
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
             return null;
430 430
         }
431 431
         list($classname, $id) = $refParts;
432
-        $classSet = $classname . 'Set';
432
+        $classSet = $classname.'Set';
433 433
         $set = $this->$classSet();
434 434
         if (isset($set)) {
435 435
             return $set->get($id);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     {
449 449
         $fullClassName = get_class($record);
450 450
         list(, $className) = explode('_', $fullClassName);
451
-        return $className . ':' . $record->id;
451
+        return $className.':'.$record->id;
452 452
     }
453 453
 
454 454
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
      */
476 476
     public function translate($str, $str_plurals = null, $number = null)
477 477
     {
478
-        require_once APP_PHP_PATH . 'functions.php';
478
+        require_once APP_PHP_PATH.'functions.php';
479 479
         $translation = $str;
480 480
         if ($translate = bab_functionality::get('Translate/Gettext')) {
481 481
             /* @var $translate Func_Translate_Gettext */
@@ -526,16 +526,16 @@  discard block
 block discarded – undo
526 526
      */
527 527
     public function mailTo($addr, $subject = null, $body = null)
528 528
     {
529
-        $mailTo = 'mailto:' . $addr;
529
+        $mailTo = 'mailto:'.$addr;
530 530
         $parameters = array();
531 531
         if (isset($subject)) {
532
-            $parameters[] = 'subject=' . $subject;
532
+            $parameters[] = 'subject='.$subject;
533 533
         }
534 534
         if (isset($body)) {
535
-            $parameters[] = 'body=' . $body;
535
+            $parameters[] = 'body='.$body;
536 536
         }
537 537
         if (!empty($parameters)) {
538
-            $mailTo .= '?' . implode('&', $parameters);
538
+            $mailTo .= '?'.implode('&', $parameters);
539 539
         }
540 540
 
541 541
         return $mailTo;
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
         }
587 587
 
588 588
         $number = number_format($number, $decimals, ',', ' ');
589
-        return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol);
589
+        return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol);
590 590
     }
591 591
 
592 592
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
         }
607 607
 
608 608
         if (!isset($format)) {
609
-            $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat());
609
+            $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat());
610 610
         }
611 611
         $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil();
612 612
 
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
      */
628 628
     public function includeController()
629 629
     {
630
-        require_once APP_PHP_PATH . '/controller.class.php';
630
+        require_once APP_PHP_PATH.'/controller.class.php';
631 631
     }
632 632
 
633 633
 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
      */
637 637
     public function includeRecordController()
638 638
     {
639
-        require_once APP_CTRL_PATH . '/record.ctrl.php';
639
+        require_once APP_CTRL_PATH.'/record.ctrl.php';
640 640
     }
641 641
 
642 642
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
      */
677 677
     public function includeUi()
678 678
     {
679
-        require_once APP_UI_PATH . 'ui.class.php';
679
+        require_once APP_UI_PATH.'ui.class.php';
680 680
     }
681 681
 
682 682
 
@@ -688,14 +688,14 @@  discard block
 block discarded – undo
688 688
     public function Ui()
689 689
     {
690 690
         $this->includeUi();
691
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
691
+        return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this);
692 692
     }
693 693
 
694 694
 
695 695
 
696 696
     protected function includeAccess()
697 697
     {
698
-        require_once WORKSPACE_PHP_PATH . '/access.class.php';
698
+        require_once WORKSPACE_PHP_PATH.'/access.class.php';
699 699
     }
700 700
 
701 701
 
@@ -727,29 +727,29 @@  discard block
 block discarded – undo
727 727
 
728 728
             case substr($name, -strlen('SetClassName')) === 'SetClassName':
729 729
                 $setName = substr($name, 0, strlen($name) - strlen('ClassName'));
730
-                return $this->classPrefix . $setName;
730
+                return $this->classPrefix.$setName;
731 731
 
732 732
             case substr($name, -strlen('ClassName')) === 'ClassName':
733 733
                 $recordName = substr($name, 0, strlen($name) - strlen('ClassName'));
734
-                return $this->classPrefix . $recordName;
734
+                return $this->classPrefix.$recordName;
735 735
 
736 736
             case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set':
737 737
                 $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include')));
738
-                require_once PHP_SET_PATH . $fileNameBase . '.class.php';
738
+                require_once PHP_SET_PATH.$fileNameBase.'.class.php';
739 739
                 return;
740 740
 
741 741
             case substr($name, -strlen('Set')) === 'Set':
742
-                $includeMethod = 'include' . $name;
742
+                $includeMethod = 'include'.$name;
743 743
                 $this->$includeMethod();
744
-                $setClassNameMethod = $name . 'ClassName';
744
+                $setClassNameMethod = $name.'ClassName';
745 745
                 $className = $this->$setClassNameMethod();
746 746
                 $set = new $className($this);
747 747
                 return $set;
748 748
 
749 749
                 //case method_exists($this, $name . 'Set'):
750 750
             default:
751
-                $setName = $name . 'Set';
752
-                $recordClassNameMethod = $name . 'ClassName';
751
+                $setName = $name.'Set';
752
+                $recordClassNameMethod = $name.'ClassName';
753 753
                 $recordClassName = $this->$recordClassNameMethod();
754 754
                 if (isset($arguments[0])) {
755 755
                     if ($arguments[0] instanceof $recordClassName) {
Please login to merge, or discard this patch.