fix(B1): correct lifecycle contract FQCN to Phlix\Shared\Plugin\LifecycleInterface#3
Merged
Conversation
…ycleInterface The dev-stub, test bootstrap, and README referenced the legacy `Phlix\Plugins\Contract\LifecycleInterface`, but the canonical host contract shipped by detain/phlix-shared is `Phlix\Shared\Plugin\LifecycleInterface` (matching what src/HelloMetadataProvider.php already implements). - dev-stubs/LifecycleInterface.php: namespace + canonical-path docblock now point at detain/phlix-shared src/Plugin/LifecycleInterface.php (method signatures already matched the canonical interface). - tests/bootstrap.php: interface_exists() guard now tests the canonical FQCN, so it correctly detects the real contract when phlix-shared is installed and only falls back to the stub when it is absent. - README.md: cited FQCN updated to the canonical name. No src/ use-statement changes were needed. Gate green: phpunit 4/4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step B1 — Fix
Phlix\Plugins\Contract→Phlix\Shared\Pluginnamespace drift (MEDIUM)Problem
The example plugin's dev-stub, test bootstrap, and README referenced the legacy FQCN
Phlix\Plugins\Contract\LifecycleInterface, but the canonical host contract shipped bydetain/phlix-sharedisPhlix\Shared\Plugin\LifecycleInterface(verified read-only againstphlix-shared/src/Plugin/LifecycleInterface.php).src/HelloMetadataProvider.phpalreadyimports/implements the correct FQCN, so the dev-stub and bootstrap guard were drifting from the
real interface a fork implements.
Critically, the old
tests/bootstrap.phpguard calledinterface_exists()on a FQCN the installedpackage never provides, so it could not distinguish "real contract present" from "absent" — it
always fell through toward the stub branch on the legacy name.
Namespace correction
dev-stubs/LifecycleInterface.php—namespace Phlix\Plugins\Contract;→namespace Phlix\Shared\Plugin;; docblock canonical-path pointer corrected fromdetain/phlixsrc/Plugins/Contract/...→detain/phlix-sharedsrc/Plugin/LifecycleInterface.php. The three method signatures (onEnable/onDisable/subscribedEvents) already matched the canonical interface and are unchanged, so the stub stays a faithful byte-compatible stand-in.tests/bootstrap.php—interface_exists(\Phlix\Plugins\Contract\LifecycleInterface::class)→\Phlix\Shared\Plugin\LifecycleInterface::class(plus the docblock prose). The guard now matches whatdetain/phlix-sharedactually provides, so it loads the real contract when installed and only registers the stub when phlix-shared is absent.README.md(line ~10) — cited FQCN updated to the canonical name.No
src/use-statement changes were required (already correct).CLAUDE.md/AGENTS.md/ theopencode skill mention the legacy name only to document the known drift — out of this PR's 3-file
scope, intentionally left untouched.
Files touched
dev-stubs/LifecycleInterface.phptests/bootstrap.phpREADME.mdVerification (all green)
composer install— real fetch, no 429; installeddetain/phlix-shared 0.6.0. Confirmed the installed package providesPhlix\Shared\Plugin\LifecycleInterface(reflection →vendor/detain/phlix-shared/src/Plugin/LifecycleInterface.php, methods onEnable/onDisable/subscribedEvents) so the bootstrap guard now resolves the real contract../vendor/bin/phpunit→OK (4 tests, 4 assertions).php -lclean on both touched PHP files.Note (separate later step)
The example's B3-followup README note (required-without-default settings → host null-fills, now true
after server #329) is a separate later example step, not part of B1.
🤖 Generated with Claude Code