Completed
Push — master ( 06db8f...7dd0ed )
by Francimar
04:19
created

Generic   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 24
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B setMode() 0 21 6
1
<?php
2
3
namespace Thermal\Profile;
4
5
use Thermal\Printer;
6
7
class Generic extends EscPOS
8
{
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