Conditions | 6 |
Paths | 8 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
9 | 1 | protected function setMode($mode, $enable) |
|
10 | { |
||
11 | 1 | if ($enable) { |
|
12 | // enable styles |
||
13 | 1 | if (Printer::STYLE_DOUBLE_WIDTH & $mode) { |
|
14 | 1 | $this->getConnection()->write("\x0E"); |
|
15 | } |
||
16 | 1 | if (Printer::STYLE_DOUBLE_HEIGHT & $mode) { |
|
17 | 1 | $this->getConnection()->write("\ed1"); |
|
18 | } |
||
19 | } else { |
||
20 | // disable styles |
||
21 | 1 | if (Printer::STYLE_DOUBLE_HEIGHT & $mode) { |
|
22 | 1 | $this->getConnection()->write("\ed0"); |
|
23 | } |
||
24 | 1 | if (Printer::STYLE_DOUBLE_WIDTH & $mode) { |
|
25 | 1 | $this->getConnection()->write("\x14"); |
|
26 | } |
||
27 | } |
||
28 | 1 | return $this; |
|
29 | } |
||
30 | } |
||
31 |