Skip to content

Commit d57ef35

Browse files
rawilkactions-user
authored andcommitted
Prettified Code!
1 parent 3601d5e commit d57ef35

21 files changed

+400
-364
lines changed

docs/advanced-usage/custom-drivers.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -65,45 +65,45 @@ use Rawilk\Printing\Contracts\PrintJob;
6565

6666
class MyCustomDriver implements Driver
6767
{
68-
public function __construct(protected array $config = [])
68+
public function __construct(protected array $config = [])
6969
{
7070
}
71-
71+
7272
public function newPrintTask(): PrintTask
7373
{
7474
return new PrintTask;
7575
}
76-
76+
7777
public function printer(
7878
$printerId = null,
7979
): ?Printer {
8080
// ...
8181
}
82-
82+
8383
public function printers(
8484
?int $limit = null,
8585
?int $offset = null,
8686
?string $dir = null,
8787
): Collection {
8888
// ...
8989
}
90-
90+
9191
public function printJobs(
9292
?int $limit = null,
9393
?int $offset = null,
9494
?string $dir = null,
9595
): Collection {
9696
// ...
9797
}
98-
98+
9999
public function printJob(
100100
$jobId = null,
101101
): ?PrintJob {
102102
// ...
103103
}
104-
104+
105105
/**
106-
* Return all jobs from a given printer.
106+
* Return all jobs from a given printer.
107107
*/
108108
public function printerPrintJobs(
109109
$printerId,
@@ -113,13 +113,13 @@ class MyCustomDriver implements Driver
113113
): Collection {
114114
// ...
115115
}
116-
116+
117117
/**
118118
* Search for a print job from a given printer.
119119
*/
120120
public function printerPrintJob(
121121
$printerId,
122-
$jobId,
122+
$jobId,
123123
): ?PrintJob {
124124
// ...
125125
}
@@ -139,24 +139,24 @@ use Rawilk\Printing\Contracts\Printer as PrinterContract;
139139
class Printer implements PrinterContract
140140
{
141141
public function capabilities(): array {}
142-
142+
143143
public function description(): ?string {}
144-
144+
145145
public function id() {}
146-
146+
147147
public function isOnline() : bool {}
148-
148+
149149
public function name(): ?string {}
150-
150+
151151
public function status(): string {}
152-
152+
153153
public function trays(): array {}
154-
154+
155155
/**
156156
* @return Collection<int, \Rawilk\Printing\Contracts\PrintJob>
157157
*/
158158
public function jobs(): Collection {}
159-
159+
160160
public function toArray(): array {}
161161
}
162162
```
@@ -172,17 +172,17 @@ use Carbon\CarbonInterface;
172172
class PrintJob implements PrintJobContract
173173
{
174174
public function date(): ?CarbonInterface {}
175-
175+
176176
public function id() {}
177-
177+
178178
public function name(): ?string {}
179-
179+
180180
public function printerId() {}
181-
181+
182182
public function printerName(): ?string {}
183-
183+
184184
public function state(): ?string {}
185-
185+
186186
public function toArray(): array {}
187187
}
188188
```

docs/advanced-usage/macros.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ on several classes the package offers. This may be a preferred alternative to fo
1010

1111
The following classes are macroable:
1212

13-
- `Rawilk\Printing\Api\Cups\CupsClient`
14-
- `Rawilk\Printing\Api\Cups\CupsObject` - all cups resource objects are also macroable
15-
- `Rawilk\Printing\Api\Cups\PendingPrintJob`
16-
- `Rawilk\Printing\Api\PrintNode\PrintNodeClient`
17-
- `Rawilk\Printing\Api\PrintNode\PendingPrintJob`
18-
- `Rawilk\Printing\Api\PrintNode\PrintNodeObject` - all PrintNode resource objects are also macroable
19-
- `Rawilk\Printing\Drivers\Cups\Cups`
20-
- `Rawilk\Printing\Drivers\Cups\Entity\PrintJob`
21-
- `Rawilk\Printing\Drivers\Cups\Entity\Printer`
22-
- `Rawilk\Printing\Drivers\PrintNode\Enity\PrintJob`
23-
- `Rawilk\Printing\Drivers\PrintNode\Enity\Printer`
24-
- `Rawilk\Printing\Drivers\PrintNode\PrintNode`
25-
- `Rawilk\Printing\PrintTask`
26-
- `Rawilk\Printing\Printing`
27-
- `Rawilk\Printing\Receipts\ReceiptPrinter`
13+
- `Rawilk\Printing\Api\Cups\CupsClient`
14+
- `Rawilk\Printing\Api\Cups\CupsObject` - all cups resource objects are also macroable
15+
- `Rawilk\Printing\Api\Cups\PendingPrintJob`
16+
- `Rawilk\Printing\Api\PrintNode\PrintNodeClient`
17+
- `Rawilk\Printing\Api\PrintNode\PendingPrintJob`
18+
- `Rawilk\Printing\Api\PrintNode\PrintNodeObject` - all PrintNode resource objects are also macroable
19+
- `Rawilk\Printing\Drivers\Cups\Cups`
20+
- `Rawilk\Printing\Drivers\Cups\Entity\PrintJob`
21+
- `Rawilk\Printing\Drivers\Cups\Entity\Printer`
22+
- `Rawilk\Printing\Drivers\PrintNode\Enity\PrintJob`
23+
- `Rawilk\Printing\Drivers\PrintNode\Enity\Printer`
24+
- `Rawilk\Printing\Drivers\PrintNode\PrintNode`
25+
- `Rawilk\Printing\PrintTask`
26+
- `Rawilk\Printing\Printing`
27+
- `Rawilk\Printing\Receipts\ReceiptPrinter`

docs/advanced-usage/receipts.md

+26-25
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ $receipt = (string) (new ReceiptPrinter)
5151
The package's ReceiptPrinter implementation is actually a wrapper around the `Mike42\Escpos\Printer` class. Most method calls are forwarded to that class if they are not found on the `ReceiptPrinter`. Some methods have also been added to make interacting with it more convenient.
5252

5353
### Methods
54+
5455
<hr>
5556

5657
#### centerAlign
@@ -75,52 +76,52 @@ Right align any new text.
7576

7677
Set the left margin for any new text. The unit for the margin will be `dots`.
7778

78-
| param | type | default |
79-
| --- | --- | --- |
80-
| `$margin` | int | 0 |
79+
| param | type | default |
80+
| --------- | ---- | ------- |
81+
| `$margin` | int | 0 |
8182

8283
<hr>
8384

8485
#### lineHeight
8586

8687
Set the line height for any new text. The unit for the line height will be `dots`. Use `null` or omit the `$height` parameter to reset the line height to the printer's defaults for any new text.
8788

88-
| param | type | default |
89-
| --- | --- | --- |
90-
| `$height` | int|null | null |
89+
| param | type | default |
90+
| --------- | ---- | ------- | ---- |
91+
| `$height` | int | null | null |
9192

9293
<hr>
9394

9495
#### text
9596

9697
Write a line of text to the receipt.
9798

98-
| param | type | default | description |
99-
| --- | --- | --- |------------------------------------------------------------------------|
100-
| `$text` | string | | the text to print |
101-
| `$insertNewLine` | bool | true | Set to `true` to insert a new line character at the end of your string |
99+
| param | type | default | description |
100+
| ---------------- | ------ | ------- | ---------------------------------------------------------------------- |
101+
| `$text` | string | | the text to print |
102+
| `$insertNewLine` | bool | true | Set to `true` to insert a new line character at the end of your string |
102103

103104
<hr>
104105

105106
#### twoColumnText
106107

107108
Insert a line of text split into two columns, left and right justified. Useful for stuff like writing a line item and its price on a line.
108109

109-
| param | type |
110-
| --- | --- |
111-
| `$left` | string |
112-
| `$right` | string |
110+
| param | type |
111+
| -------- | ------ |
112+
| `$left` | string |
113+
| `$right` | string |
113114

114115
<hr>
115116

116117
#### barcode
117118

118119
Print a barcode to the receipt.
119120

120-
| param | type | default |
121-
| --- | --- |---------|
122-
| `$barcodeContent` | string | |
123-
| `$type` | int | `Mike42\Escpos\Printer::BARCODE_CODE39` |
121+
| param | type | default |
122+
| ----------------- | ------ | --------------------------------------- |
123+
| `$barcodeContent` | string | |
124+
| `$type` | int | `Mike42\Escpos\Printer::BARCODE_CODE39` |
124125

125126
<hr>
126127

@@ -146,18 +147,18 @@ Close the connection to the receipt printer (this package uses a `DummyConnectio
146147

147148
Instruct the receipt printer to cut the paper; can be called multiple times.
148149

149-
| param | type | default |
150-
| --- | --- | --- |
151-
| `$mode` | int | `Mike42\Escpos\Printer::CUT_FULL` |
152-
| `$lines` | int | 3 |
150+
| param | type | default |
151+
| -------- | ---- | --------------------------------- |
152+
| `$mode` | int | `Mike42\Escpos\Printer::CUT_FULL` |
153+
| `$lines` | int | 3 |
153154

154155
#### lines
155156

156157
Feed an empty line(s) to the receipt printer.
157158

158-
| param | type | default |
159-
| --- | --- | --- |
160-
| `$lines` | int | 1 |
159+
| param | type | default |
160+
| -------- | ---- | ------- |
161+
| `$lines` | int | 1 |
161162

162163
<hr>
163164

docs/basic-usage/basic-usage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ If you have a default printer id set in the config file, you can easily access t
3737

3838
```php
3939
// returns an instance of Rawilk\Printing\Contracts\Printer if the printer is found
40-
Printing::defaultPrinter();
40+
Printing::defaultPrinter();
4141

4242
// or for just the id
4343
Printing::defaultPrinterId();

docs/basic-usage/print-job.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Each print job object returned from a `Driver` should be an implementation of `R
1212
`Rawilk\Printing\Contracts\PrintJob`
1313

1414
### Methods
15+
1516
<hr>
1617

1718
#### date
@@ -66,11 +67,11 @@ The reported status of the job.
6667

6768
The print job object can also be cast to array or json, and it will return the following info:
6869

69-
- id
70-
- date
71-
- name
72-
- printerId
73-
- printerName
74-
- state
70+
- id
71+
- date
72+
- name
73+
- printerId
74+
- printerName
75+
- state
7576

7677
> {note} Some drivers may serialize this slightly different.

0 commit comments

Comments
 (0)