| @@ 43-50 (lines=8) @@ | ||
| 40 | * |
|
| 41 | * @return string |
|
| 42 | */ |
|
| 43 | protected function left() |
|
| 44 | { |
|
| 45 | if ($this->margin > 255 || $this->margin < 0) { |
|
| 46 | throw new \OutOfRangeException('The left margin must be between 0 and 255.'); |
|
| 47 | } |
|
| 48 | ||
| 49 | return chr(27) . chr(108) . chr($this->margin); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Set the right margin |
|
| @@ 57-64 (lines=8) @@ | ||
| 54 | * |
|
| 55 | * @return string |
|
| 56 | */ |
|
| 57 | protected function right() |
|
| 58 | { |
|
| 59 | if ($this->margin < 1 || $this->margin > 255) { |
|
| 60 | throw new \OutOfRangeException('The right margin must be between 1 and 255.'); |
|
| 61 | } |
|
| 62 | ||
| 63 | return chr(27) . chr(81) . chr($this->margin); |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||