Passed
Push — master ( 6fc9bf...10dc5f )
by Laurent
01:33
created
programs/init.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 
25 25
 
26
-require_once dirname(__FILE__). '/functions.php';
26
+require_once dirname(__FILE__) . '/functions.php';
27 27
 
28 28
 
29 29
 function LibApp_upgrade($sVersionBase, $sVersionIni)
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     $sql .= $backend->setToSql($App->LogSet());
44 44
 
45
-    require_once $GLOBALS['babInstallPath'].'utilit/devtools.php';
45
+    require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php';
46 46
     $synchronize = new bab_synchronizeSql();
47 47
 
48 48
     $synchronize->fromSqlString($sql);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 function LibApp_onDeleteAddon()
55 55
 {
56
-    require_once $GLOBALS['babInstallPath'].'utilit/functionalityincl.php';
56
+    require_once $GLOBALS['babInstallPath'] . 'utilit/functionalityincl.php';
57 57
     $functionalities = new bab_functionalities();
58 58
     $functionalities->unregister('App');
59 59
     return true;
Please login to merge, or discard this patch.
programs/base.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
             }
147 147
             return $returnedValue;
148 148
         } else {
149
-            trigger_error('the method '.$name.' does not exists on '.get_class($this).' and there is no widget defined with the setInheritedItem method');
149
+            trigger_error('the method ' . $name . ' does not exists on ' . get_class($this) . ' and there is no widget defined with the setInheritedItem method');
150 150
         }
151 151
     }
152 152
     
Please login to merge, or discard this patch.
programs/ui/base.ui.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
                 continue;
668 668
             }
669 669
             
670
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
670
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
671 671
             
672 672
             if ($currentColumn + $nbCol > 12) {
673 673
                 $this->addItem($row);
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
             }
723 723
         }
724 724
         
725
-        if ($currentColumn + $nbCol> 0) {
725
+        if ($currentColumn + $nbCol > 0) {
726 726
             $this->addItem($row);
727 727
         }
728 728
     }
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
         $row = $W->Items()->setSizePolicy('row');
995 995
         foreach ($customSections as $customSection) {
996 996
 
997
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
997
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
998 998
 
999 999
             if ($currentColumn + $nbCol > 12) {
1000 1000
                 $this->addItem($row);
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
             }
1047 1047
         }
1048 1048
 
1049
-        if ($currentColumn + $nbCol> 0) {
1049
+        if ($currentColumn + $nbCol > 0) {
1050 1050
             $this->addItem($row);
1051 1051
         }
1052 1052
     }
@@ -1351,11 +1351,11 @@  discard block
 block discarded – undo
1351 1351
 
1352 1352
         foreach ($columns as $fieldName => $column) {
1353 1353
             $field = $column->getField();
1354
-            if (! $column->isSearchable()) {
1354
+            if (!$column->isSearchable()) {
1355 1355
                 continue;
1356 1356
             }
1357 1357
 
1358
-            if (! ($field instanceof ORM_Field)) {
1358
+            if (!($field instanceof ORM_Field)) {
1359 1359
                 $field = null;
1360 1360
             }
1361 1361
 
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
         }
1386 1386
 
1387 1387
 
1388
-        if (! $this->submit) {
1388
+        if (!$this->submit) {
1389 1389
             $this->submit = $W->SubmitButton();
1390 1390
             $this->submit->setLabel(widget_translate('Filter'));
1391 1391
         }
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
                 continue;
1810 1810
             }
1811 1811
             
1812
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
1812
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
1813 1813
             
1814 1814
             if ($currentColumn + $nbCol > 12) {
1815 1815
                 $this->addItem($row);
@@ -1880,7 +1880,7 @@  discard block
 block discarded – undo
1880 1880
             }
1881 1881
         }
1882 1882
         
1883
-        if ($currentColumn + $nbCol> 0) {
1883
+        if ($currentColumn + $nbCol > 0) {
1884 1884
             $this->addItem($row);
1885 1885
         }
1886 1886
     }
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
         
1995 1995
         $displayable = $field->output($value);
1996 1996
         
1997
-        switch(true) {
1997
+        switch (true) {
1998 1998
             case ($field instanceof ORM_TextField):
1999 1999
                 $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P);
2000 2000
                 break;
@@ -2004,7 +2004,7 @@  discard block
 block discarded – undo
2004 2004
                 break;
2005 2005
                 
2006 2006
             case ($field instanceof ORM_EmailField):
2007
-                $displayable = $W->Link($displayable, 'mailto:'.$displayable);
2007
+                $displayable = $W->Link($displayable, 'mailto:' . $displayable);
2008 2008
                 break;
2009 2009
                 
2010 2010
             case ($field instanceof ORM_FkField):
Please login to merge, or discard this patch.
programs/ui/page.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
             // all widget have static id to not change id of others widgets in page
288 288
 
289
-            $infoMessages =  $_SESSION['app_msginfo'];
289
+            $infoMessages = $_SESSION['app_msginfo'];
290 290
             foreach ($infoMessages as $infoLine) {
291 291
                 $this->App()->Controller()->addMessage($infoLine);
292 292
             }
@@ -304,6 +304,6 @@  discard block
 block discarded – undo
304 304
          * @see	app.jquery.js#window.babAddonLibApp.numberFormat
305 305
          */
306 306
         $this->setMetadata('numberFormatSeparator', mb_substr($str, 1, 1));
307
-        $this->setMetadata('numberFormatPrecision', mb_strlen($str) -2);
307
+        $this->setMetadata('numberFormatPrecision', mb_strlen($str) - 2);
308 308
     }
309 309
 }
