Test Setup Failed
Push — master ( b9c0be...6a3b1f )
by Francimar
06:58
created

ControliD::setStyle()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 9
cts 9
cp 1
rs 9.7
c 0
b 0
f 0
cc 4
nc 4
nop 2
crap 4
1
<?php
2
3
namespace Thermal\Profile;
4
5
use Thermal\Printer;
6
7
class ControliD extends Epson
8
{
9 1
    public function qrcode($data, $size)
10
    {
11 1
        $this->drawQrcode($data, $size);
12 1
    }
13
14 1
    protected function setStyle($style, $enable)
15
    {
16 1
        if ($enable) {
17
            // enable styles
18 1
            if (Printer::STYLE_BOLD == $style) {
19 1
                $this->getConnection()->write("\eE\x01");
20 1
                return $this;
21
            }
22
        } else {
23
            // disable styles
24 1
            if (Printer::STYLE_BOLD == $style) {
25 1
                $this->getConnection()->write("\eE\x00");
26 1
                return $this;
27
            }
28
        }
29 1
        return parent::setStyle($style, $enable);
30
    }
31
}
32