Test Setup Failed
Push — master ( 0b72f9...12f44a )
by Php Easy Api
03:43
created
src/resta/Authenticate/AuthenticateBasic.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
     /**
8 8
      * @param callable $callback
9 9
      */
10
-    protected function checkParamsViaAvailability($data,callable $callback)
10
+    protected function checkParamsViaAvailability($data, callable $callback)
11 11
     {
12 12
         // if an authenticate is provided via the existing check method,
13 13
         // then we return the value of the data that we are checking for with callback help.
14
-        if($this->check() && isset($this->params[$data])){
15
-            return call_user_func_array($callback,[$this->params[$data]]);
14
+        if ($this->check() && isset($this->params[$data])) {
15
+            return call_user_func_array($callback, [$this->params[$data]]);
16 16
         }
17 17
 
18 18
         return null;
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
      */
24 24
     protected function checkProcessHttpMethod($type)
25 25
     {
26
-        $getHttp=(array)$this->getHttp();
26
+        $getHttp = (array)$this->getHttp();
27 27
 
28 28
         // we will determine whether
29 29
         // the http path is correct for this method.
30
-        if(isset($getHttp[$type]) and $getHttp[$type]!==httpMethod()){
30
+        if (isset($getHttp[$type]) and $getHttp[$type]!==httpMethod()) {
31 31
             $this->getExceptionForHttp($getHttp[$type]);
32 32
         }
33 33
     }
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
         $headers = headers();
42 42
 
43 43
         //get token key from config
44
-        $tokenKey=$this->getTokenKey();
44
+        $tokenKey = $this->getTokenKey();
45 45
 
46 46
         // if there is a token in the headers,
47 47
         // we return the callback.
48
-        if(isset($headers[$tokenKey])){
49
-            return call_user_func_array($callback,[$headers[$tokenKey][0]]);
48
+        if (isset($headers[$tokenKey])) {
49
+            return call_user_func_array($callback, [$headers[$tokenKey][0]]);
50 50
         }
51 51
 
52 52
         //token false
Please login to merge, or discard this patch.
src/resta/Authenticate/AuthenticateRequest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@  discard block
 block discarded – undo
13 13
      *
14 14
      * @var array $autoInject
15 15
      */
16
-    protected $autoInject=[];
16
+    protected $autoInject = [];
17 17
 
18 18
     /**
19 19
      * The values ​​expected by the server.
20 20
      * @var array
21 21
      */
22
-    protected $expected=[];
22
+    protected $expected = [];
23 23
 
24 24
     /**
25 25
      * mandatory http method.
26 26
      * @var array
27 27
      */
28
-    protected $http=[];
28
+    protected $http = [];
29 29
 
30 30
     /**
31 31
      * AuthenticateRequest constructor.
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
     public function __construct($credentials)
35 35
     {
36 36
         //credentials loop for expected property
37
-        foreach ($credentials as $credential){
38
-            $this->expected[]=$credential;
37
+        foreach ($credentials as $credential) {
38
+            $this->expected[] = $credential;
39 39
         }
40 40
 
41 41
         parent::__construct();
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function credentials($credentials)
48 48
     {
49
-        $credentials=[];
49
+        $credentials = [];
50 50
 
51
-        foreach ($this->inputs as $inputKey=>$inputValue){
51
+        foreach ($this->inputs as $inputKey=>$inputValue) {
52 52
 
53
-            if(in_array($inputKey,$this->expected)){
54
-                $credentials[$inputKey]=$inputValue;
53
+            if (in_array($inputKey, $this->expected)) {
54
+                $credentials[$inputKey] = $inputValue;
55 55
             }
56 56
         }
57 57
 
Please login to merge, or discard this patch.
src/resta/Cache/CacheManager.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,9 @@
 block discarded – undo
123 123
         }
124 124
 
125 125
         //this method may show continuity depending on the macro.
126
-        if(false === $this instanceof $macro) return ;
126
+        if(false === $this instanceof $macro) {
127
+            return ;
128
+        }
127 129
 
128 130
         // retrieve the cache item
129 131
         $cacheItem = $this->cache->getItem($this->name);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function adapter($adapter)
57 57
     {
58
-        if(!is_null($adapter)){
58
+        if (!is_null($adapter)) {
59 59
             $this->adapter = $adapter;
60 60
         }
61 61
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         //name variable is
74 74
         //the name of the cache data set to be created.
75
-        if(!is_null($name)){
75
+        if (!is_null($name)) {
76 76
             $this->name = $name;
77 77
         }
78 78
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         //Cache data is set at the time.
91 91
         //Data will be valid in this time.
92
-        if(is_numeric($expire)){
92
+        if (is_numeric($expire)) {
93 93
             $this->expire = $expire;
94 94
         }
95 95
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         // this class has a macro that can be managed by the user.
110 110
         // macros work as an extensible version of the classes.
111
-        $macro = $this->app['macro']->with(config('kernel.macros.cache'),$this,$this->adapter);
111
+        $macro = $this->app['macro']->with(config('kernel.macros.cache'), $this, $this->adapter);
112 112
 
113 113
         //set cache macroable object
114 114
         $this->cache = $macro->{$this->adapter}($callback);
@@ -118,25 +118,25 @@  discard block
 block discarded – undo
118 118
         $backtrace = debug_backtrace()[1];
119 119
 
120 120
         //If name is null, we name it with backtrace.
121
-        if($this->name===null) {
121
+        if ($this->name===null) {
122 122
             $this->name = md5($backtrace['function'].'_'.$backtrace['class']);
123 123
         }
124 124
 
125 125
         //this method may show continuity depending on the macro.
126
-        if(false === $this instanceof $macro) return ;
126
+        if (false===$this instanceof $macro) return;
127 127
 
128 128
         // retrieve the cache item
129 129
         $cacheItem = $this->cache->getItem($this->name);
130 130
 
131 131
         if (!$cacheItem->isHit()) {
132 132
 
133
-            $data=call_user_func($callback);
133
+            $data = call_user_func($callback);
134 134
             $cacheItem->set($data);
135 135
             $this->cache->save($cacheItem);
136 136
             return $data;
137 137
         }
138 138
 
139
-        $this->app->register('illuminator','cache',['name'=>$this->name]);
139
+        $this->app->register('illuminator', 'cache', ['name'=>$this->name]);
140 140
 
141 141
         // retrieve the value stored by the item
142 142
         return $cacheItem->get();
Please login to merge, or discard this patch.
src/resta/Cache/CacheContainerResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     public function cacheProcess($callback)
18 18
     {
19 19
         //we do cache key control for method cache container data.
20
-        if(isset($this->app['containerReflection']['methodCache']['cache'])){
20
+        if (isset($this->app['containerReflection']['methodCache']['cache'])) {
21 21
 
22 22
             //get cache data
23 23
             $cache = $this->app['containerReflection']['methodCache']['cache'];
Please login to merge, or discard this patch.
src/resta/Cache/CacheConfigDetector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@
 block discarded – undo
18 18
      */
19 19
     public function __construct()
20 20
     {
21
-        if(config('cache.default')!==null){
21
+        if (config('cache.default')!==null) {
22 22
 
23 23
             $default = config('cache.default');
24 24
 
25 25
             $this->config['adapter']  = config('cache.stores.'.$default.'.driver') ?? exception()->invalidArgument('driver for '.$default.' within cache config is not valid');
26
-            $this->config['path']     = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache' ;
26
+            $this->config['path']     = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache';
27 27
             $this->config['expire']   = config('cache.stores.'.$default.'.expire') ?? 0;
28 28
         }
29 29
     }
Please login to merge, or discard this patch.
src/resta/Environment/CheckEnvironmentFile.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     {
15 15
         //if the env file does not exist, we automatically detect
16 16
         //that the environment variable is in the production environment.
17
-        if(!file_exists($this->getEnvironmentPath())){
17
+        if (!file_exists($this->getEnvironmentPath())) {
18 18
             return [];
19 19
         }
20 20
 
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
      * @param bool $status
30 30
      * @return mixed
31 31
      */
32
-    public function getEnvironment($status=false)
32
+    public function getEnvironment($status = false)
33 33
     {
34 34
         //If the status value is false then direct path is invoked. If true is sent, variables are sent.
35
-        return (false === $status) ? $this->getEnvironmentPath() : $this->getEnvironmentVariables();
35
+        return (false===$status) ? $this->getEnvironmentPath() : $this->getEnvironmentVariables();
36 36
     }
37 37
 
38 38
     /**
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
     private function identifierEnvironment()
60 60
     {
61 61
         //We parse our environment variables through the yaml file.
62
-        $environment=$this->getEnvironment(true);
62
+        $environment = $this->getEnvironment(true);
63 63
 
64 64
         //the application will automatically throw an exception
65 65
         //if there is no env key in the parse variables.
66
-        if(!isset($environment['env'])){
66
+        if (!isset($environment['env'])) {
67 67
             exception()->invalidArgument('The env key missing on your environment');
68 68
         }
69 69
 
Please login to merge, or discard this patch.
src/resta/Environment/EnvironmentProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
      * @param null $environment
15 15
      * @return string
16 16
      */
17
-    public function environment($var=array(),$environment=null)
17
+    public function environment($var = array(), $environment = null)
18 18
     {
19 19
         //environment is recognized as a production environment directly
20 20
         //if there is no env object in the environment variable.
21 21
         $isProduction = $environment['env'] ?? 'production';
22 22
 
23 23
         //we issue a controlled environment key map for the submitted environment
24
-        return (count($var)===0) ? $isProduction : self::getEnvironmentForVariables($var,$environment);
24
+        return (count($var)===0) ? $isProduction : self::getEnvironmentForVariables($var, $environment);
25 25
     }
26 26
 
27 27
     /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param null $environment
32 32
      * @return mixed
33 33
      */
34
-    private static function getEnvironmentForVariables($var=array(),$environment=null)
34
+    private static function getEnvironmentForVariables($var = array(), $environment = null)
35 35
     {
36 36
         //environment variable specified by the variable is checked in the defined file
37 37
         //and the value is returned accordingly.
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function handle()
47 47
     {
48 48
         //set define for config
49
-        define ('environment',true);
49
+        define('environment', true);
50 50
 
51 51
         //where we do the checks for the environment file type,
52 52
         //and if no configuration file is found, the system throws an exception.
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
      * @param null $configuration
63 63
      * @return void
64 64
      */
65
-    private function set($configuration=null)
65
+    private function set($configuration = null)
66 66
     {
67 67
         //we are doing global registration for env and var value.
68
-        $this->app->register('environmentVariables',$configuration);
69
-        $this->app->register('env',$this->environment([],$this->app['environmentVariables']));
68
+        $this->app->register('environmentVariables', $configuration);
69
+        $this->app->register('env', $this->environment([], $this->app['environmentVariables']));
70 70
     }
71 71
 }
72 72
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Console/CustomConsoleProcess.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
         // command namespace
22 22
         // call custom command namespace
23
-        $commandNamespace = Utils::getNamespace(path()->command()) . '\\' . $this->app->getConsoleClass();
23
+        $commandNamespace = Utils::getNamespace(path()->command()).'\\'.$this->app->getConsoleClass();
24 24
 
25 25
         //return null if there is no command namespace
26 26
         if (!class_exists($commandNamespace)) return null;
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
 
37 37
         // closure binding custom command,move custom namespace as specific
38 38
         // call prepare commander firstly for checking command builder
39
-        return ClosureDispatcher::bind($app)->call(function () use($commandClassResolved,$app) {
39
+        return ClosureDispatcher::bind($app)->call(function() use($commandClassResolved, $app) {
40 40
 
41 41
             $this->prepareCommander($commandClassResolved, function($commandClassResolved) use($app) {
42 42
 
43 43
                 // call bindings for resolving
44 44
                 // call with dependency injection resolving
45
-                $commandBindings=[$commandClassResolved,strtolower($app->getConsoleClassMethod())];
46
-                return DIContainerManager::callBind($commandBindings,app()->applicationProviderBinding($this->app));
45
+                $commandBindings = [$commandClassResolved, strtolower($app->getConsoleClassMethod())];
46
+                return DIContainerManager::callBind($commandBindings, app()->applicationProviderBinding($this->app));
47 47
 
48 48
             });
49 49
         });
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
         $commandNamespace = Utils::getNamespace(path()->command()) . '\\' . $this->app->getConsoleClass();
24 24
 
25 25
         //return null if there is no command namespace
26
-        if (!class_exists($commandNamespace)) return null;
26
+        if (!class_exists($commandNamespace)) {
27
+            return null;
28
+        }
27 29
 
28 30
         //get class resolved
29 31
         $commandClassResolved = app()->resolve($commandNamespace,
Please login to merge, or discard this patch.
src/resta/Console/ConsoleTable.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
      */
266 266
     function setBorder($border)
267 267
     {
268
-        if ($border === CONSOLE_TABLE_BORDER_ASCII) {
268
+        if ($border===CONSOLE_TABLE_BORDER_ASCII) {
269 269
             $intersection = '+';
270 270
             $horizontal = '-';
271 271
             $vertical = '|';
272 272
         } else if (is_string($border)) {
273 273
             $intersection = $horizontal = $vertical = $border;
274
-        } else if ($border == '') {
274
+        } else if ($border=='') {
275 275
             $intersection = $horizontal = $vertical = '';
276 276
         } else {
277 277
             extract($border);
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             $this->_data[$row_id++][$col_id] = $col_cell;
399 399
         }
400 400
         $this->_updateRowsCols();
401
-        $this->_max_cols = max($this->_max_cols, $col_id + 1);
401
+        $this->_max_cols = max($this->_max_cols, $col_id+1);
402 402
     }
403 403
     /**
404 404
      * Adds data to the table.
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     function addData($data, $col_id = 0, $row_id = 0)
413 413
     {
414 414
         foreach ($data as $row) {
415
-            if ($row === CONSOLE_TABLE_HORIZONTAL_RULE) {
415
+            if ($row===CONSOLE_TABLE_HORIZONTAL_RULE) {
416 416
                 $this->_data[$row_id] = CONSOLE_TABLE_HORIZONTAL_RULE;
417 417
                 $row_id++;
418 418
                 continue;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
             $column   = $filter[0];
484 484
             $callback = $filter[1];
485 485
             foreach ($this->_data as $row_id => $row_data) {
486
-                if ($row_data !== CONSOLE_TABLE_HORIZONTAL_RULE) {
486
+                if ($row_data!==CONSOLE_TABLE_HORIZONTAL_RULE) {
487 487
                     $this->_data[$row_id][$column] =
488 488
                         call_user_func($callback, $row_data[$column]);
489 489
                 }
@@ -500,25 +500,25 @@  discard block
 block discarded – undo
500 500
         if (!empty($this->_headers)) {
501 501
             $this->_calculateRowHeight(-1, $this->_headers[0]);
502 502
         }
503
-        for ($i = 0; $i < $this->_max_rows; $i++) {
504
-            for ($j = 0; $j < $this->_max_cols; $j++) {
503
+        for ($i = 0; $i<$this->_max_rows; $i++) {
504
+            for ($j = 0; $j<$this->_max_cols; $j++) {
505 505
                 if (!isset($this->_data[$i][$j]) &&
506 506
                     (!isset($this->_data[$i]) ||
507
-                        $this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE)) {
507
+                        $this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE)) {
508 508
                     $this->_data[$i][$j] = '';
509 509
                 }
510 510
             }
511 511
             $this->_calculateRowHeight($i, $this->_data[$i]);
512
-            if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE) {
512
+            if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE) {
513 513
                 ksort($this->_data[$i]);
514 514
             }
515 515
         }
516 516
         $this->_splitMultilineRows();
517 517
         // Update cell lengths.
518
-        for ($i = 0; $i < count($this->_headers); $i++) {
518
+        for ($i = 0; $i<count($this->_headers); $i++) {
519 519
             $this->_calculateCellLengths($this->_headers[$i]);
520 520
         }
521
-        for ($i = 0; $i < $this->_max_rows; $i++) {
521
+        for ($i = 0; $i<$this->_max_rows; $i++) {
522 522
             $this->_calculateCellLengths($this->_data[$i]);
523 523
         }
524 524
         ksort($this->_data);
@@ -534,24 +534,24 @@  discard block
 block discarded – undo
534 534
         $sections          = array(&$this->_headers, &$this->_data);
535 535
         $max_rows          = array(count($this->_headers), $this->_max_rows);
536 536
         $row_height_offset = array(-1, 0);
537
-        for ($s = 0; $s <= 1; $s++) {
537
+        for ($s = 0; $s<=1; $s++) {
538 538
             $inserted = 0;
539 539
             $new_data = $sections[$s];
540
-            for ($i = 0; $i < $max_rows[$s]; $i++) {
540
+            for ($i = 0; $i<$max_rows[$s]; $i++) {
541 541
                 // Process only rows that have many lines.
542
-                $height = $this->_row_heights[$i + $row_height_offset[$s]];
543
-                if ($height > 1) {
542
+                $height = $this->_row_heights[$i+$row_height_offset[$s]];
543
+                if ($height>1) {
544 544
                     // Split column data into one-liners.
545 545
                     $split = array();
546
-                    for ($j = 0; $j < $this->_max_cols; $j++) {
546
+                    for ($j = 0; $j<$this->_max_cols; $j++) {
547 547
                         $split[$j] = preg_split('/\r?\n|\r/',
548 548
                             $sections[$s][$i][$j]);
549 549
                     }
550 550
                     $new_rows = array();
551 551
                     // Construct new 'virtual' rows - insert empty strings for
552 552
                     // columns that have less lines that the highest one.
553
-                    for ($i2 = 0; $i2 < $height; $i2++) {
554
-                        for ($j = 0; $j < $this->_max_cols; $j++) {
553
+                    for ($i2 = 0; $i2<$height; $i2++) {
554
+                        for ($j = 0; $j<$this->_max_cols; $j++) {
555 555
                             $new_rows[$i2][$j] = !isset($split[$j][$i2])
556 556
                                 ? ''
557 557
                                 : $split[$j][$i2];
@@ -560,12 +560,12 @@  discard block
 block discarded – undo
560 560
                     // Replace current row with smaller rows.  $inserted is
561 561
                     // used to take account of bigger array because of already
562 562
                     // inserted rows.
563
-                    array_splice($new_data, $i + $inserted, 1, $new_rows);
564
-                    $inserted += count($new_rows) - 1;
563
+                    array_splice($new_data, $i+$inserted, 1, $new_rows);
564
+                    $inserted += count($new_rows)-1;
565 565
                 }
566 566
             }
567 567
             // Has the data been modified?
568
-            if ($inserted > 0) {
568
+            if ($inserted>0) {
569 569
                 $sections[$s] = $new_data;
570 570
                 $this->_updateRowsCols();
571 571
             }
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
         $vertical = $this->_border['vertical'];
585 585
         $separator = $this->_getSeparator();
586 586
         $return = array();
587
-        for ($i = 0; $i < count($this->_data); $i++) {
588
-            for ($j = 0; $j < count($this->_data[$i]); $j++) {
589
-                if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE &&
590
-                    $this->_strlen($this->_data[$i][$j]) <
587
+        for ($i = 0; $i<count($this->_data); $i++) {
588
+            for ($j = 0; $j<count($this->_data[$i]); $j++) {
589
+                if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE &&
590
+                    $this->_strlen($this->_data[$i][$j])<
591 591
                     $this->_cell_lengths[$j]) {
592 592
                     $this->_data[$i][$j] = $this->_strpad($this->_data[$i][$j],
593 593
                         $this->_cell_lengths[$j],
@@ -595,17 +595,17 @@  discard block
 block discarded – undo
595 595
                         $this->_col_align[$j]);
596 596
                 }
597 597
             }
598
-            if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE) {
598
+            if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE) {
599 599
                 $row_begin = $this->_borderVisibility['left']
600
-                    ? $vertical . str_repeat(' ', $this->_padding)
600
+                    ? $vertical.str_repeat(' ', $this->_padding)
601 601
                     : '';
602 602
                 $row_end = $this->_borderVisibility['right']
603
-                    ? str_repeat(' ', $this->_padding) . $vertical
603
+                    ? str_repeat(' ', $this->_padding).$vertical
604 604
                     : '';
605
-                $implode_char = str_repeat(' ', $this->_padding) . $vertical
605
+                $implode_char = str_repeat(' ', $this->_padding).$vertical
606 606
                     . str_repeat(' ', $this->_padding);
607 607
                 $return[]     = $row_begin
608
-                    . implode($implode_char, $this->_data[$i]) . $row_end;
608
+                    . implode($implode_char, $this->_data[$i]).$row_end;
609 609
             } elseif (!empty($separator)) {
610 610
                 $return[] = $separator;
611 611
             }
@@ -613,15 +613,15 @@  discard block
 block discarded – undo
613 613
         $return = implode(PHP_EOL, $return);
614 614
         if (!empty($separator)) {
615 615
             if ($this->_borderVisibility['inner']) {
616
-                $return = $separator . PHP_EOL . $return;
616
+                $return = $separator.PHP_EOL.$return;
617 617
             }
618 618
             if ($this->_borderVisibility['bottom']) {
619
-                $return .= PHP_EOL . $separator;
619
+                $return .= PHP_EOL.$separator;
620 620
             }
621 621
         }
622 622
         $return .= PHP_EOL;
623 623
         if (!empty($this->_headers)) {
624
-            $return = $this->_getHeaderLine() .  PHP_EOL . $return;
624
+            $return = $this->_getHeaderLine().PHP_EOL.$return;
625 625
         }
626 626
         return $return;
627 627
     }
@@ -643,14 +643,14 @@  discard block
 block discarded – undo
643 643
             $return[] = str_repeat($horizontal, $cl);
644 644
         }
645 645
         $row_begin = $this->_borderVisibility['left']
646
-            ? $intersection . str_repeat($horizontal, $this->_padding)
646
+            ? $intersection.str_repeat($horizontal, $this->_padding)
647 647
             : '';
648 648
         $row_end = $this->_borderVisibility['right']
649
-            ? str_repeat($horizontal, $this->_padding) . $intersection
649
+            ? str_repeat($horizontal, $this->_padding).$intersection
650 650
             : '';
651
-        $implode_char = str_repeat($horizontal, $this->_padding) . $intersection
651
+        $implode_char = str_repeat($horizontal, $this->_padding).$intersection
652 652
             . str_repeat($horizontal, $this->_padding);
653
-        return $row_begin . implode($implode_char, $return) . $row_end;
653
+        return $row_begin.implode($implode_char, $return).$row_end;
654 654
     }
655 655
     /**
656 656
      * Returns the header line for the table.
@@ -660,16 +660,16 @@  discard block
 block discarded – undo
660 660
     function _getHeaderLine()
661 661
     {
662 662
         // Make sure column count is correct
663
-        for ($j = 0; $j < count($this->_headers); $j++) {
664
-            for ($i = 0; $i < $this->_max_cols; $i++) {
663
+        for ($j = 0; $j<count($this->_headers); $j++) {
664
+            for ($i = 0; $i<$this->_max_cols; $i++) {
665 665
                 if (!isset($this->_headers[$j][$i])) {
666 666
                     $this->_headers[$j][$i] = '';
667 667
                 }
668 668
             }
669 669
         }
670
-        for ($j = 0; $j < count($this->_headers); $j++) {
671
-            for ($i = 0; $i < count($this->_headers[$j]); $i++) {
672
-                if ($this->_strlen($this->_headers[$j][$i]) <
670
+        for ($j = 0; $j<count($this->_headers); $j++) {
671
+            for ($i = 0; $i<count($this->_headers[$j]); $i++) {
672
+                if ($this->_strlen($this->_headers[$j][$i])<
673 673
                     $this->_cell_lengths[$i]) {
674 674
                     $this->_headers[$j][$i] =
675 675
                         $this->_strpad($this->_headers[$j][$i],
@@ -681,20 +681,20 @@  discard block
 block discarded – undo
681 681
         }
682 682
         $vertical = $this->_border['vertical'];
683 683
         $row_begin = $this->_borderVisibility['left']
684
-            ? $vertical . str_repeat(' ', $this->_padding)
684
+            ? $vertical.str_repeat(' ', $this->_padding)
685 685
             : '';
686 686
         $row_end = $this->_borderVisibility['right']
687
-            ? str_repeat(' ', $this->_padding) . $vertical
687
+            ? str_repeat(' ', $this->_padding).$vertical
688 688
             : '';
689
-        $implode_char = str_repeat(' ', $this->_padding) . $vertical
689
+        $implode_char = str_repeat(' ', $this->_padding).$vertical
690 690
             . str_repeat(' ', $this->_padding);
691 691
         $separator = $this->_getSeparator();
692 692
         if (!empty($separator) && $this->_borderVisibility['top']) {
693 693
             $return[] = $separator;
694 694
         }
695
-        for ($j = 0; $j < count($this->_headers); $j++) {
695
+        for ($j = 0; $j<count($this->_headers); $j++) {
696 696
             $return[] = $row_begin
697
-                . implode($implode_char, $this->_headers[$j]) . $row_end;
697
+                . implode($implode_char, $this->_headers[$j]).$row_end;
698 698
         }
699 699
         return implode(PHP_EOL, $return);
700 700
     }
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
         // Update maximum rows.
713 713
         ksort($this->_data);
714 714
         $keys            = array_keys($this->_data);
715
-        $this->_max_rows = end($keys) + 1;
715
+        $this->_max_rows = end($keys)+1;
716 716
         switch ($this->_defaultAlign) {
717 717
             case CONSOLE_TABLE_ALIGN_CENTER:
718 718
                 $pad = STR_PAD_BOTH;
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                 break;
726 726
         }
727 727
         // Set default column alignments
728
-        for ($i = 0; $i < $this->_max_cols; $i++) {
728
+        for ($i = 0; $i<$this->_max_cols; $i++) {
729 729
             if (!isset($this->_col_align[$i])) {
730 730
                 $this->_col_align[$i] = $pad;
731 731
             }
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
      */
741 741
     function _calculateCellLengths($row)
742 742
     {
743
-        for ($i = 0; $i < count($row); $i++) {
743
+        for ($i = 0; $i<count($row); $i++) {
744 744
             if (!isset($this->_cell_lengths[$i])) {
745 745
                 $this->_cell_lengths[$i] = 0;
746 746
             }
@@ -762,10 +762,10 @@  discard block
 block discarded – undo
762 762
             $this->_row_heights[$row_number] = 1;
763 763
         }
764 764
         // Do not process horizontal rule rows.
765
-        if ($row === CONSOLE_TABLE_HORIZONTAL_RULE) {
765
+        if ($row===CONSOLE_TABLE_HORIZONTAL_RULE) {
766 766
             return;
767 767
         }
768
-        for ($i = 0, $c = count($row); $i < $c; ++$i) {
768
+        for ($i = 0, $c = count($row); $i<$c; ++$i) {
769 769
             $lines                           = preg_split('/\r?\n|\r/', $row[$i]);
770 770
             $this->_row_heights[$row_number] = max($this->_row_heights[$row_number],
771 771
                 count($lines));
@@ -841,31 +841,31 @@  discard block
 block discarded – undo
841 841
         $sb_length  = strlen($input);
842 842
         $pad_length = $this->_strlen($pad);
843 843
         /* Return if we already have the length. */
844
-        if ($mb_length >= $length) {
844
+        if ($mb_length>=$length) {
845 845
             return $input;
846 846
         }
847 847
         /* Shortcut for single byte strings. */
848
-        if ($mb_length == $sb_length && $pad_length == strlen($pad)) {
848
+        if ($mb_length==$sb_length && $pad_length==strlen($pad)) {
849 849
             return str_pad($input, $length, $pad, $type);
850 850
         }
851 851
         switch ($type) {
852 852
             case STR_PAD_LEFT:
853
-                $left   = $length - $mb_length;
853
+                $left   = $length-$mb_length;
854 854
                 $output = $this->_substr(str_repeat($pad, ceil($left / $pad_length)),
855
-                        0, $left, $this->_charset) . $input;
855
+                        0, $left, $this->_charset).$input;
856 856
                 break;
857 857
             case STR_PAD_BOTH:
858
-                $left   = floor(($length - $mb_length) / 2);
859
-                $right  = ceil(($length - $mb_length) / 2);
858
+                $left   = floor(($length-$mb_length) / 2);
859
+                $right  = ceil(($length-$mb_length) / 2);
860 860
                 $output = $this->_substr(str_repeat($pad, ceil($left / $pad_length)),
861
-                        0, $left, $this->_charset) .
862
-                    $input .
861
+                        0, $left, $this->_charset).
862
+                    $input.
863 863
                     $this->_substr(str_repeat($pad, ceil($right / $pad_length)),
864 864
                         0, $right, $this->_charset);
865 865
                 break;
866 866
             case STR_PAD_RIGHT:
867
-                $right  = $length - $mb_length;
868
-                $output = $input .
867
+                $right  = $length-$mb_length;
868
+                $output = $input.
869 869
                     $this->_substr(str_repeat($pad, ceil($right / $pad_length)),
870 870
                         0, $right, $this->_charset);
871 871
                 break;
Please login to merge, or discard this patch.