| Conditions | 5 |
| Paths | 8 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 4 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 42 | 5 | public function getCellWidth($value, Font $font) |
|
| 43 | { |
||
| 44 | 5 | $width = 0.07 * $font->getSize(); |
|
| 45 | 5 | foreach (preg_split('~~u', $value, -1, PREG_SPLIT_NO_EMPTY) as $character) { |
|
| 46 | 5 | if (isset($this->characterWidths[$character])) { |
|
| 47 | 5 | $width += $this->characterWidths[$character]; |
|
| 48 | 5 | } elseif (strlen($character)) { |
|
| 49 | 2 | $width += 0.06 * $font->getSize(); |
|
| 50 | 2 | } |
|
| 51 | 5 | } |
|
| 52 | |||
| 53 | 5 | return $font->isBold() ? $width * $this->characterWidths['bold'] : $width; |
|
| 54 | } |
||
| 55 | |||
| 66 |