Completed
Push — master ( 360629...31e4ac )
by Gunnar
02:50
created
webroot/not-specified-table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	],
42 42
 ];
43 43
 
44
-$table = $table->create([], $data, []);
44
+$table = $table->create([ ], $data, [ ]);
45 45
 
46 46
 ?>
47 47
 
Please login to merge, or discard this patch.
webroot/table-anax-mvc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
  // Get environment & autoloader.
21
- require __DIR__.'/config.php';
21
+ require __DIR__ . '/config.php';
22 22
 
23 23
  // Create services and inject into the app.
24 24
  $di  = new \Anax\DI\CDIFactoryDefault();
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
          'column4' => [
75 75
              'title'    => 'Table Header 4',
76 76
              'function'	=> function($link) {
77
-                 return '<a href="'. $link . '">' . "Google" . '</a>';
77
+                 return '<a href="' . $link . '">' . "Google" . '</a>';
78 78
              }
79 79
          ],
80 80
          'column6' => [
81 81
              'title'    => 'Table Header 6',
82 82
              'function' => function($isPresent) {
83
-                 return empty($isPresent) ? 'Not present' :  'Present';
83
+                 return empty($isPresent) ? 'Not present' : 'Present';
84 84
         	}
85 85
          ],
86 86
          'tablefoot1' => [
Please login to merge, or discard this patch.
webroot/specified-table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,13 +62,13 @@
 block discarded – undo
62 62
     'column4' => [
63 63
         'title'     => 'Table Header 4',
64 64
 		'function'	=> function($link) {
65
-			return '<a href="'. $link . '">' . "Google" . '</a>';
65
+			return '<a href="' . $link . '">' . "Google" . '</a>';
66 66
 		}
67 67
     ],
68 68
 	'column6' => [
69 69
         'title'    	=> 'Table Header 6',
70 70
 		'function' 	=> function($tableCell6) {
71
-        	return empty($tableCell6) ? 'Not present' :  'Present';
71
+        	return empty($tableCell6) ? 'Not present' : 'Present';
72 72
    		}
73 73
     ],
74 74
 	'tablefoot1' => [
Please login to merge, or discard this patch.
autoloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  * @return void
13 13
  */
14 14
 spl_autoload_register(
15
-    function ($class) {
15
+    function($class) {
16 16
 
17 17
         // project-specific namespace prefix
18 18
         //$prefix = 'Foo\\Bar\\';
Please login to merge, or discard this patch.
src/HTMLTable/CHTMLTable.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param mixed[] $data         table cell data.
35 35
      * @param mixed[] $columnSpecs  table columns cell settings.
36 36
      */
37
-    public function __construct($tableSpecs = [], $data = [], $columnSpecs = [])
37
+    public function __construct($tableSpecs = [ ], $data = [ ], $columnSpecs = [ ])
38 38
     {
39 39
         $this->create($tableSpecs, $data, $columnSpecs);
40 40
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return object the html table object.
54 54
      */
55
-    public function create($tableSpecs = [], $data = [], $columnSpecs = [])
55
+    public function create($tableSpecs = [ ], $data = [ ], $columnSpecs = [ ])
56 56
     {
57 57
         $this->resetTableTags();
58 58
         $this->setTableSpecifications($tableSpecs);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     private function isClassPresent($tableSpec)
116 116
     {
117
-        return isset($tableSpec['class']) ? true : false;
117
+        return isset($tableSpec[ 'class' ]) ? true : false;
118 118
     }
119 119
 
120 120
     /**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      * @return string[] the table specification without the CSS id tag.
128 128
      */
129 129
     private function removeId($tableSpec) {
130
-        $tableSpec['id'] = null;
130
+        $tableSpec[ 'id' ] = null;
131 131
 
132 132
         return $tableSpec;
133 133
     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     private function setColumnTitlesFromData($data)
175 175
     {
176
-        $firstRow = isset($data[0]) ? $data[0] : [];
176
+        $firstRow = isset($data[ 0 ]) ? $data[ 0 ] : [ ];
177 177
         foreach ($firstRow as $key => $value) {
178 178
             $this->tableHead .= "\n<th>";
179 179
             $this->tableHead .= $key;
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
     private function isTableFooter($columnSpec)
216 216
     {
217 217
         $isFooter = false;
218
-        if (isset($columnSpec['type'])) {
219
-            if (strcmp($columnSpec['type'], self::FOOTER) === 0) {
218
+        if (isset($columnSpec[ 'type' ])) {
219
+            if (strcmp($columnSpec[ 'type' ], self::FOOTER) === 0) {
220 220
                 $isFooter = true;
221 221
             }
222 222
         }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     private function getTitle($key, $columnSpec)
242 242
     {
243
-        return isset($columnSpec['title']) ? $columnSpec['title'] : $key;
243
+        return isset($columnSpec[ 'title' ]) ? $columnSpec[ 'title' ] : $key;
244 244
     }
245 245
 
246 246
     /**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
      */
342 342
     private function getColspan($columnSpec)
343 343
     {
344
-        return isset($columnSpec['colspan']) ? " colspan='{$columnSpec['colspan']}'" : null;
344
+        return isset($columnSpec[ 'colspan' ]) ? " colspan='{$columnSpec[ 'colspan' ]}'" : null;
345 345
     }
346 346
 
347 347
     /**
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
      */
386 386
     private function isFunctionSpecified($columnSpec)
387 387
     {
388
-        return isset($columnSpec['function']) ? true : false;
388
+        return isset($columnSpec[ 'function' ]) ? true : false;
389 389
     }
390 390
 
391 391
     /**
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
      */
419 419
     private function getValueThroughFunction($columnSpec, $dataValue)
420 420
     {
421
-        if (!empty($columnSpec['function'])) {
422
-            return call_user_func($columnSpec['function'], $dataValue);
421
+        if (!empty($columnSpec[ 'function' ])) {
422
+            return call_user_func($columnSpec[ 'function' ], $dataValue);
423 423
         } else {
424 424
             return $dataValue;
425 425
         }
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
     private function getFooterData($columnSpec)
468 468
     {
469 469
         if ($this->isFunctionSpecified($columnSpec)) {
470
-            return call_user_func($columnSpec['function']);
470
+            return call_user_func($columnSpec[ 'function' ]);
471 471
         } else {
472
-            return isset($columnSpec['value']) ? $columnSpec['value'] : "";
472
+            return isset($columnSpec[ 'value' ]) ? $columnSpec[ 'value' ] : "";
473 473
         }
474 474
     }
475 475
 
@@ -482,9 +482,9 @@  discard block
 block discarded – undo
482 482
      */
483 483
     public function getHTMLTable()
484 484
     {
485
-        $id = isset($this->tableSpec['id']) ? " id='{$this->tableSpec['id']}'" : null;
486
-        $class = isset($this->tableSpec['class']) ? " class='{$this->tableSpec['class']}'" : null;
487
-        $caption = isset($this->tableSpec['caption']) ? "<caption>{$this->tableSpec['caption']}</caption>" : null;
485
+        $id = isset($this->tableSpec[ 'id' ]) ? " id='{$this->tableSpec[ 'id' ]}'" : null;
486
+        $class = isset($this->tableSpec[ 'class' ]) ? " class='{$this->tableSpec[ 'class' ]}'" : null;
487
+        $caption = isset($this->tableSpec[ 'caption' ]) ? "<caption>{$this->tableSpec[ 'caption' ]}</caption>" : null;
488 488
 
489 489
         $htmlTable = "<table{$id}{$class}>";
490 490
         $htmlTable .= $caption;
Please login to merge, or discard this patch.