| Conditions | 5 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 7.3471 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | 1 | public static function pdfXPosition($pdf, $value, $x, $align = null) |
|
| 21 | { |
||
| 22 | 1 | switch ($align) { |
|
| 23 | 1 | case 'center': |
|
| 24 | return $x - ($pdf->GetStringWidth($value) / 2); |
||
| 25 | 1 | case 'right': |
|
| 26 | $x = $x - $pdf->GetStringWidth($value); |
||
| 27 | if ($x < 0) { |
||
| 28 | $x = 0; |
||
| 29 | } |
||
| 30 | return $x; |
||
| 31 | 1 | case 'left': |
|
| 32 | default: |
||
| 33 | 1 | return $x; |
|
| 34 | } |
||
| 73 |