Please login to merge, or discard this patch.
programs/app.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public static function register()
127 127
     {
128
-        require_once $GLOBALS['babInstallPath'].'utilit/functionalityincl.php';
128
+        require_once $GLOBALS['babInstallPath'] . 'utilit/functionalityincl.php';
129 129
         $functionalities = new bab_functionalities();
130 130
 
131 131
         $addon = bab_getAddonInfosInstance('libapp');
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             return null;
150 150
         }
151 151
 
152
-        require_once $GLOBALS['babInstallPath'].'utilit/devtools.php';
152
+        require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php';
153 153
         $mysqlbackend = new ORM_MySqlBackend($GLOBALS['babDB']);
154 154
         $sql = 'SET FOREIGN_KEY_CHECKS=0;
155 155
             ';
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             }
188 188
         }
189 189
 
190
-        require_once $GLOBALS['babInstallPath'].'utilit/devtools.php';
190
+        require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php';
191 191
         $synchronize = new bab_synchronizeSql();
192 192
 
193 193
         $synchronize->fromSqlString($sql);
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             return null;
204 204
         }
205 205
 
206
-        require_once $GLOBALS['babInstallPath'].'utilit/devtools.php';
206
+        require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php';
207 207
         $mysqlbackend = new ORM_MySqlBackend($GLOBALS['babDB']);
208 208
         $sql = '';
209 209
 
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
     public function Controller()
695 695
     {
696 696
         $this->includeController();
697
-        return bab_getInstance($this->classPrefix.'Controller')->setApp($this);
697
+        return bab_getInstance($this->classPrefix . 'Controller')->setApp($this);
698 698
     }
699 699
 
700 700
 
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
     public function Ui()
735 735
     {
736 736
         $this->includeUi();
737
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
737
+        return bab_getInstance($this->classPrefix . 'Ui'); //->setApp($this);
738 738
     }
739 739
 
740 740
 
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
      */
757 757
     public function getUploadPath()
758 758
     {
759
-        require_once $GLOBALS['babInstallPath'].'utilit/path.class.php';
759
+        require_once $GLOBALS['babInstallPath'] . 'utilit/path.class.php';
760 760
         return new bab_Path(bab_getAddonInfosInstance($this->getAddonName())->getUploadPath());
761 761
     }
762 762
 
Please login to merge, or discard this patch.
programs/record.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $setName = $fkField->getForeignSetName();
99 99
 
100 100
         if (!$setName || 'Set' === $setName) {
101
-            throw new Exception('The set name is missing on foreign key field '.$fkFieldName);
101
+            throw new Exception('The set name is missing on foreign key field ' . $fkFieldName);
102 102
         }
103 103
 
