File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ public function display() {
136
136
* @return array
137
137
*/
138
138
public function getDisplayLines () {
139
- $ this ->_renderer ->setWidths ($ this ->_width );
139
+ $ this ->_renderer ->setWidths ($ this ->_width , $ fallback = true );
140
140
$ border = $ this ->_renderer ->border ();
141
141
142
142
$ out = array ();
Original file line number Diff line number Diff line change @@ -32,9 +32,16 @@ class Ascii extends Renderer {
32
32
/**
33
33
* Set the widths of each column in the table.
34
34
*
35
- * @param array $widths The widths of the columns.
35
+ * @param array $widths The widths of the columns.
36
+ * @param bool $fallback Whether to use these values as fallback only.
36
37
*/
37
- public function setWidths (array $ widths ) {
38
+ public function setWidths (array $ widths , $ fallback = false ) {
39
+ if ($ fallback ) {
40
+ foreach ( $ this ->_widths as $ index => $ value ) {
41
+ $ widths [$ index ] = $ value ;
42
+ }
43
+ }
44
+ $ this ->_widths = $ widths ;
38
45
39
46
if ( is_null ( $ this ->_constraintWidth ) ) {
40
47
$ this ->_constraintWidth = (int ) Shell::columns ();
Original file line number Diff line number Diff line change @@ -25,9 +25,15 @@ public function __construct(array $widths = array()) {
25
25
/**
26
26
* Set the widths of each column in the table.
27
27
*
28
- * @param array $widths The widths of the columns.
28
+ * @param array $widths The widths of the columns.
29
+ * @param bool $fallback Whether to use these values as fallback only.
29
30
*/
30
- public function setWidths (array $ widths ) {
31
+ public function setWidths (array $ widths , $ fallback = false ) {
32
+ if ($ fallback ) {
33
+ foreach ( $ this ->_widths as $ index => $ value ) {
34
+ $ widths [$ index ] = $ value ;
35
+ }
36
+ }
31
37
$ this ->_widths = $ widths ;
32
38
}
33
39
You can’t perform that action at this time.
0 commit comments