| @@ 116-127 (lines=12) @@ | ||
| 113 | ||
| 114 | // Determine the longest error message we will be showing. |
|
| 115 | $maxErrorLength = 0; |
|
| 116 | foreach ($report['messages'] as $line => $lineErrors) { |
|
| 117 | foreach ($lineErrors as $column => $colErrors) { |
|
| 118 | foreach ($colErrors as $error) { |
|
| 119 | $length = strlen($error['message']); |
|
| 120 | if ($showSources === true) { |
|
| 121 | $length += (strlen($error['source']) + 3); |
|
| 122 | } |
|
| 123 | ||
| 124 | $maxErrorLength = max($maxErrorLength, ($length + 1)); |
|
| 125 | } |
|
| 126 | } |
|
| 127 | } |
|
| 128 | ||
| 129 | // The padding that all lines will require that are printing an error message overflow. |
|
| 130 | if ($report['warnings'] > 0) { |
|
| @@ 64-75 (lines=12) @@ | ||
| 61 | ||
| 62 | // Make sure the report width isn't too big. |
|
| 63 | $maxErrorLength = 0; |
|
| 64 | foreach ($report['messages'] as $line => $lineErrors) { |
|
| 65 | foreach ($lineErrors as $column => $colErrors) { |
|
| 66 | foreach ($colErrors as $error) { |
|
| 67 | $length = strlen($error['message']); |
|
| 68 | if ($showSources === true) { |
|
| 69 | $length += (strlen($error['source']) + 3); |
|
| 70 | } |
|
| 71 | ||
| 72 | $maxErrorLength = max($maxErrorLength, ($length + 1)); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||
| 77 | $file = $report['filename']; |
|
| 78 | $fileLength = strlen($file); |
|