Conversation
…ature-a-few-fixes
There was a problem hiding this comment.
Pull request overview
Updates the package for a Laravel 13 / Saloon v4 baseline and expands DocuWare API coverage with more robust JSON decoding plus a significantly reworked test setup (default vs live integration, plus Saloon fixtures).
Changes:
- Upgrade runtime/dev dependencies and CI workflows for Laravel 13, newer Pest/PHPStan/PHP versions, and updated test suite definitions.
- Add/extend DocuWare requests/responses (stamps/annotations, check-in/out, batch updates, select lists, workflow history) and harden DTO/response parsing against non-list/associative JSON shapes.
- Introduce Saloon fixture infrastructure + new unit/integration/manual tests; add configurable
platform_pathfor non-standard Platform base paths.
Reviewed changes
Copilot reviewed 172 out of 209 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Requests/FileCabinets/Upload/CreateDataRecordTest.php | Unit coverage for StoreDialogId query behavior |
| tests/Unit/DocuWareSearchRequestBuilderTest.php | Unit coverage for EMPTY/NOTEMPTY + list encoding |
| tests/TestCase.php | Testbench setup; sets Saloon fixture path |
| tests/Support/FixtureDocuWareConnector.php | Connector for fixture tests (static token, no OAuth) |
| tests/Manual/RecordGetOrganizationFixtureTest.php | Manual test to record/refresh Saloon fixtures |
| tests/Integration/Requests/Workflow/GetDocumentWorkflowHistoryTest.php | Live workflow history integration test |
| tests/Integration/Requests/Workflow/GetDocumentWorkflowHistoryStepsTest.php | Live workflow history steps integration test |
| tests/Integration/Requests/Search/GetSearchRequestTest.php | Search integration test date filter tweak |
| tests/Integration/Requests/General/UserManagement/GetUsers/GetUsersTest.php | Live user listing integration test |
| tests/Integration/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php | Live role-members listing test |
| tests/Integration/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php | Live group-members listing test |
| tests/Integration/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php | Live user-by-id integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARoleTest.php | Live remove-user-from-role integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php | Live roles listing integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php | Live roles-for-user integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyRoles/AddUserToARoleTest.php | Live add-user-to-role integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroupTest.php | Live remove-user-from-group integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php | Live groups listing integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php | Live groups-for-user integration test |
| tests/Integration/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroupTest.php | Live add-user-to-group integration test |
| tests/Integration/Requests/General/UserManagement/CreateUpdateUsers/UpdateUserTest.php | Live update-user integration test |
| tests/Integration/Requests/General/UserManagement/CreateUpdateUsers/CreateUserTest.php | Live create-user integration test |
| tests/Integration/Requests/General/Organization/GetOrganizationTest.php | Live organizations integration test |
| tests/Integration/Requests/General/Organization/GetLoginTokenTest.php | Live login token integration test |
| tests/Integration/Requests/General/Organization/GetAllFileCabinetsAndDocumentTraysTest.php | Live cabinets/trays integration test |
| tests/Integration/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php | Live replace-section integration test |
| tests/Integration/Requests/FileCabinets/Upload/CreateDataRecordTest.php | Live upload (data record) integration tests |
| tests/Integration/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php | Live append files integration test |
| tests/Integration/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php | Live append single PDF integration test |
| tests/Integration/Requests/FileCabinets/SelectLists/GetSelectListsTest.php | Live select list integration test |
| tests/Integration/Requests/FileCabinets/SelectLists/GetFilteredSelectListsTest.php | Live filtered select list integration tests |
| tests/Integration/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinetTest.php | Live cabinet document listing integration test |
| tests/Integration/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinetTest.php | Live cabinet document read integration test |
| tests/Integration/Requests/FileCabinets/General/GetTotalNumberOfDocumentsTest.php | Live cabinet count integration test |
| tests/Integration/Requests/FileCabinets/General/GetFileCabinetInformationTest.php | Live cabinet info integration test |
| tests/Integration/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificTypeTest.php | Live dialogs-by-type integration test |
| tests/Integration/Requests/FileCabinets/Dialogs/GetASpecificDialogTest.php | Live dialog read integration test |
| tests/Integration/Requests/FileCabinets/Dialogs/GetAllDialogsTest.php | Live dialogs listing integration test |
| tests/Integration/Requests/FileCabinets/CheckInCheckOut/UndoDocumentCheckoutTest.php | Live undo checkout integration test |
| tests/Integration/Requests/FileCabinets/CheckInCheckOut/CheckoutDocumentToFileSystemTest.php | Live checkout integration test |
| tests/Integration/Requests/FileCabinets/CheckInCheckOut/CheckInDocumentFromFileSystemTest.php | Live check-in integration test |
| tests/Integration/Requests/FileCabinets/Batch/BatchDocumentsUpdateFieldsTest.php | Live batch update integration test |
| tests/Integration/Requests/Fields/GetFieldsRequestTest.php | Live fields listing integration test |
| tests/Integration/Requests/Documents/UpdateIndexValues/UpdateIndexValuesTest.php | Live update index values integration tests |
| tests/Integration/Requests/Documents/Stamps/GetStampsTest.php | Live stamps listing integration test |
| tests/Integration/Requests/Documents/Stamps/GetDocumentAnnotationsTest.php | Live annotations listing integration test |
| tests/Integration/Requests/Documents/Stamps/AddDocumentAnnotationsTest.php | Live add annotation integration test |
| tests/Integration/Requests/Documents/Sections/GetTextshotTest.php | Live textshot integration test |
| tests/Integration/Requests/Documents/Sections/GetASpecificSectionTest.php | Live section read integration test |
| tests/Integration/Requests/Documents/Sections/GetAllSectionsFromADocumentTest.php | Live sections listing integration test |
| tests/Integration/Requests/Documents/Sections/DeleteSectionTest.php | Live section delete integration test |
| tests/Integration/Requests/Documents/ModifyDocuments/TransferDocumentTest.php | Live transfer integration test |
| tests/Integration/Requests/Documents/ModifyDocuments/DeleteDocumentTest.php | Live delete integration test |
| tests/Integration/Requests/Documents/GetDocumentPreviewRequestTest.php | Live preview integration test |
| tests/Integration/Requests/Documents/Download/DownloadThumbnailTest.php | Live thumbnail download integration test |
| tests/Integration/Requests/Documents/Download/DownloadSectionTest.php | Live section download integration test |
| tests/Integration/Requests/Documents/Download/DownloadDocumentTest.php | Live document download integration test |
| tests/Integration/Requests/Documents/DocumentsTrashBin/RestoreDocumentsTest.php | Live trash restore integration test |
| tests/Integration/Requests/Documents/DocumentsTrashBin/GetDocumentsTest.php | Trash search integration test date filter tweak |
| tests/Integration/Requests/Documents/DocumentsTrashBin/DeleteDocumentsTest.php | Live trash delete integration test |
| tests/Integration/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php | Live unstaple integration test |
| tests/Integration/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php | Live unclip integration test |
| tests/Integration/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php | Live staple integration test adjustments |
| tests/Integration/Requests/Documents/ClipUnclipStapleUnstaple/ClipTest.php | Live clip integration test |
| tests/Integration/Requests/Documents/ApplicationProperties/UpdateApplicationPropertiesTest.php | Live update application props test |
| tests/Integration/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php | Live get application props test |
| tests/Integration/Requests/Documents/ApplicationProperties/DeleteApplicationPropertiesTest.php | Live delete application props test |
| tests/Integration/Requests/Documents/ApplicationProperties/AddApplicationPropertiesTest.php | Live add application props test |
| tests/Integration/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUserTest.php | Live trusted-user grant test (skipped) |
| tests/Integration/Requests/Authentication/OAuth/RequestTokenWithCredentialsTest.php | Live password grant integration test |
| tests/Integration/Requests/Authentication/OAuth/GetResponsibleIdentityServiceTest.php | Live identity service info test |
| tests/Integration/Requests/Authentication/OAuth/GetIdentityServiceConfigurationTest.php | Live OpenID config test |
| tests/Integration/DocuWareTest.php | URL generation test updated for platform_path + processing refresh |
| tests/Integration/DocuWareAuthenticationTest.php | Removes duplicate OAuth discovery tests (moved elsewhere) |
| tests/Fixtures/saloon/get-organization.json | Saloon recorded fixture: GetOrganization |
| tests/Fixtures/saloon/add-document-annotations.json | Saloon recorded fixture: AddDocumentAnnotations |
| tests/Feature/SleepTest.php | Removes unused sleep test |
| tests/Feature/SaloonFixtures/RequestTokenWithCredentialsFixtureTest.php | Mocked token mapping fixture test |
| tests/Feature/SaloonFixtures/GetOrganizationFixtureTest.php | Fixture-backed GetOrganization mapping test |
| tests/Feature/SaloonFixtures/AddDocumentAnnotationsFixtureTest.php | Fixture-backed AddDocumentAnnotations mapping test |
| tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryTest.php | Removes older workflow feature test |
| tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php | Removes older thumbnail feature test |
| tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php | Removes older combined app-props feature test |
| src/Support/ParseValue.php | Harden field parsing for varied JSON shapes |
| src/Support/JsonArrays.php | New helper to normalize decoded JSON arrays/maps |
| src/Support/Auth.php | Safer cookie cache typing/handling |
| src/Responses/Workflow/GetDocumentWorkflowHistoryResponse.php | Treat 404 as empty history + normalize list decoding |
| src/Responses/Search/GetTrashSearchResponse.php | Tighten pagination param types |
| src/Responses/Search/GetSearchResponse.php | Tighten pagination param types |
| src/Responses/General/UserManagement/GetUsers/GetUsersResponse.php | Normalize list decoding + return type tightening |
| src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php | Normalize list decoding + return type tightening |
| src/Responses/General/UserManagement/GetModifyGroups/GetGroupsResponse.php | Normalize list decoding + return type tightening |
| src/Responses/General/Organization/GetOrganizationResponse.php | Normalize list decoding + return type tightening |
| src/Responses/General/Organization/GetAllFileCabinetsAndDocumentTraysResponse.php | Normalize list decoding + return type tightening |
| src/Responses/FileCabinets/Search/GetDocumentsFromAFileCabinetResponse.php | Tighten pagination param types |
| src/Responses/FileCabinets/Dialogs/GetAllDialogsResponse.php | Normalize list decoding + return type tightening |
| src/Responses/Fields/GetFieldsResponse.php | Normalize list decoding + return type tightening |
| src/Responses/Documents/UpdateIndexValues/UpdateIndexValuesResponse.php | Normalize list decoding + safer FieldName mapping |
| src/Responses/Documents/Sections/GetAllSectionsFromADocumentResponse.php | Normalize list decoding + return type tightening |
| src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php | Return Collection + normalize list decoding |
| src/Requests/Workflow/GetDocumentWorkflowHistory.php | Clarify DTO return generics |
| src/Requests/Search/GetSearchRequest.php | Typo fix + docblocks for body/query |
| src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetUsers/GetUsers.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php | Add array shape docs |
| src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php | Add array shape docs |
| src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php | Add array shape docs |
| src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php | Tighten DTO return types |
| src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php | Add array shape docs |
| src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php | Null-safe out-of-office serialization |
| src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php | Add body return typing docs |
| src/Requests/General/Organization/GetOrganization.php | Tighten DTO return types |
| src/Requests/General/Organization/GetLoginToken.php | Add payload typing docs |
| src/Requests/General/Organization/GetAllFileCabinetsAndDocumentTrays.php | Tighten DTO return types |
| src/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSection.php | Add multipart body typing docs |
| src/Requests/FileCabinets/Upload/CreateDataRecord.php | Add StoreDialogId query support |
| src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php | Add multipart typing docs/import |
| src/Requests/FileCabinets/Upload/AppendASinglePDFToADocument.php | Add multipart body typing docs |
| src/Requests/FileCabinets/SelectLists/GetSelectLists.php | Switch to POST + JSON body for select list retrieval |
| src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php | Switch to POST + JSON body incl DialogExpression |
| src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php | Add fields list typing docs |
| src/Requests/FileCabinets/CheckInCheckOut/UndoDocumentCheckout.php | New request: undo checkout |
| src/Requests/FileCabinets/CheckInCheckOut/CheckoutDocumentToFileSystem.php | New request: checkout to file system |
| src/Requests/FileCabinets/CheckInCheckOut/CheckInDocumentFromFileSystem.php | New request: check-in from file system (multipart) |
| src/Requests/FileCabinets/Batch/BatchDocumentsUpdateFields.php | New request: batch field updates |
| src/Requests/Fields/GetFieldsRequest.php | Tighten DTO return types |
| src/Requests/Documents/UpdateIndexValues/UpdateIndexValues.php | Broaden index DTO types + add return typing |
| src/Requests/Documents/Stamps/GetStamps.php | New request: list stamps |
| src/Requests/Documents/Stamps/GetDocumentAnnotations.php | New request: list annotations (normalized) |
| src/Requests/Documents/Stamps/AddDocumentAnnotations.php | New request: post annotations |
| src/Requests/Documents/Sections/GetAllSectionsFromADocument.php | Tighten DTO return types |
| src/Requests/Documents/ModifyDocuments/TransferDocument.php | Fix Arr import + add typing docs |
| src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php | Add input/body typing docs |
| src/Requests/Documents/DocumentsTrashBin/GetDocuments.php | Add condition typing docs |
| src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php | Add input/body typing docs |
| src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php | Add body typing docs |
| src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php | Add body typing docs |
| src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php | Add body typing docs |
| src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php | Add body typing docs |
| src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php | Add list typing + return type |
| src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php | Add list typing + return type |
| src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php | Add list typing + return type |
| src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php | Add body return typing docs |
| src/Requests/Authentication/OAuth/RequestTokenWithCredentials.php | Add body return typing docs |
| src/Requests/Authentication/OAuth/GetResponsibleIdentityService.php | Base URL now respects platform_path |
| src/Facades/DocuWare.php | Improve phpdoc generics/array typing |
| src/DTO/Workflow/InstanceHistory.php | Normalize nested list parsing |
| src/DTO/Workflow/HistoryStep.php | Normalize Info.Item shape to consistent list |
| src/DTO/TextshotPage.php | Normalize Items structure before parsing |
| src/DTO/Textshot.php | Normalize Pages to list records |
| src/DTO/SuggestionField.php | Add phpdoc typing |
| src/DTO/Section.php | Add phpdoc typing |
| src/DTO/General/UserManagement/GetUsers/User.php | Add phpdoc typing |
| src/DTO/General/UserManagement/GetUsers/RegionalSettings.php | Add phpdoc typing |
| src/DTO/General/UserManagement/GetUsers/OutOfOffice.php | Add phpdoc typing |
| src/DTO/General/UserManagement/GetModifyRoles/Role.php | Add phpdoc typing |
| src/DTO/General/UserManagement/GetModifyGroups/Group.php | Add phpdoc typing |
| src/DTO/General/UserManagement/CreateUpdateUser/User.php | Add phpdoc typing |
| src/DTO/General/Organization/OrganizationIndex.php | Add phpdoc typing |
| src/DTO/General/Organization/Organization.php | Add phpdoc typing + arg typing |
| src/DTO/General/Organization/FileCabinet.php | Add phpdoc typing |
| src/DTO/FileCabinets/General/FileCabinetInformation.php | Add phpdoc typing |
| src/DTO/FileCabinets/Dialog.php | Normalize Fields parsing |
| src/DTO/FileCabinets/CheckoutToFileSystemResult.php | New DTO: checkout result links |
| src/DTO/Documents/TrashDocumentPaginator.php | Normalize headers/rows shapes + safer mapping |
| src/DTO/Documents/TableRow.php | Normalize table field list + validate FieldName |
| src/DTO/Documents/Field.php | Add phpdoc typing |
| src/DTO/Documents/DocumentThumbnail.php | Add phpdoc typing |
| src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php | Normalize FailedItems decoding |
| src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php | Normalize FailedItems decoding |
| src/DTO/Documents/DocumentPaginator.php | Harden Items parsing against non-list |
| src/DTO/Documents/DocumentIndex/PrepareDTO.php | Add phpdoc typing |
| src/DTO/Documents/DocumentIndex/IndexTextDTO.php | Add values() return typing |
| src/DTO/Documents/DocumentIndex/IndexTableDTO.php | Harden row collection normalization |
| src/DTO/Documents/DocumentIndex/IndexNumericDTO.php | Add values() return typing |
| src/DTO/Documents/DocumentIndex/IndexMemoDTO.php | Add values() return typing |
| src/DTO/Documents/DocumentIndex/IndexKeywordDTO.php | Add values() return typing |
| src/DTO/Documents/DocumentIndex/IndexDetectDTO.php | Tighten return union typing |
| src/DTO/Documents/DocumentIndex/IndexDecimalDTO.php | Add values() return typing |
| src/DTO/Documents/DocumentIndex/IndexDateTimeDTO.php | Tighten makeWithFallback return type + values() typing |
| src/DTO/Documents/DocumentIndex/IndexDateDTO.php | Tighten makeWithFallback return type + values() typing |
| src/DTO/Documents/DocumentField.php | Add phpdoc for value union type |
| src/DTO/Documents/Document.php | Normalize nested lists + safer extension parsing |
| src/DTO/Authentication/OAuth/ResponsibleIdentityService.php | Add phpdoc typing |
| src/DTO/Authentication/OAuth/RequestToken.php | Add phpdoc typing |
| src/DTO/Authentication/OAuth/IdentityServiceConfiguration.php | Normalize list fields to list |
| src/DocuWareUrl.php | Base URL now respects platform_path + trims slashes |
| src/DocuWareSearchRequestBuilder.php | Adds EMPTY/NOTEMPTY + list normalization changes |
| src/Connectors/DocuWareConnector.php | Base URL respects platform_path + safer OAuth error handling |
| phpunit.xml.dist | Split test suites (default vs integration) + newer schema |
| phpstan.neon.dist | Increase PHPStan level |
| config/laravel-docuware.php | Add platform_path + more test config keys |
| composer.json | Laravel 13 deps + new test scripts + postman parity script |
| .github/workflows/run-tests.yml | Update matrix; split default vs integration runs; parity check |
| .github/workflows/phpstan.yml | Update PHP version |
| .github/workflows/fix-php-code-style-issues.yml | Run Pint via installed deps and setup-php |
| .github/workflows/dependabot-auto-merge.yml | Update dependabot action + Node 24 env |
| .github/workflows/composer-audit.yml | Update PHP version |
| .github/ISSUE_TEMPLATE/bug_report.yml | Update PHP/Laravel version defaults |
| .env.example | Add DocuWare env/config mapping documentation |
Comments suppressed due to low confidence (2)
tests/Integration/Requests/Search/GetSearchRequestTest.php:55
- This request builder now enforces a maximum of two date filters per field; the chain here applies three
filterDatecalls for the same field (>=,<=, and< now()), which will raiseUnableToSearch::InvalidDateFiltersCount(2)before the request is built. Drop the redundant third date filter (or switch to a different field) so the test matches the builder constraints.
tests/Integration/Requests/Documents/DocumentsTrashBin/GetDocumentsTest.php:45 - Same as the search test: there are three
filterDatecalls forDELETEDATETIME(>=,<=, and< now()), but the builder now throws once two date filters are already present for a field. Remove the redundant third date filter so the request can be constructed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/DocuWareSearchRequestBuilder.php
Outdated
| private function makeSureFilterDateRangeIsCorrect(string $name, string $operator): void | ||
| { | ||
| if (isset($this->usedDateOperators[$name])) { | ||
| if ($operatorFilterIndex = array_search($operator, $this->usedDateOperators[$name])) { | ||
| unset($this->filters[$name][$operatorFilterIndex]); | ||
| } elseif ($operator == '=') { | ||
| unset($this->filters[$name]); | ||
| $this->usedDateOperators[$name] = [$operator]; | ||
| } else { | ||
| $this->usedDateOperators[$name][] = $operator; | ||
| } | ||
| } else { | ||
| if (! isset($this->usedDateOperators[$name])) { | ||
| $this->usedDateOperators[$name][] = $operator; | ||
| $this->throwIfInvalidDateFiltersCount($name); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| $operatorFilterIndex = array_search($operator, $this->usedDateOperators[$name], true); | ||
| if ($operatorFilterIndex !== false) { | ||
| unset($this->filters[$name][$operatorFilterIndex]); | ||
| if (isset($this->filters[$name])) { | ||
| $this->filters[$name] = array_values($this->filters[$name]); | ||
| } | ||
| $this->throwIfInvalidDateFiltersCount($name); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| if (isset($this->filters[$name]) && ($dateFiltersCount = count($this->filters[$name])) == 2) { | ||
| throw UnableToSearch::InvalidDateFiltersCount($dateFiltersCount); | ||
| if ($operator == '=') { | ||
| unset($this->filters[$name]); | ||
| $this->usedDateOperators[$name] = [$operator]; | ||
| $this->throwIfInvalidDateFiltersCount($name); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| $this->usedDateOperators[$name][] = $operator; | ||
| $this->throwIfInvalidDateFiltersCount($name); | ||
| } |
There was a problem hiding this comment.
Overriding a date filter with the same operator can desynchronize $usedDateOperators (operator order) from $filters[$name] (date values), because a value is unset by operator index and the filters array is reindexed, but $usedDateOperators[$name] is not updated. This breaks the operator↔value index mapping used by checkDateFilterRangeDivergence() (and can also reorder/flip ranges). Consider storing date filters keyed by operator (e.g. $this->filters[$name][$operator] = $date) and deriving operators from array_keys, or update both arrays together without reindexing mismatched data.
No description provided.