Skip to content

fix(B1): correct lifecycle contract FQCN to Phlix\Shared\Plugin\LifecycleInterface#3

Merged
detain merged 1 commit into
masterfrom
fix/example-b1
Jun 29, 2026
Merged

fix(B1): correct lifecycle contract FQCN to Phlix\Shared\Plugin\LifecycleInterface#3
detain merged 1 commit into
masterfrom
fix/example-b1

Conversation

@detain

@detain detain commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Step B1 — Fix Phlix\Plugins\ContractPhlix\Shared\Plugin namespace 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 by
detain/phlix-shared is Phlix\Shared\Plugin\LifecycleInterface (verified read-only against
phlix-shared/src/Plugin/LifecycleInterface.php). src/HelloMetadataProvider.php already
imports/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.php guard called interface_exists() on a FQCN the installed
package 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.phpnamespace Phlix\Plugins\Contract;namespace Phlix\Shared\Plugin;; docblock canonical-path pointer corrected from detain/phlix src/Plugins/Contract/...detain/phlix-shared src/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.phpinterface_exists(\Phlix\Plugins\Contract\LifecycleInterface::class)\Phlix\Shared\Plugin\LifecycleInterface::class (plus the docblock prose). The guard now matches what detain/phlix-shared actually 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 / the
opencode 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.php
  • tests/bootstrap.php
  • README.md

Verification (all green)

  • composer install — real fetch, no 429; installed detain/phlix-shared 0.6.0. Confirmed the installed package provides Phlix\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/phpunitOK (4 tests, 4 assertions).
  • php -l clean 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

…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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

@detain detain merged commit e049ac2 into master Jun 29, 2026
1 of 3 checks passed
@detain detain deleted the fix/example-b1 branch June 29, 2026 02: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