Raw   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
ccs 6
cts 7
cp 0.8571
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 3 1
A __construct() 0 6 2
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
19
/**
20
 * Sends raw command to the printer.
21
 */
22
final class Raw implements Command
23
{
24
    /** @var iterable */
25
    private $data;
26
27
    /**
28
     * @param iterable|string $data
29
     */
30 7
    public function __construct($data)
31
    {
32 7
        if (\is_string($data)) {
33 7
            $this->data = [$data];
34
        } else {
35
            $this->data = $data;
36
        }
37 7
    }
38
39 1
    public function getData(): iterable
40
    {
41 1
        return $this->data;
42
    }
43
}
44