104 104
         list($prefix, $appSetName) = $this->extractSetPrefixAndName($setName);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     {
176 176
         $App = $this->App();
177 177
 
178
-        $customFieldSet= $App->CustomFieldSet();
178
+        $customFieldSet = $App->CustomFieldSet();
179 179
         $object = mb_substr(get_class($this), mb_strlen($App->classPrefix), -mb_strlen('Set'));
180 180
 
181 181
         $customFields = $customFieldSet->select($customFieldSet->object->is($object));
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function isReadable()
264 264
     {
265
-        bab_debug('The query in '.get_class($this).' use the default isReadable() method: none()');
265
+        bab_debug('The query in ' . get_class($this) . ' use the default isReadable() method: none()');
266 266
         return $this->none();
267 267
     }
268 268
 
@@ -650,13 +650,13 @@  discard block
 block discarded – undo
650 650
      */
651 651
     protected function importDate($name, $value)
652 652
     {
653
-        if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/',$value)) {
653
+        if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $value)) {
654 654
             return $this->importProperty($name, $value);
655 655
         }
656 656
 
657 657
         // try in DD/MM/YYYY format
658 658
 
659
-        if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/',$value, $matches)) {
659
+        if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/', $value, $matches)) {
660 660
 
661 661
             $value = sprintf('%04d-%02d-%02d', (int) $matches['year'], (int) $matches['month'], (int) $matches['day']);
662 662
 
Please login to merge, or discard this patch.
programs/customsection.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@
 block discarded – undo
337 337
             if (empty($rawField)) {
338 338
                 continue;
339 339
             }
340
-            list($fieldName, ) = explode(':', $rawField);
340
+            list($fieldName,) = explode(':', $rawField);
341 341
 
