@@ -48,7 +48,7 @@ public function render(array $rows, array $styles = []): string
48
48
$ title = $ body = $ dash = $ positions = [];
49
49
50
50
[$ start , $ end ] = $ styles ['head ' ];
51
- $ pos = 0 ;
51
+ $ pos = 0 ;
52
52
foreach ($ head as $ col => $ size ) {
53
53
$ dash [] = str_repeat ('- ' , $ size + 2 );
54
54
$ title [] = str_pad ($ this ->toWords ($ col ), $ size , ' ' );
@@ -68,11 +68,11 @@ public function render(array $rows, array $styles = []): string
68
68
69
69
if (isset ($ styles [$ line . ': ' . $ colNumber ])) { // cell, 1:1
70
70
$ style = $ styles [$ line . ': ' . $ colNumber ];
71
- } else if (isset ($ styles [$ col ]) || isset ($ styles ['*: ' . $ colNumber ])) { // col, *:2 or b
71
+ } elseif (isset ($ styles [$ col ]) || isset ($ styles ['*: ' . $ colNumber ])) { // col, *:2 or b
72
72
$ style = $ styles ['*: ' . $ colNumber ] ?? $ styles [$ col ];
73
- } else if (isset ($ styles [$ line . ':* ' ])) { // row, 2:*
73
+ } elseif (isset ($ styles [$ line . ':* ' ])) { // row, 2:*
74
74
$ style = $ styles [$ line . ':* ' ];
75
- } else if (isset ($ styles ['*:* ' ])) { // any cell, *:*
75
+ } elseif (isset ($ styles ['*:* ' ])) { // any cell, *:*
76
76
$ style = $ styles ['*:* ' ];
77
77
} else {
78
78
$ style = $ styles [['even ' , 'odd ' ][(int ) $ odd ]];
@@ -121,7 +121,7 @@ protected function normalize(array $rows): array
121
121
122
122
foreach ($ head as $ col => &$ value ) {
123
123
$ cols = array_column ($ rows , $ col );
124
- $ cols = array_map (function ($ col ) {
124
+ $ cols = array_map (function ($ col ) {
125
125
$ col ??= '' ;
126
126
127
127
if (preg_match ('/( \\x1b(?:.+)m)/U ' , $ col , $ matches )) {
@@ -152,8 +152,8 @@ protected function normalizeStyles(array $styles): array
152
152
foreach ($ styles as $ for => $ style ) {
153
153
if (is_string ($ style ) && $ style !== '' ) {
154
154
$ default [$ for ] = ['< ' . trim ($ style , '<> ' ) . '> ' , '</end> ' ];
155
- } else if (str_contains ($ for , ': ' ) && is_callable ($ style )) {
156
- $ default [$ for ] = $ style ;
155
+ } elseif (str_contains ($ for , ': ' ) && is_callable ($ style )) {
156
+ $ default [$ for ] = $ style ;
157
157
}
158
158
}
159
159
0 commit comments