Skip to content

Organize native enum extension namespaces and simplify Compose resource naming - #21

Open
gachakra wants to merge 3 commits into
mainfrom
chore/organize-extension-namespaces
Open

gachakra wants to merge 3 commits into
mainfrom
chore/organize-extension-namespaces

Conversation

@gachakra

@gachakra gachakra commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Namespace organization

  • Move the six native extension types into Extension/Case, Extension/Collection, and Extension/Composite under the existing PSR-4 root. Retain class names, method contracts, ClassBased, EnumTraits, and Internal namespaces.
  • Update imports, FQCNs, PHPStan expected types and CI paths, README migration guidance and revision-pinned executable example links. Preserve the existing negative fixture line numbers and diagnostic checks.
  • Record the accepted architectural direction in ADR 0012. This is an intentional namespace break for the next major release; no compatibility aliases or speculative types are introduced. Class-based nameToElement() remains supported.

Docker Compose

  • Set name: php-enumex, tag the local image using ${COMPOSE_PROJECT_NAME}:local, and use Compose-managed container names and the default network.
  • Preserve composer-only image build ownership, php pull_policy never, the one-shot Composer installation, shared bind-mounted vendor directory, named cache and successful-completion startup dependency from Separate Composer and PHP development services #19.
  • Document cleanup using the previous configuration before migration, and project-name overrides for isolated checkouts.

Review and validation

Namespace implementation, migration documentation and Compose changes are separate commits. The existing Composer PSR-4 mapping remains unchanged. The authoring environment has not run PHP or Docker execution tests; verify both supported PHP versions, PHPStan fixtures, distribution archives and all executable examples in CI/review. Independently verify fresh Compose startup, failed installation, single build ownership, project-name overrides, and resource isolation. Check for stale live namespace references while retaining historical ADRs. No release/tag changes.

@gachakra
gachakra marked this pull request as ready for review December 3, 2026 08:43

@gachakra gachakra left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Independently reviewed ea236f6832662d5138177896160b3132ead9d474. I found one Compose project-name edge case. The namespace migration matches ADR 0012 and the documented major-release break.

  • All six relocated types autoloaded through Composer at their new FQCNs. Their implementations match the base after accounting for namespace declarations and imports. I verified that the previous FQCNs have no aliases, the Class-based nameToElement() alias still works, and all 15 pinned README examples match the PR head.
  • PHP 8.4.28 and 8.5.13 each passed 369 PHPUnit tests with 1,577 assertions, 25 executable examples, and the PHPStan 2.3.7 CI checks with the expected diagnostics. Composer validation, platform requirements, strict PSR-4, PHP lint, and the Git and Composer archive checks passed.
  • On Docker Compose v2.40.3, two checkouts started concurrently with distinct -p names, image tags, containers, networks, cache volumes, and bind-mounted vendor/ directories. Each built one image, and a failing Composer install blocked fresh PHP startup in one checkout without affecting the other. I also verified recovery and old-configuration cleanup in an isolated migration. Docker validation ran on Docker Desktop.

Comment thread docker-compose.yml

composer:
image: php-enumex:local
image: ${COMPOSE_PROJECT_NAME}:local

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

[P3] Handle Compose project names that are invalid Docker repository names

docker compose -p review_ config accepts the project name and resolves both images to review_:local, but docker compose -p review_ build composer fails with invalid reference format. The README presents -p as the way to isolate a checkout, so an otherwise valid override can prevent startup. Putting the project name in the tag of a fixed repository avoids this separator mismatch. I verified that both services start with php-enumex:${COMPOSE_PROJECT_NAME} and a project name ending in _. Compose project-name rules

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