Passed
Push — master ( 8d3a6f...fda82f )
by Laurent
01:57
created
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/customfield.ctrl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2008 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once APP_CTRL_PATH . '/record.ctrl.php';
24
+require_once APP_CTRL_PATH.'/record.ctrl.php';
25 25
 
26 26
 /**
27 27
  * This controller manages actions that can be performed on custom fields
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             $W->Link(
40 40
                 $App->translate('Add a custom field'),
41 41
                 $this->proxy()->edit()
42
-            )->addClass('icon',  Func_Icons::ACTIONS_LIST_ADD)
42
+            )->addClass('icon', Func_Icons::ACTIONS_LIST_ADD)
43 43
             ->setOpenMode(Widget_Link::OPEN_DIALOG_AND_RELOAD)
44 44
         );
45 45
 
Please login to merge, or discard this patch.
programs/define.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@
 block discarded – undo
21 21
  * @copyright Copyright (c) 2006 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-define('APP_PHP_PATH', dirname(__FILE__) . '/');
25
-define('APP_SET_PATH', dirname(__FILE__) . '/');
26
-define('APP_UI_PATH', dirname(__FILE__) . '/ui/');
27
-define('APP_CTRL_PATH', dirname(__FILE__) . '/');
24
+define('APP_PHP_PATH', dirname(__FILE__).'/');
25
+define('APP_SET_PATH', dirname(__FILE__).'/');
26
+define('APP_UI_PATH', dirname(__FILE__).'/ui/');
27
+define('APP_CTRL_PATH', dirname(__FILE__).'/');
28 28
 
29
-require_once APP_PHP_PATH . 'base.class.php';
30
-require_once APP_UI_PATH . 'base.ui.php';
29
+require_once APP_PHP_PATH.'base.class.php';
30
+require_once APP_UI_PATH.'base.ui.php';
31 31
 
32
-require_once $GLOBALS['babInstallPath'] . 'utilit/dateTime.php';
32
+require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
33 33
 
34 34
 
35 35
 
Please login to merge, or discard this patch.
programs/ui/ui.helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		if (empty($description)) {
48 48
 			$description = $field->getName();
49 49
 		}
50
-		$fieldLabel = $W->Label($description . ':');
50
+		$fieldLabel = $W->Label($description.':');
51 51
 
52 52
 		if ($field instanceof ORM_DateField) {
53 53
 			$widget = $W->DatePicker();
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		if (empty($description)) {
104 104
 			$description = $field->getName();
105 105
 		}
106
-		$fieldLabel = $W->Label($description . ':');
106
+		$fieldLabel = $W->Label($description.':');
107 107
 
108 108
 		if ($field instanceof ORM_DateField) {
109 109
 			$widget = $W->PeriodPicker();
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	$nbOptions = 0;
207 207
 	foreach ($iterator as $record) {
208 208
 		if (isset($record->code)) {
209
-			$optionText = $record->code . ' - ' . $record->$fieldName;
209
+			$optionText = $record->code.' - '.$record->$fieldName;
210 210
 		} else {
211 211
 			$optionText = $record->$fieldName;
212 212
 		}
Please login to merge, or discard this patch.
programs/ui/ui.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function includeBase()
36 36
     {
37
-        require_once APP_UI_PATH . 'base.ui.php';
38
-        require_once APP_UI_PATH . 'ui.helpers.php';
37
+        require_once APP_UI_PATH.'base.ui.php';
38
+        require_once APP_UI_PATH.'ui.helpers.php';
39 39
     }
40 40
 
41 41
     public function includePage()
42 42
     {
43
-        require_once APP_UI_PATH . 'page.class.php';
43
+        require_once APP_UI_PATH.'page.class.php';
44 44
     }
45 45
 
46 46
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function ExportSelectEditor($id, app_TableModelView $tableview, $filter = null)
79 79
     {
80
-        require_once dirname(__FILE__) . '/exportselect.ui.php';
80
+        require_once dirname(__FILE__).'/exportselect.ui.php';
81 81
         return new app_ExportSelectEditor($this->App(), $id, $tableview, $filter);
82 82
     }
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
programs/record.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -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));
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
             throw new app_Exception('Trying to get the reference string of a record without an id.');
391 391
         }
392 392
         $classname = $this->getClassName();
393
-        return $classname . ':' . $this->id;
393
+        return $classname.':'.$this->id;
394 394
     }
395 395
 
396 396
 
@@ -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/functions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     if (null === $url) {
113 113
         $script = '<script type="text/javascript">';
114 114
         if (isset($message)) {
115
-            $script .= 'alert("' . bab_toHtml($message, BAB_HTML_JS) . '");';
115
+            $script .= 'alert("'.bab_toHtml($message, BAB_HTML_JS).'");';
116 116
         }
117 117
         $script .= 'history.back();';
118 118
         $script .= '</script>';
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $url = $url->url();
125 125
     }
126 126
     if (!empty($babBody->msgerror)) {
127
-        $url .=  '&msgerror=' . urlencode($babBody->msgerror);
127
+        $url .= '&msgerror='.urlencode($babBody->msgerror);
128 128
     }
129 129
     if (isset($message)) {
130 130
         $lines = explode("\n", $message);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         }
134 134
     }
135 135
 
136
-    header('Location: ' . $url);
136
+    header('Location: '.$url);
137 137
     die;
138 138
 }
139 139
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
  */
