Page MenuHomePhabricator

Fix the width of `PhutilConsoleTable` if the header row is wider than the data rows.
ClosedPublic

Authored by joshuaspence on Jun 16 2014, 10:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 4:30 PM
Unknown Object (File)
Fri, Dec 13, 1:24 PM
Unknown Object (File)
Sat, Dec 7, 3:23 PM
Unknown Object (File)
Thu, Dec 5, 8:21 AM
Unknown Object (File)
Mon, Dec 2, 4:03 PM
Unknown Object (File)
Sat, Nov 30, 4:11 PM
Unknown Object (File)
Thu, Nov 21, 2:10 AM
Unknown Object (File)
Thu, Nov 21, 2:10 AM
Subscribers

Details

Summary

Currently, the width of the header text is not taken into consideration when drawing the table. The width of the header text must be accounted for as if it were an ordinary row. Specifically, the following error occurs otherwise:

PHP Warning:  str_repeat(): Second argument has to be greater than or equal to 0 in /home/joshua/workspace/github.com/phacility/libphutil/src/console/PhutilConsoleTable.php on line 211
Test Plan

Drew a table with a really wide header column. verified that no warnings were raised and that the table rendered correctly.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Fix the width of `PhutilConsoleTable` if the header row is wider than the data rows..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
src/console/PhutilConsoleTable.php
197

This feels okay but not great (removing the padding here, that is).

epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 16 2014, 10:24 PM