Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function translate(QRCode $command): iterable |
||
22 | { |
||
23 | $instruction = \vsprintf('QRCODE %d,%d,%s,%d,%s', [ |
||
24 | $command->getX(), |
||
25 | $command->getY(), |
||
26 | $command->getECCLevel(), |
||
27 | $command->getCellWidth(), |
||
28 | $command->getMode() |
||
29 | ]); |
||
30 | |||
31 | // rotation |
||
32 | $instruction .= ','.$command->getRotation()->getDegrees(); |
||
33 | |||
34 | // model |
||
35 | if ($command->getModel()) { |
||
36 | $instruction .= ','.(string) $command->getModel(); |
||
37 | } |
||
38 | |||
39 | yield $instruction.\sprintf(',"%s"', $command->getData()); |
||
40 | } |
||
42 |