@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function addLine($prefix = '', $suffix = '', $delimiter = ' ') |
27 | 27 | { |
28 | 28 | $initialSpace = str_repeat(" ", $this->initialSpace); |
29 | - $count = $this->totalChars - $this->initialSpace - strlen($prefix) - strlen($suffix); |
|
29 | + $count = $this->totalChars - $this->initialSpace - strlen($prefix) - strlen($suffix); |
|
30 | 30 | if ($count > 0) |
31 | 31 | $delimiter = str_repeat($delimiter, $count); |
32 | 32 | $this->text .= $initialSpace . $prefix . $delimiter . $suffix . "\n"; |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | public function generatePrintData(Device $device, People $provider): Spool |
45 | 45 | { |
46 | 46 | $printer = null; |
47 | - $device_config = $this->deviceService->discoveryDeviceConfig($device, $provider); |
|
47 | + $device_config = $this->deviceService->discoveryDeviceConfig($device, $provider); |
|
48 | 48 | if (isset($device_config['printer'])) |
49 | 49 | $printer = $this->deviceService->discoveryDevice($device_config['printer']); |
50 | 50 | |
51 | 51 | error_log($printer->getDevice()); |
52 | 52 | |
53 | - $content = [ |
|
53 | + $content = [ |
|
54 | 54 | "operation" => "PRINT_TEXT", |
55 | 55 | "styles" => [[]], |
56 | 56 | "value" => [$this->text] |
@@ -27,8 +27,9 @@ discard block |
||
27 | 27 | { |
28 | 28 | $initialSpace = str_repeat(" ", $this->initialSpace); |
29 | 29 | $count = $this->totalChars - $this->initialSpace - strlen($prefix) - strlen($suffix); |
30 | - if ($count > 0) |
|
31 | - $delimiter = str_repeat($delimiter, $count); |
|
30 | + if ($count > 0) { |
|
31 | + $delimiter = str_repeat($delimiter, $count); |
|
32 | + } |
|
32 | 33 | $this->text .= $initialSpace . $prefix . $delimiter . $suffix . "\n"; |
33 | 34 | } |
34 | 35 | |
@@ -45,8 +46,9 @@ discard block |
||
45 | 46 | { |
46 | 47 | $printer = null; |
47 | 48 | $device_config = $this->deviceService->discoveryDeviceConfig($device, $provider); |
48 | - if (isset($device_config['printer'])) |
|
49 | - $printer = $this->deviceService->discoveryDevice($device_config['printer']); |
|
49 | + if (isset($device_config['printer'])) { |
|
50 | + $printer = $this->deviceService->discoveryDevice($device_config['printer']); |
|
51 | + } |
|
50 | 52 | |
51 | 53 | error_log($printer->getDevice()); |
52 | 54 | |
@@ -58,8 +60,9 @@ discard block |
||
58 | 60 | |
59 | 61 | $printData = $this->addToSpool($printer ?? $device, json_encode($content)); |
60 | 62 | |
61 | - if ($printer != $device) |
|
62 | - $x = ''; |
|
63 | + if ($printer != $device) { |
|
64 | + $x = ''; |
|
65 | + } |
|
63 | 66 | |
64 | 67 | return $printData; |
65 | 68 | } |