File tree Expand file tree Collapse file tree 1 file changed +23
-8
lines changed Expand file tree Collapse file tree 1 file changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -122,32 +122,47 @@ protected function checkRow(array $row) {
122
122
* @see cli\Table::renderRow()
123
123
*/
124
124
public function display () {
125
+ foreach ( $ this ->getDisplayLines () as $ line ) {
126
+ Streams::line ( $ line );
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Get the table lines to output.
132
+ *
133
+ * @see cli\Table::display()
134
+ * @see cli\Table::renderRow()
135
+ *
136
+ * @return array
137
+ */
138
+ public function getDisplayLines () {
125
139
$ this ->_renderer ->setWidths ($ this ->_width );
126
140
$ border = $ this ->_renderer ->border ();
127
141
142
+ $ out = array ();
128
143
if (isset ($ border )) {
129
- Streams:: line ( $ border) ;
144
+ $ out [] = $ border ;
130
145
}
131
- Streams:: line ( $ this ->_renderer ->row ($ this ->_headers ) );
146
+ $ out [] = $ this ->_renderer ->row ($ this ->_headers );
132
147
if (isset ($ border )) {
133
- Streams:: line ( $ border) ;
148
+ $ out [] = $ border ;
134
149
}
135
150
136
151
foreach ($ this ->_rows as $ row ) {
137
- Streams:: line ( $ this ->_renderer ->row ($ row) );
152
+ $ out [] = $ this ->_renderer ->row ($ row );
138
153
}
139
154
140
155
if (isset ($ border )) {
141
- Streams:: line ( $ border) ;
156
+ $ out [] = $ border ;
142
157
}
143
158
144
159
if ($ this ->_footers ) {
145
- Streams:: line ( $ this ->_renderer ->row ($ this ->_footers ) );
160
+ $ out [] = $ this ->_renderer ->row ($ this ->_footers );
146
161
if (isset ($ border )) {
147
- Streams:: line ( $ border) ;
162
+ $ out [] = $ border ;
148
163
}
149
164
}
150
-
165
+ return $ out ;
151
166
}
152
167
153
168
/**
You can’t perform that action at this time.
0 commit comments