1 | <?php |
||
8 | class WordWrapper |
||
9 | { |
||
10 | protected $width; |
||
11 | protected $minimumWidths; |
||
12 | |||
13 | // For now, hardcode these to match what the Symfony Table helper does. |
||
14 | // Note that these might actually need to be adjusted depending on the |
||
15 | // table style. |
||
16 | protected $extraPaddingAtBeginningOfLine = 0; |
||
17 | protected $extraPaddingAtEndOfLine = 0; |
||
18 | protected $paddingInEachCell = 3; |
||
19 | |||
20 | public function __construct($width) |
||
25 | |||
26 | /** |
||
27 | * Calculate our padding widths from the specified table style. |
||
28 | * @param TableStyle $style |
||
29 | */ |
||
30 | public function setPaddingFromStyle(TableStyle $style) |
||
43 | |||
44 | /** |
||
45 | * Calculate our padding widths from the specified table style. |
||
46 | * @param TableStyle $style |
||
47 | */ |
||
48 | public function setPaddingFromSymfony5Style(TableStyle $style) |
||
59 | |||
60 | /** |
||
61 | * If columns have minimum widths, then set them here. |
||
62 | * @param array $minimumWidths |
||
63 | */ |
||
64 | public function setMinimumWidths($minimumWidths) |
||
68 | |||
69 | /** |
||
70 | * Set the minimum width of just one column |
||
71 | */ |
||
72 | public function minimumWidth($colkey, $width) |
||
76 | |||
77 | /** |
||
78 | * Wrap the cells in each part of the provided data table |
||
79 | * @param array $rows |
||
80 | * @return array |
||
81 | */ |
||
82 | public function wrap($rows, $widths = []) |
||
101 | |||
102 | /** |
||
103 | * Determine what widths we'll use for wrapping. |
||
104 | */ |
||
105 | protected function calculateWidths($rows, $widths = []) |
||
126 | |||
127 | /** |
||
128 | * Wrap one cell. Guard against modifying non-strings and |
||
129 | * then call through to wordwrap(). |
||
130 | * |
||
131 | * @param mixed $cell |
||
132 | * @param string $cellWidth |
||
133 | * @return mixed |
||
134 | */ |
||
135 | protected function wrapCell($cell, $cellWidth) |
||
142 | } |
||
143 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.