From 1d2f73dcdead7d2cc6c7e5253a8512bb0ccac0c8 Mon Sep 17 00:00:00 2001 From: Joe Huss Date: Sun, 28 Jun 2026 22:09:22 -0400 Subject: [PATCH] fix(B1): correct lifecycle contract FQCN to Phlix\Shared\Plugin\LifecycleInterface 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 --- README.md | 2 +- dev-stubs/LifecycleInterface.php | 6 +++--- tests/bootstrap.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3410f36..a8b9ba0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This repo is the canonical hello-world template for Phlix plugin authors. It does almost nothing on purpose: it implements the -`Phlix\Plugins\Contract\LifecycleInterface` contract introduced in +`Phlix\Shared\Plugin\LifecycleInterface` contract introduced in Phlix Step A.4, returns a fixed greeting when asked about one well-known fixture path, and ships with a CI workflow plus PHPUnit tests so you can fork it as a starter and replace the lookup logic diff --git a/dev-stubs/LifecycleInterface.php b/dev-stubs/LifecycleInterface.php index ba2d617..19ff526 100644 --- a/dev-stubs/LifecycleInterface.php +++ b/dev-stubs/LifecycleInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlix\Plugins\Contract; +namespace Phlix\Shared\Plugin; use Psr\Container\ContainerInterface; @@ -11,8 +11,8 @@ * * Loaded by `tests/bootstrap.php` when the plugin is tested outside a * Phlix server checkout. Keep this file byte-compatible with the - * canonical definition in `detain/phlix` at - * `src/Plugins/Contract/LifecycleInterface.php`. + * canonical definition in `detain/phlix-shared` at + * `src/Plugin/LifecycleInterface.php`. * * @internal Tests only — never autoloaded into production. */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2ccb005..5597af2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -6,7 +6,7 @@ * Test bootstrap for the plugin's own PHPUnit suite. * * The plugin's runtime dependency is the Phlix server, which provides - * `Phlix\Plugins\Contract\LifecycleInterface`. In an installed plugin + * `Phlix\Shared\Plugin\LifecycleInterface`. In an installed plugin * (`var/plugins/phlix-plugin-example/`) that interface is resolved by * the host application's autoloader. When the plugin is tested in * isolation — `composer install && vendor/bin/phpunit` from this @@ -21,6 +21,6 @@ require __DIR__ . '/../vendor/autoload.php'; -if (!interface_exists(\Phlix\Plugins\Contract\LifecycleInterface::class)) { +if (!interface_exists(\Phlix\Shared\Plugin\LifecycleInterface::class)) { require __DIR__ . '/../dev-stubs/LifecycleInterface.php'; }