Skip to content

Conversation

@remyperona
Copy link
Contributor

@remyperona remyperona commented Jan 7, 2020

Pull request overview

This PR refactors the Event Manager package by splitting functionality into two distinct classes (EventManager and PluginApiManager), significantly modernizing the codebase with PHP 7.4+ requirements, and adding comprehensive test coverage. The refactoring follows proper dependency injection patterns and includes both unit and integration tests.

Key changes:

  • Split event management into EventManager (business logic) and PluginApiManager (WordPress Plugin API wrapper)
  • Added comprehensive unit and integration test suites with dedicated test infrastructure
  • Upgraded minimum PHP version from 5.6 to 7.4 and modernized all dependencies
  • Implemented strict type declarations throughout the codebase
  • Added PHPStan, updated PHPCS rules, and GitHub Actions workflows for automated testing
  • Updated namespace from WP_Media to WPMedia for consistency

@remyperona remyperona added the enhancement New feature or request label Jan 7, 2020
@remyperona remyperona self-assigned this Jan 7, 2020
@remyperona remyperona removed the request for review from hellofromtonya November 21, 2025 21:54
@remyperona remyperona requested a review from Copilot November 21, 2025 22:04
Copilot finished reviewing on behalf of remyperona November 21, 2025 22:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Event Manager package by splitting functionality into two distinct classes (EventManager and PluginApiManager), significantly modernizing the codebase with PHP 7.4+ requirements, and adding comprehensive test coverage. The refactoring follows proper dependency injection patterns and includes both unit and integration tests.

Key changes:

  • Split event management into EventManager (business logic) and PluginApiManager (WordPress Plugin API wrapper)
  • Added comprehensive unit and integration test suites with dedicated test infrastructure
  • Upgraded minimum PHP version from 5.6 to 7.4 and modernized all dependencies
  • Implemented strict type declarations throughout the codebase
  • Added PHPStan, updated PHPCS rules, and GitHub Actions workflows for automated testing
  • Updated namespace from WP_Media to WPMedia for consistency

Reviewed changes

Copilot reviewed 37 out of 40 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
inc/EventManager.php Core event manager class that handles subscriber registration/removal using dependency-injected PluginApiManager
inc/PluginApiManager.php New wrapper class for WordPress Plugin API functions (add_filter, remove_filter, etc.)
inc/SubscriberInterface.php Interface defining the contract for event subscribers
inc/EventManagerAwareSubscriberInterface.php Interface for subscribers that need access to the EventManager instance
tests/Unit/* Unit tests for EventManager and PluginApiManager using mocks
tests/Integration/* Integration tests for EventManager and PluginApiManager using actual WordPress functions
tests/Fixtures/DummySubscriber.php Test fixture implementing SubscriberInterface for testing
phpcs.xml.dist Updated PHP CodeSniffer configuration for WordPress standards with PHP 7.4+ compatibility
phpstan.neon.dist New PHPStan static analysis configuration
composer.json Updated dependencies, autoload paths, PHP version requirement (7.4+), and test scripts
README.md Enhanced documentation with installation, initialization, and usage examples
.github/workflows/* New GitHub Actions workflows for PHPUnit, PHPStan, and PHPCS
bin/install-wp-tests.sh Shell script for installing WordPress test suite

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@remyperona remyperona merged commit 1c5bb50 into develop Nov 21, 2025
3 checks passed
@remyperona remyperona deleted the refactor-event-manager branch November 21, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants