@@ -1,8 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Consolidation\OutputFormatters\Transformations\Wrap; |
| 3 | 3 | |
| 4 | -use Symfony\Component\Console\Helper\TableStyle; |
|
| 5 | - |
|
| 6 | 4 | /** |
| 7 | 5 | * Calculate column widths for table cells. |
| 8 | 6 | * |
@@ -17,6 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * Given the total amount of available space, and the width of |
| 19 | 19 | * the columns to place, calculate the optimum column widths to use. |
| 20 | + * @param double $availableWidth |
|
| 20 | 21 | */ |
| 21 | 22 | public function calculate($availableWidth, DataCellWidths $dataWidths, DataCellWidths $minimumWidths) |
| 22 | 23 | { |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | { |
| 167 | 167 | return array_reduce( |
| 168 | 168 | $widths, |
| 169 | - function ($carry, $item) { |
|
| 169 | + function($carry, $item) { |
|
| 170 | 170 | return $carry + $item; |
| 171 | 171 | } |
| 172 | 172 | ); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | protected static function longestWordLength($str) |
| 181 | 181 | { |
| 182 | 182 | $words = preg_split('#[ /-]#', $str); |
| 183 | - $lengths = array_map(function ($s) { |
|
| 183 | + $lengths = array_map(function($s) { |
|
| 184 | 184 | return strlen($s); |
| 185 | 185 | }, $words); |
| 186 | 186 | return max($lengths); |
@@ -53,6 +53,9 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @param integer $paddingInEachCell |
|
| 58 | + */ |
|
| 56 | 59 | public function paddingSpace( |
| 57 | 60 | $paddingInEachCell, |
| 58 | 61 | $extraPaddingAtEndOfLine = 0, |
@@ -103,6 +106,7 @@ discard block |
||
| 103 | 106 | /** |
| 104 | 107 | * Need to think about the name of this function a bit. |
| 105 | 108 | * Maybe second parameter is just a column count. |
| 109 | + * @param double $availableWidth |
|
| 106 | 110 | */ |
| 107 | 111 | public function adjustMinimumWidths($availableWidth, DataCellWidths $dataCellWidths) |
| 108 | 112 | { |
@@ -157,6 +161,7 @@ discard block |
||
| 157 | 161 | |
| 158 | 162 | /** |
| 159 | 163 | * Return the length of the specified column. |
| 164 | + * @return string |
|
| 160 | 165 | */ |
| 161 | 166 | public function width($key) |
| 162 | 167 | { |
@@ -203,6 +208,7 @@ discard block |
||
| 203 | 208 | /** |
| 204 | 209 | * Ensure that every item in $widths that has a corresponding entry |
| 205 | 210 | * in $minimumWidths is as least as large as the minimum value held there. |
| 211 | + * @param DataCellWidths $minimumWidths |
|
| 206 | 212 | */ |
| 207 | 213 | public function enforceMinimums($minimumWidths) |
| 208 | 214 | { |
@@ -1,8 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Consolidation\OutputFormatters\Transformations\Wrap; |
| 3 | 3 | |
| 4 | -use Symfony\Component\Console\Helper\TableStyle; |
|
| 5 | - |
|
| 6 | 4 | /** |
| 7 | 5 | * Calculate the width of data in table cells in preparation for word wrapping. |
| 8 | 6 | */ |