342 342
             if ($removedFieldName == $fieldName) {
343 343
                 continue;
Please login to merge, or discard this patch.
programs/record.ctrl.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             if ($showLabel) {
104 104
                 $text = $actions->getTitle();
105 105
             }
106
-            $html = '<li><a class="icon ' . $actions->getIcon() .  '"href="' . $actions->url() . '">' . $text . '</a></li>';
106
+            $html = '<li><a class="icon ' . $actions->getIcon() . '"href="' . $actions->url() . '">' . $text . '</a></li>';
107 107
         } elseif (is_array($actions)) {
108 108
             if (isset($actions['items'])) {
109 109
                 $items = $actions['items'];
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         $recordClassname = $this->getRecordClassName();
144 144
 
145
-        $viewClassname =  $recordClassname . 'TableView';
145
+        $viewClassname = $recordClassname . 'TableView';
146 146
         if (method_exists($Ui, $viewClassname)) {
147 147
             $types['table'] = array(
148 148
                 'classname' => $viewClassname,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             );
152 152
         }
153 153
 
154
-        $viewClassname =  $recordClassname . 'CardsView';
154
+        $viewClassname = $recordClassname . 'CardsView';
155 155
         if (method_exists($Ui, $viewClassname)) {
156 156
             $types['cards'] = array(
157 157
                 'classname' => $viewClassname,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             );
161 161
         }
162 162
 
163
-        $viewClassname =  $recordClassname . 'MapView';
163
+        $viewClassname = $recordClassname . 'MapView';
164 164
         if (method_exists($Ui, $viewClassname)) {
165 165
             $types['map'] = array(
166 166
                 'classname' => $viewClassname,
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         bab_Sort::asort($availableFields, 'description', bab_Sort::CASE_INSENSITIVE);
257 257
 
258 258
         foreach ($availableFields as $field) {
259
-            $fieldName =  $field['name'];
259
+            $fieldName = $field['name'];
260 260
             $fieldDescription = $field['description'];
261 261
 
262 262
             $used = isset($allViewFieldNames[$fieldName]);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         $nbCol = 0;
451 451
         foreach ($customSections as $customSection) {
452 452
 
453
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
453
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
454 454
 
455 455
 //             if ($currentColumn + $nbCol > 12) {
456 456
 //                 $sectionsSection->addItem($row);
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
                 }
508 508
 
509 509
                 $fieldItem = $W->FlowItems(
510
-                    $W->Label($fieldDescription)->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-80pc' ),
510
+                    $W->Label($fieldDescription)->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-80pc'),
511 511
                     $W->FlowItems(
512 512
                         $W->Hidden()->setName($customSection->id . '.' . $fieldId)->setValue($field['name']),
513 513
                         $W->Link('', $this->proxy()->editDisplayField($customSection->id, $field['name']))
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
                         $W->Link('', $this->proxy()->removeDisplayField($customSection->id, $field['name']))
517 517
                             ->addClass('icon', Func_Icons::ACTIONS_LIST_REMOVE)
518 518
                             ->setAjaxAction()
519
-                    )->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-20pc widget-align-right widget-actions' )
519
+                    )->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-20pc widget-align-right widget-actions')
520 520
                 )->setSizePolicy('widget-list-element  widget-actions-target');
521 521
 
522 522
                 $sectionBox->addItem($fieldItem);
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
         }
590 590
 
591 591
         header('Content-type: application/json');
592
-        header('Content-Disposition: attachment; filename="' . $objectName . '.' . ($view === '' ? 'default' : $view) . '.json"'."\n");
592
+        header('Content-Disposition: attachment; filename="' . $objectName . '.' . ($view === '' ? 'default' : $view) . '.json"' . "\n");
593 593
 
594 594
         $json = bab_json_encode($sectionsValues);
595 595
         $json = bab_convertStringFromDatabase($json, bab_charset::UTF_8);
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
         $recordSet = $this->getEditRecordSet();
834 834
 
835 835
         $recordClassname = $this->getRecordClassName();
836
-        $editorClassname =  $recordClassname . 'SectionEditor';
836
+        $editorClassname = $recordClassname . 'SectionEditor';
837 837
         /* @var $editor app_RecordEditor */
838 838
         $editor = $Ui->$editorClassname();
839 839
         if (!isset($itemId)) {
@@ -914,16 +914,16 @@  discard block
 block discarded – undo
914 914
 
915 915
         switch ($type) {
916 916
             case 'cards':
917
-                $tableviewClassname =  $recordClassname . 'CardsView';
917
+                $tableviewClassname = $recordClassname . 'CardsView';
918 918
                 break;
919 919
 
920 920
             case 'map':
921
-                $tableviewClassname =  $recordClassname . 'MapView';
921
+                $tableviewClassname = $recordClassname . 'MapView';
922 922
                 break;
923 923
 
924 924
             case 'table':
925 925
             default:
926
-                $tableviewClassname =  $recordClassname . 'TableView';
926
+                $tableviewClassname = $recordClassname . 'TableView';
927 927
                 break;
928 928
         }
929 929
 
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
         $Ui = $App->Ui();
990 990
 
991 991
         $recordClassname = $this->getRecordClassName();
992
-        $editorClassname =  $recordClassname . 'Editor';
992
+        $editorClassname = $recordClassname . 'Editor';
993 993
         $editor = $Ui->$editorClassname();
994 994
         if (!isset($itemId)) {
995 995
             $itemId = $this->getClass() . '.' . __FUNCTION__;
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
                     $W->Link(
1038 1038
                         '',
1039 1039
                         $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)
1040
-                    )->addClass('icon', $viewType['icon'] . ($filteredViewType=== $viewTypeId ? ' active' : ''))
1040
+                    )->addClass('icon', $viewType['icon'] . ($filteredViewType === $viewTypeId ? ' active' : ''))
1041 1041
 //                    ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : ''))
1042 1042
                     ->setTitle($viewType['label'])
1043 1043
                     ->setAjaxAction()
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
         $Ui = $App->Ui();
1308 1308
 
1309 1309
         $recordClassname = $this->getRecordClassName();
1310
-        $fullFrameClassname =  $recordClassname . 'FullFrame';
1310
+        $fullFrameClassname = $recordClassname . 'FullFrame';
1311 1311
         $fullFrame = $Ui->$fullFrameClassname($record, $view);
1312 1312
 
1313 1313
 
Please login to merge, or discard this patch.
programs/customsection.ctrl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
         $box = $W->VBoxItems();
73 73
 
74 74
         foreach ($availableFields as $field) {
75
-            $fieldName =  $field['name'];
75
+            $fieldName = $field['name'];
76 76
             $fieldDescription = $field['description'];
77 77
             if (substr($fieldName, 0, 1) !== '_') {
78 78
                 $fieldDescription = $App->translate($fieldDescription);
Please login to merge, or discard this patch.