Skip to content

Commit 1147ced

Browse files
StanBarrowsgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 90e1014 commit 1147ced

File tree

6 files changed

+52
-64
lines changed

6 files changed

+52
-64
lines changed

src/DTO/Dialog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function fake(
3939
?bool $isDefault = null,
4040
?string $fileCabinetId = null,
4141
): self {
42-
return new static(
42+
return new self(
4343
id: $id ?? (string) Str::uuid(),
4444
type: $type ?? Arr::random(['Search', 'Store', 'ResultList', 'InfoDialog']),
4545
label: $label ?? 'Fake Dialog',

src/DTO/Document.php

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public static function fromJson(array $data): self
2020
? self::convertFields(collect(Arr::get($data, 'Fields')))
2121
: null;
2222

23-
2423
return new self(
2524
id: $data['Id'],
2625
file_size: $data['FileSize'],
@@ -52,20 +51,19 @@ protected static function convertSuggestions(Collection $suggestions): Collectio
5251
}
5352

5453
public function __construct(
55-
public int $id,
56-
public int $file_size,
57-
public int $total_pages,
58-
public string $title,
59-
public string|null $extension,
60-
public string $content_type,
61-
public string $file_cabinet_id,
62-
public string|null $intellixTrust,
63-
public Carbon $created_at,
64-
public Carbon $updated_at,
54+
public int $id,
55+
public int $file_size,
56+
public int $total_pages,
57+
public string $title,
58+
public string|null $extension,
59+
public string $content_type,
60+
public string $file_cabinet_id,
61+
public string|null $intellixTrust,
62+
public Carbon $created_at,
63+
public Carbon $updated_at,
6564
public Collection|null $fields,
6665
public Collection|null $suggestions,
67-
)
68-
{
66+
) {
6967
}
7068

7169
public function isPdf(): bool
@@ -107,35 +105,34 @@ public function fileName(): string
107105
}
108106

109107
public static function fake(
110-
?int $id = null,
111-
?int $file_size = null,
112-
?int $total_pages = null,
113-
?string $title = null,
114-
?string $extension = null,
115-
?string $content_type = null,
116-
?string $file_cabinet_id = null,
117-
?string $intellixTrust = null,
118-
?Carbon $created_at = null,
119-
?Carbon $updated_at = null,
108+
?int $id = null,
109+
?int $file_size = null,
110+
?int $total_pages = null,
111+
?string $title = null,
112+
?string $extension = null,
113+
?string $content_type = null,
114+
?string $file_cabinet_id = null,
115+
?string $intellixTrust = null,
116+
?Carbon $created_at = null,
117+
?Carbon $updated_at = null,
120118
?Collection $fields = null,
121119
?Collection $suggestions = null,
122-
): self
123-
{
124-
return new static(
120+
): self {
121+
return new self(
125122
id: $id ?? random_int(1, 999999),
126123
file_size: $file_size ?? random_int(1000, 999999),
127124
total_pages: $total_pages ?? random_int(1, 100),
128125
title: $title ?? 'Fake Title',
129126
extension: $extension ?? '.pdf',
130127
content_type: $content_type ?? 'application/pdf',
131-
file_cabinet_id: $file_cabinet_id ?? (string)Str::uuid(),
128+
file_cabinet_id: $file_cabinet_id ?? (string) Str::uuid(),
132129
intellixTrust: $intellixTrust ?? 'Red',
133130
created_at: $created_at ?? now()->subDay(),
134131
updated_at: $updated_at ?? now(),
135132
fields: $fields ?? collect([
136-
DocumentField::fake(),
137-
DocumentField::fake(),
138-
]),
133+
DocumentField::fake(),
134+
DocumentField::fake(),
135+
]),
139136
suggestions: $suggestions ?? null
140137
);
141138
}

src/DTO/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static function fake(
4040
?string $type = null,
4141
?string $scope = null,
4242
): self {
43-
return new static(
43+
return new self(
4444
name: $name ?? 'FAKE_FIELD',
4545
label: $label ?? 'Fake Field',
4646
type: Arr::random(['Text', 'Memo', 'Numeric', 'Decimal', 'Date', 'DateTime', 'Keyword']),

src/DTO/FileCabinet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function fake(
3434
?bool $isBasket = null,
3535
?string $assignedCabinet = null,
3636
): self {
37-
return new static(
37+
return new self(
3838
id: $id ?? (string) Str::uuid(),
3939
name: $name ?? 'Fake File Cabinet',
4040
color: $color ?? Arr::random(['Red', 'Blue', 'Black', 'Green', 'Yellow']),

src/DTO/SuggestionField.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,19 @@ public static function fromJson(array $data): self
1717
}
1818

1919
public function __construct(
20-
public array $value,
20+
public array $value,
2121
public string|null $name,
2222
public string|null $db_name,
2323
public string|null $confidence,
24-
)
25-
{
24+
) {
2625
}
2726

2827
public static function fake(
29-
array $value = [],
28+
array $value = [],
3029
?string $name = null,
3130
?string $db_name = null,
3231
?string $confidence = null,
33-
): self
34-
{
32+
): self {
3533
return new self(
3634
value: $value ?? [],
3735
name: $name ?? 'Fake Name',

src/DocuWare.php

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function getFileCabinets(): Collection
9999

100100
$cabinets = $response->throw()->json('FileCabinet');
101101

102-
return collect($cabinets)->map(fn(array $cabinet) => FileCabinet::fromJson($cabinet));
102+
return collect($cabinets)->map(fn (array $cabinet) => FileCabinet::fromJson($cabinet));
103103
}
104104

105105
public function getFields(string $fileCabinetId): Collection
@@ -123,7 +123,7 @@ public function getFields(string $fileCabinetId): Collection
123123

124124
$fields = $response->throw()->json('Fields');
125125

126-
return collect($fields)->map(fn(array $field) => Field::fromJson($field));
126+
return collect($fields)->map(fn (array $field) => Field::fromJson($field));
127127
}
128128

129129
public function getDialogs(string $fileCabinetId): Collection
@@ -147,15 +147,14 @@ public function getDialogs(string $fileCabinetId): Collection
147147

148148
$dialogs = $response->throw()->json('Dialog');
149149

150-
return collect($dialogs)->map(fn(array $dialog) => Dialog::fromJson($dialog));
150+
return collect($dialogs)->map(fn (array $dialog) => Dialog::fromJson($dialog));
151151
}
152152

153153
public function getSelectList(
154154
string $fileCabinetId,
155155
string $dialogId,
156156
string $fieldName,
157-
): array
158-
{
157+
): array {
159158
EnsureValidCookie::check();
160159

161160
$url = sprintf(
@@ -207,9 +206,8 @@ public function getDocument(string $fileCabinetId, int $documentId): Document
207206

208207
public function getDocumentPreview(
209208
string $fileCabinetId,
210-
int $documentId,
211-
): string
212-
{
209+
int $documentId,
210+
): string {
213211
EnsureValidCookie::check();
214212

215213
$url = sprintf(
@@ -233,9 +231,8 @@ public function getDocumentPreview(
233231

234232
public function downloadDocument(
235233
string $fileCabinetId,
236-
int $documentId,
237-
): string
238-
{
234+
int $documentId,
235+
): string {
239236
EnsureValidCookie::check();
240237

241238
$url = sprintf(
@@ -259,9 +256,8 @@ public function downloadDocument(
259256

260257
public function downloadDocuments(
261258
string $fileCabinetId,
262-
array $documentIds,
263-
): string
264-
{
259+
array $documentIds,
260+
): string {
265261
EnsureValidCookie::check();
266262

267263
throw_if(
@@ -294,11 +290,10 @@ public function downloadDocuments(
294290

295291
public function updateDocumentValue(
296292
string $fileCabinetId,
297-
int $documentId,
293+
int $documentId,
298294
string $fieldName,
299295
string $newValue,
300-
): null|int|float|Carbon|string
301-
{
296+
): null|int|float|Carbon|string {
302297
EnsureValidCookie::check();
303298

304299
$url = sprintf(
@@ -332,12 +327,11 @@ public function updateDocumentValue(
332327
}
333328

334329
public function uploadDocument(
335-
string $fileCabinetId,
336-
string $fileContent,
337-
string $fileName,
330+
string $fileCabinetId,
331+
string $fileContent,
332+
string $fileName,
338333
?Collection $indexes = null,
339-
): Document
340-
{
334+
): Document {
341335
EnsureValidCookie::check();
342336

343337
$url = sprintf(
@@ -370,9 +364,8 @@ public function uploadDocument(
370364

371365
public function deleteDocument(
372366
string $fileCabinetId,
373-
int $documentId,
374-
): void
375-
{
367+
int $documentId,
368+
): void {
376369
EnsureValidCookie::check();
377370

378371
$url = sprintf(

0 commit comments

Comments
 (0)