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)
Mon, Apr 29, 8:00 PM
Unknown Object (File)
Mon, Apr 29, 7:59 PM
Unknown Object (File)
Mon, Apr 29, 7:59 PM
Unknown Object (File)
Thu, Apr 25, 8:12 PM
Unknown Object (File)
Mon, Apr 22, 10:46 PM
Unknown Object (File)
Fri, Apr 12, 3:20 PM
Unknown Object (File)
Fri, Apr 12, 3:20 PM
Unknown Object (File)
Fri, Apr 12, 3:20 PM
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
Branch
tablefix
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1154
Build 1154: [Placeholder Plan] Wait for 30 Seconds

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