166 166
 function app_fileUploadError($error)
167 167
 {
168
-    switch($error) {
168
+    switch ($error) {
169 169
         case UPLOAD_ERR_OK:
170 170
             return null;
171 171
 
Please login to merge, or discard this patch.
programs/customsection.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -318,9 +318,9 @@  discard block
 block discarded – undo
318 318
         if (is_array($parameters)) {
319 319
             $params = array();
320 320
             foreach ($parameters as $key => $value) {
321
-                $params[] = $key . '=' . $value;
321
+                $params[] = $key.'='.$value;
322 322
             }
323
-            $rawField .= ':' . implode(';', $params);
323
+            $rawField .= ':'.implode(';', $params);
324 324
         }
325 325
         array_push($rawFields, $rawField);
326 326
         $this->fields = implode(',', $rawFields);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             if (empty($rawField)) {
340 340
                 continue;
341 341
             }
342
-            list($fieldName, ) = explode(':', $rawField);
342
+            list($fieldName,) = explode(':', $rawField);
343 343
 
344 344
             if ($removedFieldName == $fieldName) {
345 345
                 continue;
Please login to merge, or discard this patch.
programs/controller.class.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2008 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once $GLOBALS['babInstallPath'] . 'utilit/controller.class.php';
25
-require_once $GLOBALS['babInstallPath'] . 'utilit/json.php';
24
+require_once $GLOBALS['babInstallPath'].'utilit/controller.class.php';
25
+require_once $GLOBALS['babInstallPath'].'utilit/json.php';
26 26
 
27
-require_once dirname(__FILE__). '/functions.php';
27
+require_once dirname(__FILE__).'/functions.php';
28 28
 
29 29
 $App = app_App();
30 30
 $App->includeBase();
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 {
35 35
 	public function __construct($action, $code = 0)
36 36
 	{
37
-		$message = 'Unknown method "' . $action->getController() . '::' . $action->getMethod() . '"';
37
+		$message = 'Unknown method "'.$action->getController().'::'.$action->getMethod().'"';
38 38
 		parent::__construct($message, $code);
39 39
 	}
40 40
 }
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
         // we try to select one according to the classname prefix.
184 184
         list($prefix) = explode('_', __CLASS__);
185 185
         $functionalityName = ucwords($prefix);
186
-        $App = @bab_functionality::get('App/' . $functionalityName);
186
+        $App = @bab_functionality::get('App/'.$functionalityName);
187 187
 
188 188
         if (!$App)
189 189
         {
190
-            throw new app_Exception('Faild to autodetect functionality App/' . $functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead');
190
+            throw new app_Exception('Faild to autodetect functionality App/'.$functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead');
191 191
         }
192 192
 
193 193
         $controller = $App->ControllerProxy($classname, $proxy);
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
     static function getProxyInstance(Func_App $App, $classname)
207 207
     {
208 208
         $class = new ReflectionClass($classname);
209
-        $proxyClassname = $class->name . self::PROXY_CLASS_SUFFIX;
209
+        $proxyClassname = $class->name.self::PROXY_CLASS_SUFFIX;
210 210
         if (!class_exists($proxyClassname)) {
211
-            $classStr = 'class ' . $proxyClassname . ' extends ' . $class->name . ' {' . "\n";
211
+            $classStr = 'class '.$proxyClassname.' extends '.$class->name.' {'."\n";
212 212
             $methods = $class->getMethods();
213 213
 
214 214
             $classStr .= '	public function __construct(Func_App $App) {
@@ -221,24 +221,24 @@  discard block
 block discarded – undo
221 221
                 }
222 222
 
223 223
 
224
-                $classStr .= '	public function ' . $method->name . '(';
224
+                $classStr .= '	public function '.$method->name.'(';
225 225
                 $parameters = $method->getParameters();
226 226
                 $parametersStr = array();
227 227
                 foreach ($parameters as $parameter) {
228 228
 
229 229
                     if ($parameter->isDefaultValueAvailable()) {
230
-                        $parametersStr[] = '$' . $parameter->name . ' = ' . var_export($parameter->getDefaultValue(), true);
230
+                        $parametersStr[] = '$'.$parameter->name.' = '.var_export($parameter->getDefaultValue(), true);
231 231
                     } else {
232
-                        $parametersStr[] = '$' . $parameter->name;
232
+                        $parametersStr[] = '$'.$parameter->name;
233 233
                     }
234 234
                 }
235 235
                 $classStr .= implode(', ', $parametersStr);
236
-                $classStr .= ') {' . "\n";
237
-                $classStr .= '		$args = func_get_args();' . "\n";
238
-                $classStr .= '		return $this->getMethodAction(__FUNCTION__, $args);' . "\n";
239
-                $classStr .= '	}' . "\n";
236
+                $classStr .= ') {'."\n";
237
+                $classStr .= '		$args = func_get_args();'."\n";
238
+                $classStr .= '		return $this->getMethodAction(__FUNCTION__, $args);'."\n";
239
+                $classStr .= '	}'."\n";
240 240
             }
241
-            $classStr .= '}' . "\n";
241
+            $classStr .= '}'."\n";
242 242
 
243 243
             // We define the proxy class
244 244
             eval($classStr);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $action->setParameters($actionParams);
363 363
 
364 364
 
365
-        list(,,$file) = explode('/', $App->controllerTg);
365
+        list(,, $file) = explode('/', $App->controllerTg);
366 366
 
367 367
         $action->setParameter('addon', $App->getAddonName().'.'.$file);
368 368
         $action->setParameter('idx', $idx);
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
             return false;
387 387
         }
388 388
 
389
-        list($objectName, ) = explode('.', $method);
389
+        list($objectName,) = explode('.', $method);
390 390
 
391 391
         if (!method_exists($this, $objectName)) {
392 392
             header('HTTP/1.0 400 Bad Request');
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
         }
395 395
 
396 396
         $objectController = $this->{$objectName}(false);
397
-        if ( ! ($objectController instanceof app_Controller)) {
397
+        if (!($objectController instanceof app_Controller)) {
398 398
             return false;
399 399
         }
400 400
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
             } else {
409 409
                 if ($this->isAjaxRequest()) {
410 410
 
411
-                    header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
411
+                    header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
412 412
 
413 413
                     die(
414 414
                         bab_json_encode(
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
         } catch (app_SaveException $e) {
430 430
 
431 431
             if ($this->isAjaxRequest()) {
432
-                header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
432
+                header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
433 433
                 header('Cache-Control: no-cache, must-revalidate');
434 434
                 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
435 435
                 header('Content-type: application/json');
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                         if (method_exists($htmlCanvas, 'sendPageTitle')) {
485 485
                             $htmlCanvas->sendPageTitle($pageTitle);
486 486
                         } else {
487
-                            header('X-Cto-PageTitle: ' . $pageTitle);
487
+                            header('X-Cto-PageTitle: '.$pageTitle);
488 488
                         }
489 489
                     }
490 490
                     $html = $returnedValue->display($htmlCanvas);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     private function deletedItemPage(Widget_Action $action, app_DeletedRecordException $e)
544 544
     {
545 545
         if ($this->isAjaxRequest()) {
546
-            header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
546
+            header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
547 547
             header('Cache-Control: no-cache, must-revalidate');
548 548
             header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
549 549
             header('Content-type: application/json');
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
                 );
561 561
 
562 562
         }
563
-        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);
563
+        header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
564 564
 
565 565
         $App = $this->App();
566 566
         $W = bab_Widgets();
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     private function notFoundPage(Widget_Action $action, app_NotFoundException $e)
595 595
     {
596 596
         if ($this->isAjaxRequest()) {
597
-            $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle() . ' (' . $e->getId() . ')');
597
+            $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle().' ('.$e->getId().')');
598 598
             $json = array(
599 599
                 'messages' => array(
600 600
                     array(
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
             echo bab_json_encode($json);
607 607
             die;
608 608
         }
609
-        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);
609
+        header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
610 610
         header('Cache-Control: no-cache, must-revalidate');
611 611
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
612 612
 
@@ -626,14 +626,14 @@  discard block
 block discarded – undo
626 626
 
627 627
     private function errorPage(Exception $e)
628 628
     {
629
-        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500);
629
+        header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500);
630 630
 
631
-        require_once $GLOBALS['babInstallPath'] . 'utilit/uiutil.php';
631
+        require_once $GLOBALS['babInstallPath'].'utilit/uiutil.php';
632 632
         $popup = new babBodyPopup();
633 633
         $popup->babEcho(
634
-            '<h1>' . $this->App()->translate('There was a problem when trying to perform this operation') . '</h1>'
635
-            . '<h2 class="error">' . $this->App()->translate('Additional debugging information:') . '</h2>'
636
-            . '<p class="error">' . $e->getMessage() . ' ' .  $e->getFile() . ' ' . $e->getLine()  . ' ' . $e->getTraceAsString() . '</p>'
634
+            '<h1>'.$this->App()->translate('There was a problem when trying to perform this operation').'</h1>'
635
+            . '<h2 class="error">'.$this->App()->translate('Additional debugging information:').'</h2>'
636
+            . '<p class="error">'.$e->getMessage().' '.$e->getFile().' '.$e->getLine().' '.$e->getTraceAsString().'</p>'
637 637
             );
638 638
 
639 639
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
      */
679 679
     public function CustomField($proxy = true)
680 680
     {
681
-        require_once APP_CTRL_PATH . 'customfield.ctrl.php';
681
+        require_once APP_CTRL_PATH.'customfield.ctrl.php';
682 682
         return $this->App()->ControllerProxy('app_CtrlCustomField', $proxy);
683 683
     }
684 684
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
      */
690 690
     public function CustomSection($proxy = true)
691 691
     {
692
-        require_once APP_CTRL_PATH . 'customsection.ctrl.php';
692
+        require_once APP_CTRL_PATH.'customsection.ctrl.php';
693 693
         return $this->App()->ControllerProxy('app_CtrlCustomSection', $proxy);
694 694
     }
695 695
 }
Please login to merge, or discard this patch.