Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: prepare ExternalContent to use filters on SourceReaders #1334

Merged
merged 39 commits into from
Mar 6, 2025

Conversation

thorbrink
Copy link
Contributor

@thorbrink thorbrink commented Feb 24, 2025

This pull request includes several changes to improve the composer.json file, refactor the App.php file, and update test files. The changes focus on adding new dependencies, cleaning up unused imports, improving the setup of external content, and replacing mock objects in tests.

Improvements to composer.json:

  • Added new script unused to check for unused classes using class-leak and added dependencies dg/bypass-finals and tomasvotruba/class-leak. [1] [2]

Refactoring in App.php:

  • Removed unused imports and added new necessary imports in library/App.php. [1] [2]
  • Refactored setupExternalContent method to use addHooks method instead of register method for better readability and maintainability. [1] [2]

Updates to test files:

  • Replaced WpMockFactory::createWpCommentQuery with WP_Comment_Query in OptionalHideDiscussionWhenLoggedOut.test.php. [1] [2] [3] [4]
  • Replaced WpMockFactory::createWpdb with wpdb in Customizer.test.php. [1] [2]

Removal of unused class:

  • Removed the PopulateTaxonomySchemaPropertyFieldOptions class from library/ExternalContent/AcfFieldContentModifiers/.

Enhancements in SourceConfig:

  • Added FilterDefinition to the SourceConfig class and updated the constructor and methods accordingly. [1] [2] [3] [4]
  • Updated SourceConfigFactory to create SourceConfig instances with FilterDefinition. [1] [2]

refactor: update SyncHandler to use DoActionRefArray
refactor: improve SourceReaderFromConfig with dedicated methods
@thorbrink thorbrink marked this pull request as ready for review March 5, 2025 13:01
Copy link

sonarqubecloud bot commented Mar 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@thorbrink thorbrink changed the title refactor: external content source reading refactor: prepare ExternalContent to use filters on SourceReaders Mar 5, 2025
@thorbrink thorbrink merged commit cc0eb61 into main Mar 6, 2025
7 of 9 checks passed
@thorbrink thorbrink deleted the feat/externalContentSourceFilter branch March 6, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant