Passed
Pull Request — master (#10)
by
unknown
06:45
created

QRCode::getMagnification()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * This file is part of PhpAidc LabelPrinter package.
5
 *
6
 * © Appwilio (https://appwilio.com)
7
 * © JhaoDa (https://github.com/jhaoda)
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
declare(strict_types=1);
14
15
namespace PhpAidc\LabelPrinter\Command;
16
17
use PhpAidc\LabelPrinter\Contract\Command;
18
use PhpAidc\LabelPrinter\Command\Concerns\Alignable;
19
use PhpAidc\LabelPrinter\Command\Concerns\Rotatable;
20
use PhpAidc\LabelPrinter\Command\Concerns\PositionAware;
21
22
final class QRCode implements Command
23
{
24
    use Alignable;
25
    use Rotatable;
26
    use PositionAware;
27
28
    /** @var int|null */
29
    private $cellWidth;
30
31
    /** @var string */
32
    private $data;
33
34
    /** @var string|null */
35
    private $eccLevel;
36
37
    /** @var int|null */
38
    private $height;
0 ignored issues
show
introduced by
The private property $height is not used, and could be removed.
Loading history...
39
40
    /** @var int|null */
41
    private $magnification;
42
43
    /** @var string|null */
44
    private $mode;
45
46
    /** @var string|null */
47
    private $model;
48
49
    public function __construct(int $x, int $y, string $data, string $eccLevel, int $cellWidth, string $mode)
50
    {
51
        $this->x = $x;
52
        $this->y = $y;
53
        $this->data = $data;
54
        $this->cellWidth = $cellWidth;
55
        $this->eccLevel = $eccLevel;
56
        $this->mode = $mode;        
57
    }
58
59
    public function magnify(int $value)
60
    {
61
        $this->magnification = $value;
62
63
        return $this;
64
    }
65
  
66
    public function model(string $value)
67
    {
68
        $this->model = $value;
69
70
        return $this;
71
    }
72
73
    public function getCellWidth(): ?int
74
    {
75
        return $this->cellWidth;
76
    }
77
78
    public function getData(): string
79
    {
80
        return $this->data;
81
    }
82
83
    public function getECCLevel(): string
84
    {
85
        return $this->eccLevel;
86
    }
87
88
    public function getMagnification(): ?int
89
    {
90
        return $this->magnification;
91
    }
92
93
    public function getMode(): ?string
94
    {
95
        return $this->mode;
96
    }
97
98
    public function getModel(): ?string
99
    {
100
        return $this->model;
101
    }
102
103
}
104