From 56f9b0d6b4a87def3123fcf05b53d6278401a42d Mon Sep 17 00:00:00 2001 From: StanBarrows Date: Mon, 8 Jul 2024 07:42:50 +0000 Subject: [PATCH 1/3] Fix styling --- src/DTO/Config.php | 3 +-- src/DTO/Cookie.php | 3 +-- src/DTO/Dialog.php | 3 +-- src/DTO/Document.php | 3 +-- src/DTO/DocumentField.php | 3 +-- src/DTO/DocumentIndex/IndexDateDTO.php | 4 +--- src/DTO/DocumentIndex/IndexDateTimeDTO.php | 4 +--- src/DTO/DocumentIndex/IndexDecimalDTO.php | 4 +--- src/DTO/DocumentIndex/IndexNumericDTO.php | 4 +--- src/DTO/DocumentIndex/IndexTableDTO.php | 4 +--- src/DTO/DocumentIndex/IndexTextDTO.php | 4 +--- src/DTO/DocumentPaginator.php | 3 +-- src/DTO/DocumentThumbnail.php | 3 +-- src/DTO/ErrorBag.php | 3 +-- src/DTO/Field.php | 3 +-- src/DTO/FileCabinet.php | 3 +-- src/DTO/Organization.php | 3 +-- src/DTO/OrganizationIndex.php | 3 +-- src/DTO/Section.php | 3 +-- src/DTO/SuggestionField.php | 3 +-- src/DTO/TableRow.php | 3 +-- src/Events/DocuWareCookieCreatedLog.php | 3 +-- src/Events/DocuWareResponseLog.php | 3 +-- src/Requests/Auth/PostLoginRequest.php | 3 +-- src/Requests/Dialogs/GetDialogRequest.php | 3 +-- src/Requests/Dialogs/GetDialogsRequest.php | 3 +-- src/Requests/Document/DeleteDocumentRequest.php | 3 +-- src/Requests/Document/GetDocumentCountRequest.php | 3 +-- src/Requests/Document/GetDocumentDownloadRequest.php | 3 +-- src/Requests/Document/GetDocumentPreviewRequest.php | 3 +-- src/Requests/Document/GetDocumentRequest.php | 3 +-- src/Requests/Document/GetDocumentsRequest.php | 3 +-- src/Requests/Document/PostDocumentRequest.php | 3 +-- src/Requests/Document/PostTransferDocumentRequest.php | 3 +-- src/Requests/Document/PutDocumentFieldsRequest.php | 3 +-- .../Thumbnail/GetDocumentDownloadThumbnailRequest.php | 3 +-- src/Requests/Fields/GetFieldsRequest.php | 3 +-- src/Requests/Organization/GetOrganizationRequest.php | 3 +-- src/Requests/Search/GetSearchRequest.php | 3 +-- src/Requests/Sections/GetSectionsRequest.php | 3 +-- src/Requests/SelectList/GetSelectListRequest.php | 3 +-- 41 files changed, 41 insertions(+), 88 deletions(-) diff --git a/src/DTO/Config.php b/src/DTO/Config.php index c9e9ce38..4653864f 100644 --- a/src/DTO/Config.php +++ b/src/DTO/Config.php @@ -23,6 +23,5 @@ public function __construct( public string $cacheDriver, public int $cacheLifetimeInSeconds, public string $requestTimeoutInSeconds, - ) { - } + ) {} } diff --git a/src/DTO/Cookie.php b/src/DTO/Cookie.php index 946d3e84..6375f46d 100644 --- a/src/DTO/Cookie.php +++ b/src/DTO/Cookie.php @@ -13,8 +13,7 @@ public function __construct( public string $cookie, public Carbon $cookie_created_at, public Carbon $cookie_lifetime_until, - ) { - } + ) {} public static function make(CookieJar $cookieJar): self { diff --git a/src/DTO/Dialog.php b/src/DTO/Dialog.php index 11edc64e..73bfb19f 100644 --- a/src/DTO/Dialog.php +++ b/src/DTO/Dialog.php @@ -26,8 +26,7 @@ public function __construct( public bool $isDefault, public string $fileCabinetId, public ?array $fields = null, - ) { - } + ) {} public function isSearch(): bool { diff --git a/src/DTO/Document.php b/src/DTO/Document.php index 9e464e5a..233fdc67 100644 --- a/src/DTO/Document.php +++ b/src/DTO/Document.php @@ -63,8 +63,7 @@ public function __construct( public Carbon $updated_at, public ?Collection $fields, public ?Collection $suggestions, - ) { - } + ) {} public function isPdf(): bool { diff --git a/src/DTO/DocumentField.php b/src/DTO/DocumentField.php index 46aa8b9c..9b033b45 100644 --- a/src/DTO/DocumentField.php +++ b/src/DTO/DocumentField.php @@ -28,8 +28,7 @@ public function __construct( public bool $isNull, public null|int|float|Carbon|string|Collection $value, public string $type, - ) { - } + ) {} public static function fake( ?bool $systemField = false, diff --git a/src/DTO/DocumentIndex/IndexDateDTO.php b/src/DTO/DocumentIndex/IndexDateDTO.php index c2fad49b..63d1f617 100644 --- a/src/DTO/DocumentIndex/IndexDateDTO.php +++ b/src/DTO/DocumentIndex/IndexDateDTO.php @@ -9,9 +9,7 @@ class IndexDateDTO public function __construct( public string $name, public null|Carbon|\Carbon\Carbon $value, - ) { - - } + ) {} public static function make(string $name, null|Carbon|\Carbon\Carbon $value): self { diff --git a/src/DTO/DocumentIndex/IndexDateTimeDTO.php b/src/DTO/DocumentIndex/IndexDateTimeDTO.php index 491a1d15..2756d900 100644 --- a/src/DTO/DocumentIndex/IndexDateTimeDTO.php +++ b/src/DTO/DocumentIndex/IndexDateTimeDTO.php @@ -9,9 +9,7 @@ class IndexDateTimeDTO public function __construct( public string $name, public null|Carbon|\Carbon\Carbon $value, - ) { - - } + ) {} public static function make(string $name, null|Carbon|\Carbon\Carbon $value): self { diff --git a/src/DTO/DocumentIndex/IndexDecimalDTO.php b/src/DTO/DocumentIndex/IndexDecimalDTO.php index 2d897181..c1ff0d6c 100644 --- a/src/DTO/DocumentIndex/IndexDecimalDTO.php +++ b/src/DTO/DocumentIndex/IndexDecimalDTO.php @@ -7,9 +7,7 @@ class IndexDecimalDTO public function __construct( public string $name, public null|int|float $value, - ) { - - } + ) {} public static function make(string $name, null|int|float $value): self { diff --git a/src/DTO/DocumentIndex/IndexNumericDTO.php b/src/DTO/DocumentIndex/IndexNumericDTO.php index 4fc97641..f462b6b2 100644 --- a/src/DTO/DocumentIndex/IndexNumericDTO.php +++ b/src/DTO/DocumentIndex/IndexNumericDTO.php @@ -9,9 +9,7 @@ class IndexNumericDTO public function __construct( public string $name, public ?int $value, - ) { - - } + ) {} public static function make(string $name, ?int $value): self { diff --git a/src/DTO/DocumentIndex/IndexTableDTO.php b/src/DTO/DocumentIndex/IndexTableDTO.php index efba7849..725c6865 100644 --- a/src/DTO/DocumentIndex/IndexTableDTO.php +++ b/src/DTO/DocumentIndex/IndexTableDTO.php @@ -10,9 +10,7 @@ class IndexTableDTO public function __construct( public string $name, public null|Collection|array $rows, - ) { - - } + ) {} public static function make(string $name, null|Collection|array $rows): self { diff --git a/src/DTO/DocumentIndex/IndexTextDTO.php b/src/DTO/DocumentIndex/IndexTextDTO.php index a495fc41..d8a9f39b 100644 --- a/src/DTO/DocumentIndex/IndexTextDTO.php +++ b/src/DTO/DocumentIndex/IndexTextDTO.php @@ -7,9 +7,7 @@ class IndexTextDTO public function __construct( public string $name, public ?string $value, - ) { - - } + ) {} public static function make(string $name, ?string $value): self { diff --git a/src/DTO/DocumentPaginator.php b/src/DTO/DocumentPaginator.php index e9ea9514..0439dd4a 100644 --- a/src/DTO/DocumentPaginator.php +++ b/src/DTO/DocumentPaginator.php @@ -20,8 +20,7 @@ public function __construct( public int $to, public Collection $documents, public ?ErrorBag $error = null, - ) { - } + ) {} public function showPrev(): bool { diff --git a/src/DTO/DocumentThumbnail.php b/src/DTO/DocumentThumbnail.php index 3d0d384b..68564e89 100644 --- a/src/DTO/DocumentThumbnail.php +++ b/src/DTO/DocumentThumbnail.php @@ -22,6 +22,5 @@ public function __construct( public string $mime, public string $data, public string $base64, - ) { - } + ) {} } diff --git a/src/DTO/ErrorBag.php b/src/DTO/ErrorBag.php index b83a1865..814f4cdc 100644 --- a/src/DTO/ErrorBag.php +++ b/src/DTO/ErrorBag.php @@ -9,8 +9,7 @@ class ErrorBag public function __construct( public int $code, public string $message, - ) { - } + ) {} public static function make(Exception $e): self { diff --git a/src/DTO/Field.php b/src/DTO/Field.php index 0a55c4ce..cab95f00 100644 --- a/src/DTO/Field.php +++ b/src/DTO/Field.php @@ -21,8 +21,7 @@ public function __construct( public string $label, public string $type, public string $scope, - ) { - } + ) {} public function isSystem(): bool { diff --git a/src/DTO/FileCabinet.php b/src/DTO/FileCabinet.php index 2dc68c44..af6948eb 100644 --- a/src/DTO/FileCabinet.php +++ b/src/DTO/FileCabinet.php @@ -24,8 +24,7 @@ public function __construct( public string $color, public bool $isBasket, public ?string $assignedCabinet, - ) { - } + ) {} public static function fake( ?string $id = null, diff --git a/src/DTO/Organization.php b/src/DTO/Organization.php index 7e49651d..6864acf7 100644 --- a/src/DTO/Organization.php +++ b/src/DTO/Organization.php @@ -24,8 +24,7 @@ public function __construct( public ?string $guid = null, public array $additionalInfo = [], public array $configurationRights = [], - ) { - } + ) {} public static function fake( ?string $id = null, diff --git a/src/DTO/OrganizationIndex.php b/src/DTO/OrganizationIndex.php index ef72e96c..99b97305 100644 --- a/src/DTO/OrganizationIndex.php +++ b/src/DTO/OrganizationIndex.php @@ -20,8 +20,7 @@ public function __construct( public string $id, public string $name, public ?string $guid = null, - ) { - } + ) {} public static function fake( ?string $id = null, diff --git a/src/DTO/Section.php b/src/DTO/Section.php index 7ce0a2d1..ca9b045b 100644 --- a/src/DTO/Section.php +++ b/src/DTO/Section.php @@ -31,6 +31,5 @@ public function __construct( public string $contentModified, public bool $annotationsPreview, public ?bool $hasTextAnnotations = null, - ) { - } + ) {} } diff --git a/src/DTO/SuggestionField.php b/src/DTO/SuggestionField.php index a5d933e9..6e0a11ee 100644 --- a/src/DTO/SuggestionField.php +++ b/src/DTO/SuggestionField.php @@ -21,8 +21,7 @@ public function __construct( public ?string $name, public ?string $db_name, public ?string $confidence, - ) { - } + ) {} public static function fake( array $value = [], diff --git a/src/DTO/TableRow.php b/src/DTO/TableRow.php index 9b12a84a..8245b05d 100644 --- a/src/DTO/TableRow.php +++ b/src/DTO/TableRow.php @@ -24,8 +24,7 @@ protected static function convertFields(Collection $fields): Collection public function __construct( public Collection $fields, - ) { - } + ) {} public static function fake( ?Collection $fields = null, diff --git a/src/Events/DocuWareCookieCreatedLog.php b/src/Events/DocuWareCookieCreatedLog.php index 433a7d1f..e330e08f 100644 --- a/src/Events/DocuWareCookieCreatedLog.php +++ b/src/Events/DocuWareCookieCreatedLog.php @@ -14,6 +14,5 @@ class DocuWareCookieCreatedLog public function __construct( public string $message - ) { - } + ) {} } diff --git a/src/Events/DocuWareResponseLog.php b/src/Events/DocuWareResponseLog.php index 662bb765..23250dfa 100644 --- a/src/Events/DocuWareResponseLog.php +++ b/src/Events/DocuWareResponseLog.php @@ -16,6 +16,5 @@ class DocuWareResponseLog public function __construct( public Response|SaloonResponse $response - ) { - } + ) {} } diff --git a/src/Requests/Auth/PostLoginRequest.php b/src/Requests/Auth/PostLoginRequest.php index e14deb6e..543758b3 100644 --- a/src/Requests/Auth/PostLoginRequest.php +++ b/src/Requests/Auth/PostLoginRequest.php @@ -23,8 +23,7 @@ public function __construct( protected readonly bool $rememberMe = false, protected readonly bool $redirectToMyselfInCaseOfError = false, protected readonly ?string $licenseType = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Dialogs/GetDialogRequest.php b/src/Requests/Dialogs/GetDialogRequest.php index 22fbe358..46cf112e 100644 --- a/src/Requests/Dialogs/GetDialogRequest.php +++ b/src/Requests/Dialogs/GetDialogRequest.php @@ -20,8 +20,7 @@ class GetDialogRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $dialogId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Dialogs/GetDialogsRequest.php b/src/Requests/Dialogs/GetDialogsRequest.php index e8731fb1..19eefe3b 100644 --- a/src/Requests/Dialogs/GetDialogsRequest.php +++ b/src/Requests/Dialogs/GetDialogsRequest.php @@ -19,8 +19,7 @@ class GetDialogsRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/DeleteDocumentRequest.php b/src/Requests/Document/DeleteDocumentRequest.php index cb359062..811b01c5 100644 --- a/src/Requests/Document/DeleteDocumentRequest.php +++ b/src/Requests/Document/DeleteDocumentRequest.php @@ -14,8 +14,7 @@ class DeleteDocumentRequest extends Request public function __construct( protected readonly string $fileCabinetId, protected readonly string $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentCountRequest.php b/src/Requests/Document/GetDocumentCountRequest.php index d33b6e0d..ac35c47c 100644 --- a/src/Requests/Document/GetDocumentCountRequest.php +++ b/src/Requests/Document/GetDocumentCountRequest.php @@ -20,8 +20,7 @@ class GetDocumentCountRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $dialogId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentDownloadRequest.php b/src/Requests/Document/GetDocumentDownloadRequest.php index 09c2a641..faa705e8 100644 --- a/src/Requests/Document/GetDocumentDownloadRequest.php +++ b/src/Requests/Document/GetDocumentDownloadRequest.php @@ -20,8 +20,7 @@ class GetDocumentDownloadRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly int $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentPreviewRequest.php b/src/Requests/Document/GetDocumentPreviewRequest.php index 2fc42e27..778df9fa 100644 --- a/src/Requests/Document/GetDocumentPreviewRequest.php +++ b/src/Requests/Document/GetDocumentPreviewRequest.php @@ -20,8 +20,7 @@ class GetDocumentPreviewRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentRequest.php b/src/Requests/Document/GetDocumentRequest.php index 9b11bc35..0c4c6120 100644 --- a/src/Requests/Document/GetDocumentRequest.php +++ b/src/Requests/Document/GetDocumentRequest.php @@ -21,8 +21,7 @@ class GetDocumentRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentsRequest.php b/src/Requests/Document/GetDocumentsRequest.php index d71cb77d..1e3b2727 100644 --- a/src/Requests/Document/GetDocumentsRequest.php +++ b/src/Requests/Document/GetDocumentsRequest.php @@ -22,8 +22,7 @@ public function __construct( protected readonly string $fileCabinetId, protected readonly int $page = 1, protected readonly int $perPage = 50, - ) { - } + ) {} public function defaultQuery(): array { diff --git a/src/Requests/Document/PostDocumentRequest.php b/src/Requests/Document/PostDocumentRequest.php index 47a5b20d..28fa506b 100644 --- a/src/Requests/Document/PostDocumentRequest.php +++ b/src/Requests/Document/PostDocumentRequest.php @@ -24,8 +24,7 @@ public function __construct( protected readonly ?string $fileContent, protected readonly ?string $fileName, protected readonly ?Collection $indexes = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/PostTransferDocumentRequest.php b/src/Requests/Document/PostTransferDocumentRequest.php index c7928587..2253ea5c 100644 --- a/src/Requests/Document/PostTransferDocumentRequest.php +++ b/src/Requests/Document/PostTransferDocumentRequest.php @@ -21,8 +21,7 @@ public function __construct( protected readonly string $storeDialogId, protected readonly string $documentId, protected readonly array $fields = [], - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/PutDocumentFieldsRequest.php b/src/Requests/Document/PutDocumentFieldsRequest.php index 9b88165f..62619aec 100644 --- a/src/Requests/Document/PutDocumentFieldsRequest.php +++ b/src/Requests/Document/PutDocumentFieldsRequest.php @@ -26,8 +26,7 @@ public function __construct( protected readonly string $documentId, protected readonly ?Collection $indexes = null, protected readonly bool $forceUpdate = false, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php b/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php index ea084188..ebc8601c 100644 --- a/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php +++ b/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php @@ -21,8 +21,7 @@ public function __construct( protected readonly string $fileCabinetId, protected readonly string $thumbnailId, protected readonly int $page = 0, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Fields/GetFieldsRequest.php b/src/Requests/Fields/GetFieldsRequest.php index 3361f532..614b9e10 100644 --- a/src/Requests/Fields/GetFieldsRequest.php +++ b/src/Requests/Fields/GetFieldsRequest.php @@ -21,8 +21,7 @@ class GetFieldsRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Organization/GetOrganizationRequest.php b/src/Requests/Organization/GetOrganizationRequest.php index e85b322d..d67d290f 100644 --- a/src/Requests/Organization/GetOrganizationRequest.php +++ b/src/Requests/Organization/GetOrganizationRequest.php @@ -20,8 +20,7 @@ class GetOrganizationRequest extends Request implements Cacheable public function __construct( public string $organizationId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Search/GetSearchRequest.php b/src/Requests/Search/GetSearchRequest.php index a06800e9..f4df557f 100644 --- a/src/Requests/Search/GetSearchRequest.php +++ b/src/Requests/Search/GetSearchRequest.php @@ -31,8 +31,7 @@ public function __construct( protected readonly string $orderField = 'DWSTOREDATETIME', protected readonly string $orderDirection = 'asc', protected readonly array $condition = [], - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Sections/GetSectionsRequest.php b/src/Requests/Sections/GetSectionsRequest.php index 7609933e..06d96a9d 100644 --- a/src/Requests/Sections/GetSectionsRequest.php +++ b/src/Requests/Sections/GetSectionsRequest.php @@ -22,8 +22,7 @@ class GetSectionsRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly int $documentId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/SelectList/GetSelectListRequest.php b/src/Requests/SelectList/GetSelectListRequest.php index e6dd8196..d31ffe72 100644 --- a/src/Requests/SelectList/GetSelectListRequest.php +++ b/src/Requests/SelectList/GetSelectListRequest.php @@ -21,8 +21,7 @@ public function __construct( protected readonly string $fileCabinetId, protected readonly string $dialogId, protected readonly string $fieldName, - ) { - } + ) {} public function resolveEndpoint(): string { From 3d8bf58b8fc664a18c8f4a27a0d336ae04178113 Mon Sep 17 00:00:00 2001 From: Sebastian Fix Date: Mon, 8 Jul 2024 09:42:52 +0200 Subject: [PATCH 2/3] Updated Date Conversion --- .phpunit.cache/test-results | 1 + src/DTO/Config.php | 3 +- src/DTO/Cookie.php | 3 +- src/DTO/Dialog.php | 3 +- src/DTO/Document.php | 3 +- src/DTO/DocumentField.php | 3 +- src/DTO/DocumentIndex/IndexDateDTO.php | 6 +- src/DTO/DocumentIndex/IndexDateTimeDTO.php | 6 +- src/DTO/DocumentIndex/IndexDecimalDTO.php | 4 +- src/DTO/DocumentIndex/IndexNumericDTO.php | 4 +- src/DTO/DocumentIndex/IndexTableDTO.php | 4 +- src/DTO/DocumentIndex/IndexTextDTO.php | 4 +- src/DTO/DocumentPaginator.php | 3 +- src/DTO/DocumentThumbnail.php | 3 +- src/DTO/ErrorBag.php | 3 +- src/DTO/Field.php | 3 +- src/DTO/FileCabinet.php | 3 +- src/DTO/Organization.php | 3 +- src/DTO/OrganizationIndex.php | 3 +- src/DTO/Section.php | 3 +- src/DTO/SuggestionField.php | 3 +- src/DTO/TableRow.php | 3 +- src/Events/DocuWareCookieCreatedLog.php | 3 +- src/Events/DocuWareResponseLog.php | 3 +- src/Requests/Auth/PostLoginRequest.php | 3 +- src/Requests/Dialogs/GetDialogRequest.php | 3 +- src/Requests/Dialogs/GetDialogsRequest.php | 3 +- .../Document/DeleteDocumentRequest.php | 3 +- .../Document/GetDocumentCountRequest.php | 3 +- .../Document/GetDocumentDownloadRequest.php | 3 +- .../Document/GetDocumentPreviewRequest.php | 3 +- src/Requests/Document/GetDocumentRequest.php | 3 +- src/Requests/Document/GetDocumentsRequest.php | 3 +- src/Requests/Document/PostDocumentRequest.php | 3 +- .../Document/PostTransferDocumentRequest.php | 3 +- .../Document/PutDocumentFieldsRequest.php | 3 +- .../GetDocumentDownloadThumbnailRequest.php | 3 +- src/Requests/Fields/GetFieldsRequest.php | 3 +- .../Organization/GetOrganizationRequest.php | 3 +- src/Requests/Search/GetSearchRequest.php | 3 +- src/Requests/Sections/GetSectionsRequest.php | 3 +- .../SelectList/GetSelectListRequest.php | 3 +- .../UpdateNichtHandelsrechnungenTest.php | 89 +++++++++++++++++++ 43 files changed, 133 insertions(+), 90 deletions(-) create mode 100644 .phpunit.cache/test-results create mode 100644 tests/Local/UpdateNichtHandelsrechnungenTest.php diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 00000000..726f8fdf --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":"pest_2.34.7","defects":[],"times":{"P\\Tests\\Local\\UpdateNichtHandelsrechnungenTest::__pest_evaluable_it_can_update_a_document_value":7.343}} \ No newline at end of file diff --git a/src/DTO/Config.php b/src/DTO/Config.php index c9e9ce38..4653864f 100644 --- a/src/DTO/Config.php +++ b/src/DTO/Config.php @@ -23,6 +23,5 @@ public function __construct( public string $cacheDriver, public int $cacheLifetimeInSeconds, public string $requestTimeoutInSeconds, - ) { - } + ) {} } diff --git a/src/DTO/Cookie.php b/src/DTO/Cookie.php index 946d3e84..6375f46d 100644 --- a/src/DTO/Cookie.php +++ b/src/DTO/Cookie.php @@ -13,8 +13,7 @@ public function __construct( public string $cookie, public Carbon $cookie_created_at, public Carbon $cookie_lifetime_until, - ) { - } + ) {} public static function make(CookieJar $cookieJar): self { diff --git a/src/DTO/Dialog.php b/src/DTO/Dialog.php index 11edc64e..73bfb19f 100644 --- a/src/DTO/Dialog.php +++ b/src/DTO/Dialog.php @@ -26,8 +26,7 @@ public function __construct( public bool $isDefault, public string $fileCabinetId, public ?array $fields = null, - ) { - } + ) {} public function isSearch(): bool { diff --git a/src/DTO/Document.php b/src/DTO/Document.php index 9e464e5a..233fdc67 100644 --- a/src/DTO/Document.php +++ b/src/DTO/Document.php @@ -63,8 +63,7 @@ public function __construct( public Carbon $updated_at, public ?Collection $fields, public ?Collection $suggestions, - ) { - } + ) {} public function isPdf(): bool { diff --git a/src/DTO/DocumentField.php b/src/DTO/DocumentField.php index 46aa8b9c..9b033b45 100644 --- a/src/DTO/DocumentField.php +++ b/src/DTO/DocumentField.php @@ -28,8 +28,7 @@ public function __construct( public bool $isNull, public null|int|float|Carbon|string|Collection $value, public string $type, - ) { - } + ) {} public static function fake( ?bool $systemField = false, diff --git a/src/DTO/DocumentIndex/IndexDateDTO.php b/src/DTO/DocumentIndex/IndexDateDTO.php index c2fad49b..2237f96e 100644 --- a/src/DTO/DocumentIndex/IndexDateDTO.php +++ b/src/DTO/DocumentIndex/IndexDateDTO.php @@ -9,9 +9,7 @@ class IndexDateDTO public function __construct( public string $name, public null|Carbon|\Carbon\Carbon $value, - ) { - - } + ) {} public static function make(string $name, null|Carbon|\Carbon\Carbon $value): self { @@ -30,7 +28,7 @@ public function values(): array { return [ 'FieldName' => $this->name, - 'Item' => $this->value->toDateString(), + 'Item' => $this->value?->toDateString(), 'ItemElementName' => 'String', ]; } diff --git a/src/DTO/DocumentIndex/IndexDateTimeDTO.php b/src/DTO/DocumentIndex/IndexDateTimeDTO.php index 491a1d15..90b996a2 100644 --- a/src/DTO/DocumentIndex/IndexDateTimeDTO.php +++ b/src/DTO/DocumentIndex/IndexDateTimeDTO.php @@ -9,9 +9,7 @@ class IndexDateTimeDTO public function __construct( public string $name, public null|Carbon|\Carbon\Carbon $value, - ) { - - } + ) {} public static function make(string $name, null|Carbon|\Carbon\Carbon $value): self { @@ -30,7 +28,7 @@ public function values(): array { return [ 'FieldName' => $this->name, - 'Item' => $this->value->toDateTimeString(), + 'Item' => $this->value?->toDateTimeString(), 'ItemElementName' => 'String', ]; } diff --git a/src/DTO/DocumentIndex/IndexDecimalDTO.php b/src/DTO/DocumentIndex/IndexDecimalDTO.php index 2d897181..c1ff0d6c 100644 --- a/src/DTO/DocumentIndex/IndexDecimalDTO.php +++ b/src/DTO/DocumentIndex/IndexDecimalDTO.php @@ -7,9 +7,7 @@ class IndexDecimalDTO public function __construct( public string $name, public null|int|float $value, - ) { - - } + ) {} public static function make(string $name, null|int|float $value): self { diff --git a/src/DTO/DocumentIndex/IndexNumericDTO.php b/src/DTO/DocumentIndex/IndexNumericDTO.php index 4fc97641..f462b6b2 100644 --- a/src/DTO/DocumentIndex/IndexNumericDTO.php +++ b/src/DTO/DocumentIndex/IndexNumericDTO.php @@ -9,9 +9,7 @@ class IndexNumericDTO public function __construct( public string $name, public ?int $value, - ) { - - } + ) {} public static function make(string $name, ?int $value): self { diff --git a/src/DTO/DocumentIndex/IndexTableDTO.php b/src/DTO/DocumentIndex/IndexTableDTO.php index efba7849..725c6865 100644 --- a/src/DTO/DocumentIndex/IndexTableDTO.php +++ b/src/DTO/DocumentIndex/IndexTableDTO.php @@ -10,9 +10,7 @@ class IndexTableDTO public function __construct( public string $name, public null|Collection|array $rows, - ) { - - } + ) {} public static function make(string $name, null|Collection|array $rows): self { diff --git a/src/DTO/DocumentIndex/IndexTextDTO.php b/src/DTO/DocumentIndex/IndexTextDTO.php index a495fc41..d8a9f39b 100644 --- a/src/DTO/DocumentIndex/IndexTextDTO.php +++ b/src/DTO/DocumentIndex/IndexTextDTO.php @@ -7,9 +7,7 @@ class IndexTextDTO public function __construct( public string $name, public ?string $value, - ) { - - } + ) {} public static function make(string $name, ?string $value): self { diff --git a/src/DTO/DocumentPaginator.php b/src/DTO/DocumentPaginator.php index e9ea9514..0439dd4a 100644 --- a/src/DTO/DocumentPaginator.php +++ b/src/DTO/DocumentPaginator.php @@ -20,8 +20,7 @@ public function __construct( public int $to, public Collection $documents, public ?ErrorBag $error = null, - ) { - } + ) {} public function showPrev(): bool { diff --git a/src/DTO/DocumentThumbnail.php b/src/DTO/DocumentThumbnail.php index 3d0d384b..68564e89 100644 --- a/src/DTO/DocumentThumbnail.php +++ b/src/DTO/DocumentThumbnail.php @@ -22,6 +22,5 @@ public function __construct( public string $mime, public string $data, public string $base64, - ) { - } + ) {} } diff --git a/src/DTO/ErrorBag.php b/src/DTO/ErrorBag.php index b83a1865..814f4cdc 100644 --- a/src/DTO/ErrorBag.php +++ b/src/DTO/ErrorBag.php @@ -9,8 +9,7 @@ class ErrorBag public function __construct( public int $code, public string $message, - ) { - } + ) {} public static function make(Exception $e): self { diff --git a/src/DTO/Field.php b/src/DTO/Field.php index 0a55c4ce..cab95f00 100644 --- a/src/DTO/Field.php +++ b/src/DTO/Field.php @@ -21,8 +21,7 @@ public function __construct( public string $label, public string $type, public string $scope, - ) { - } + ) {} public function isSystem(): bool { diff --git a/src/DTO/FileCabinet.php b/src/DTO/FileCabinet.php index 2dc68c44..af6948eb 100644 --- a/src/DTO/FileCabinet.php +++ b/src/DTO/FileCabinet.php @@ -24,8 +24,7 @@ public function __construct( public string $color, public bool $isBasket, public ?string $assignedCabinet, - ) { - } + ) {} public static function fake( ?string $id = null, diff --git a/src/DTO/Organization.php b/src/DTO/Organization.php index 7e49651d..6864acf7 100644 --- a/src/DTO/Organization.php +++ b/src/DTO/Organization.php @@ -24,8 +24,7 @@ public function __construct( public ?string $guid = null, public array $additionalInfo = [], public array $configurationRights = [], - ) { - } + ) {} public static function fake( ?string $id = null, diff --git a/src/DTO/OrganizationIndex.php b/src/DTO/OrganizationIndex.php index ef72e96c..99b97305 100644 --- a/src/DTO/OrganizationIndex.php +++ b/src/DTO/OrganizationIndex.php @@ -20,8 +20,7 @@ public function __construct( public string $id, public string $name, public ?string $guid = null, - ) { - } + ) {} public static function fake( ?string $id = null, diff --git a/src/DTO/Section.php b/src/DTO/Section.php index 7ce0a2d1..ca9b045b 100644 --- a/src/DTO/Section.php +++ b/src/DTO/Section.php @@ -31,6 +31,5 @@ public function __construct( public string $contentModified, public bool $annotationsPreview, public ?bool $hasTextAnnotations = null, - ) { - } + ) {} } diff --git a/src/DTO/SuggestionField.php b/src/DTO/SuggestionField.php index a5d933e9..6e0a11ee 100644 --- a/src/DTO/SuggestionField.php +++ b/src/DTO/SuggestionField.php @@ -21,8 +21,7 @@ public function __construct( public ?string $name, public ?string $db_name, public ?string $confidence, - ) { - } + ) {} public static function fake( array $value = [], diff --git a/src/DTO/TableRow.php b/src/DTO/TableRow.php index 9b12a84a..8245b05d 100644 --- a/src/DTO/TableRow.php +++ b/src/DTO/TableRow.php @@ -24,8 +24,7 @@ protected static function convertFields(Collection $fields): Collection public function __construct( public Collection $fields, - ) { - } + ) {} public static function fake( ?Collection $fields = null, diff --git a/src/Events/DocuWareCookieCreatedLog.php b/src/Events/DocuWareCookieCreatedLog.php index 433a7d1f..e330e08f 100644 --- a/src/Events/DocuWareCookieCreatedLog.php +++ b/src/Events/DocuWareCookieCreatedLog.php @@ -14,6 +14,5 @@ class DocuWareCookieCreatedLog public function __construct( public string $message - ) { - } + ) {} } diff --git a/src/Events/DocuWareResponseLog.php b/src/Events/DocuWareResponseLog.php index 662bb765..23250dfa 100644 --- a/src/Events/DocuWareResponseLog.php +++ b/src/Events/DocuWareResponseLog.php @@ -16,6 +16,5 @@ class DocuWareResponseLog public function __construct( public Response|SaloonResponse $response - ) { - } + ) {} } diff --git a/src/Requests/Auth/PostLoginRequest.php b/src/Requests/Auth/PostLoginRequest.php index e14deb6e..543758b3 100644 --- a/src/Requests/Auth/PostLoginRequest.php +++ b/src/Requests/Auth/PostLoginRequest.php @@ -23,8 +23,7 @@ public function __construct( protected readonly bool $rememberMe = false, protected readonly bool $redirectToMyselfInCaseOfError = false, protected readonly ?string $licenseType = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Dialogs/GetDialogRequest.php b/src/Requests/Dialogs/GetDialogRequest.php index 22fbe358..46cf112e 100644 --- a/src/Requests/Dialogs/GetDialogRequest.php +++ b/src/Requests/Dialogs/GetDialogRequest.php @@ -20,8 +20,7 @@ class GetDialogRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $dialogId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Dialogs/GetDialogsRequest.php b/src/Requests/Dialogs/GetDialogsRequest.php index e8731fb1..19eefe3b 100644 --- a/src/Requests/Dialogs/GetDialogsRequest.php +++ b/src/Requests/Dialogs/GetDialogsRequest.php @@ -19,8 +19,7 @@ class GetDialogsRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/DeleteDocumentRequest.php b/src/Requests/Document/DeleteDocumentRequest.php index cb359062..811b01c5 100644 --- a/src/Requests/Document/DeleteDocumentRequest.php +++ b/src/Requests/Document/DeleteDocumentRequest.php @@ -14,8 +14,7 @@ class DeleteDocumentRequest extends Request public function __construct( protected readonly string $fileCabinetId, protected readonly string $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentCountRequest.php b/src/Requests/Document/GetDocumentCountRequest.php index d33b6e0d..ac35c47c 100644 --- a/src/Requests/Document/GetDocumentCountRequest.php +++ b/src/Requests/Document/GetDocumentCountRequest.php @@ -20,8 +20,7 @@ class GetDocumentCountRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $dialogId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentDownloadRequest.php b/src/Requests/Document/GetDocumentDownloadRequest.php index 09c2a641..faa705e8 100644 --- a/src/Requests/Document/GetDocumentDownloadRequest.php +++ b/src/Requests/Document/GetDocumentDownloadRequest.php @@ -20,8 +20,7 @@ class GetDocumentDownloadRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly int $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentPreviewRequest.php b/src/Requests/Document/GetDocumentPreviewRequest.php index 2fc42e27..778df9fa 100644 --- a/src/Requests/Document/GetDocumentPreviewRequest.php +++ b/src/Requests/Document/GetDocumentPreviewRequest.php @@ -20,8 +20,7 @@ class GetDocumentPreviewRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentRequest.php b/src/Requests/Document/GetDocumentRequest.php index 9b11bc35..0c4c6120 100644 --- a/src/Requests/Document/GetDocumentRequest.php +++ b/src/Requests/Document/GetDocumentRequest.php @@ -21,8 +21,7 @@ class GetDocumentRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly string $documentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/GetDocumentsRequest.php b/src/Requests/Document/GetDocumentsRequest.php index d71cb77d..1e3b2727 100644 --- a/src/Requests/Document/GetDocumentsRequest.php +++ b/src/Requests/Document/GetDocumentsRequest.php @@ -22,8 +22,7 @@ public function __construct( protected readonly string $fileCabinetId, protected readonly int $page = 1, protected readonly int $perPage = 50, - ) { - } + ) {} public function defaultQuery(): array { diff --git a/src/Requests/Document/PostDocumentRequest.php b/src/Requests/Document/PostDocumentRequest.php index 47a5b20d..28fa506b 100644 --- a/src/Requests/Document/PostDocumentRequest.php +++ b/src/Requests/Document/PostDocumentRequest.php @@ -24,8 +24,7 @@ public function __construct( protected readonly ?string $fileContent, protected readonly ?string $fileName, protected readonly ?Collection $indexes = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/PostTransferDocumentRequest.php b/src/Requests/Document/PostTransferDocumentRequest.php index c7928587..2253ea5c 100644 --- a/src/Requests/Document/PostTransferDocumentRequest.php +++ b/src/Requests/Document/PostTransferDocumentRequest.php @@ -21,8 +21,7 @@ public function __construct( protected readonly string $storeDialogId, protected readonly string $documentId, protected readonly array $fields = [], - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/PutDocumentFieldsRequest.php b/src/Requests/Document/PutDocumentFieldsRequest.php index 9b88165f..62619aec 100644 --- a/src/Requests/Document/PutDocumentFieldsRequest.php +++ b/src/Requests/Document/PutDocumentFieldsRequest.php @@ -26,8 +26,7 @@ public function __construct( protected readonly string $documentId, protected readonly ?Collection $indexes = null, protected readonly bool $forceUpdate = false, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php b/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php index ea084188..ebc8601c 100644 --- a/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php +++ b/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php @@ -21,8 +21,7 @@ public function __construct( protected readonly string $fileCabinetId, protected readonly string $thumbnailId, protected readonly int $page = 0, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Fields/GetFieldsRequest.php b/src/Requests/Fields/GetFieldsRequest.php index 3361f532..614b9e10 100644 --- a/src/Requests/Fields/GetFieldsRequest.php +++ b/src/Requests/Fields/GetFieldsRequest.php @@ -21,8 +21,7 @@ class GetFieldsRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Organization/GetOrganizationRequest.php b/src/Requests/Organization/GetOrganizationRequest.php index e85b322d..d67d290f 100644 --- a/src/Requests/Organization/GetOrganizationRequest.php +++ b/src/Requests/Organization/GetOrganizationRequest.php @@ -20,8 +20,7 @@ class GetOrganizationRequest extends Request implements Cacheable public function __construct( public string $organizationId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Search/GetSearchRequest.php b/src/Requests/Search/GetSearchRequest.php index a06800e9..f4df557f 100644 --- a/src/Requests/Search/GetSearchRequest.php +++ b/src/Requests/Search/GetSearchRequest.php @@ -31,8 +31,7 @@ public function __construct( protected readonly string $orderField = 'DWSTOREDATETIME', protected readonly string $orderDirection = 'asc', protected readonly array $condition = [], - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Sections/GetSectionsRequest.php b/src/Requests/Sections/GetSectionsRequest.php index 7609933e..06d96a9d 100644 --- a/src/Requests/Sections/GetSectionsRequest.php +++ b/src/Requests/Sections/GetSectionsRequest.php @@ -22,8 +22,7 @@ class GetSectionsRequest extends Request implements Cacheable public function __construct( protected readonly string $fileCabinetId, protected readonly int $documentId - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/SelectList/GetSelectListRequest.php b/src/Requests/SelectList/GetSelectListRequest.php index e6dd8196..d31ffe72 100644 --- a/src/Requests/SelectList/GetSelectListRequest.php +++ b/src/Requests/SelectList/GetSelectListRequest.php @@ -21,8 +21,7 @@ public function __construct( protected readonly string $fileCabinetId, protected readonly string $dialogId, protected readonly string $fieldName, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/tests/Local/UpdateNichtHandelsrechnungenTest.php b/tests/Local/UpdateNichtHandelsrechnungenTest.php new file mode 100644 index 00000000..1ec9837d --- /dev/null +++ b/tests/Local/UpdateNichtHandelsrechnungenTest.php @@ -0,0 +1,89 @@ +each(function ($document) use ($connector, $fileCabinetId, $schlusskontrolleDate) { + + $file = $connector->send(new GetASpecificDocumentFromAFileCabinet($fileCabinetId, $document))->dto(); + + $signs = Arr::get($file->fields, 'SIGN'); + + $rows = collect(); + + $signs->value->each(function ($tableRow) use ($rows) { + + $signTypeExists = $tableRow->fields->contains(function (DocumentField $field) { + return $field->name === 'SIGN_TYPE' && $field->value === 'Schlusskontrolle'; + }); + + if ($signTypeExists) { + return; + } + + $fields = $tableRow->fields->map(function ($field) { + if ($field->name === 'SIGN_AT') { + return [ + 'NAME' => $field->name, + 'VALUE' => Carbon::parse($field->value->toDateString()), + ]; + } + + return [ + 'NAME' => $field->name, + 'VALUE' => $field->value, + ]; + })->values()->toArray(); + $rows->push($fields); + }); + + $schlusskontrolle = [ + [ + 'NAME' => 'SIGN_TYPE', + 'VALUE' => 'Schlusskontrolle', + ], + [ + 'NAME' => 'SIGN_USER', + 'VALUE' => 'docuwareadmin@sonepar.ch', + ], + [ + 'NAME' => 'SIGN_AT', + 'VALUE' => Carbon::parse($schlusskontrolleDate), + ], + [ + 'NAME' => 'SIGN_COMMENT', + 'VALUE' => 'API', + ], + ]; + + $rows->push($schlusskontrolle); + + $connector->send(new UpdateIndexValues( + $fileCabinetId, + $document, + collect([IndexTableDTO::make('SIGN', $rows)]) + ))->dto(); + + }); + +})->only(); From 19e9e8e72a650f3e9bb561035baf292139d75837 Mon Sep 17 00:00:00 2001 From: Sebastian Fix Date: Mon, 8 Jul 2024 09:43:49 +0200 Subject: [PATCH 3/3] WIP --- .../UpdateNichtHandelsrechnungenTest.php | 89 ------------------- 1 file changed, 89 deletions(-) delete mode 100644 tests/Local/UpdateNichtHandelsrechnungenTest.php diff --git a/tests/Local/UpdateNichtHandelsrechnungenTest.php b/tests/Local/UpdateNichtHandelsrechnungenTest.php deleted file mode 100644 index 1ec9837d..00000000 --- a/tests/Local/UpdateNichtHandelsrechnungenTest.php +++ /dev/null @@ -1,89 +0,0 @@ -each(function ($document) use ($connector, $fileCabinetId, $schlusskontrolleDate) { - - $file = $connector->send(new GetASpecificDocumentFromAFileCabinet($fileCabinetId, $document))->dto(); - - $signs = Arr::get($file->fields, 'SIGN'); - - $rows = collect(); - - $signs->value->each(function ($tableRow) use ($rows) { - - $signTypeExists = $tableRow->fields->contains(function (DocumentField $field) { - return $field->name === 'SIGN_TYPE' && $field->value === 'Schlusskontrolle'; - }); - - if ($signTypeExists) { - return; - } - - $fields = $tableRow->fields->map(function ($field) { - if ($field->name === 'SIGN_AT') { - return [ - 'NAME' => $field->name, - 'VALUE' => Carbon::parse($field->value->toDateString()), - ]; - } - - return [ - 'NAME' => $field->name, - 'VALUE' => $field->value, - ]; - })->values()->toArray(); - $rows->push($fields); - }); - - $schlusskontrolle = [ - [ - 'NAME' => 'SIGN_TYPE', - 'VALUE' => 'Schlusskontrolle', - ], - [ - 'NAME' => 'SIGN_USER', - 'VALUE' => 'docuwareadmin@sonepar.ch', - ], - [ - 'NAME' => 'SIGN_AT', - 'VALUE' => Carbon::parse($schlusskontrolleDate), - ], - [ - 'NAME' => 'SIGN_COMMENT', - 'VALUE' => 'API', - ], - ]; - - $rows->push($schlusskontrolle); - - $connector->send(new UpdateIndexValues( - $fileCabinetId, - $document, - collect([IndexTableDTO::make('SIGN', $rows)]) - ))->dto(); - - }); - -})->only();