Skip to content

[MAINTENANCE] Adjust countings statistics for collections and add tests#1988

Open
beatrycze-volk wants to merge 3 commits into
kitodo:mainfrom
beatrycze-volk:count-documents
Open

[MAINTENANCE] Adjust countings statistics for collections and add tests#1988
beatrycze-volk wants to merge 3 commits into
kitodo:mainfrom
beatrycze-volk:count-documents

Conversation

@beatrycze-volk

Copy link
Copy Markdown
Collaborator

No description provided.

The `getStatisticsForSelectedCollection` method is made more robust by checking for the existence of the 'collections' key using `array_key_exists`. Functional tests are added to verify its behavior for various collection selection scenarios.
Replaces a duplicated QueryBuilder implementation with a call to the existing `count` method. This ensures consistent application of counting logic and improves code maintainability.
Extracts logic for counting document statistics into new, dedicated private methods. This improves readability and reduces the complexity of the `getStatisticsForSelectedCollection` method by delegating distinct calculation scenarios (selected collections vs. all collections) to separate functions.
@beatrycze-volk beatrycze-volk self-assigned this Jun 4, 2026
@beatrycze-volk beatrycze-volk added the ⟳ maintenance A task to keep the code up-to-date and manageable. label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⟳ maintenance A task to keep the code up-to-date and manageable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant