Skip to content

Story: Migrate Package Autoloading from PSR-0 to PSR-4 #7

Closed

Description

@Alexandre-T

Migrate Package Autoloading from PSR-0 to PSR-4

As a package maintainer,
I want the package and its test suite to use PSR-4 autoloading instead of PSR-0,
so that class discovery follows the current namespace-to-directory convention and the package remains easier to maintain and consume.

Context

The package must use a single, explicit autoloading convention for production and
development code. Production classes must live under lib/, and test classes
must live under tests/. The legacy paths lib/LongitudeOneCore and
tests/LongitudeOne/Core must no longer be used.

The migration covers Composer configuration, source and test directory
alignment, generated autoload metadata, and maintained documentation or tooling
configuration that still assumes PSR-0.

Existing public fully qualified class names and package behavior must remain unchanged. Third-party files under vendor/ are outside the scope of this migration.

Acceptance Criteria

  • Composer maps the production namespace to the source directory through PSR-4 autoloading.
  • Composer maps the test namespace to the test directory through PSR-4 development autoloading.
  • Production classes are stored under lib/, and test classes are stored under tests/.
  • The legacy directories lib/LongitudeOneCore and tests/LongitudeOne/Core are no longer present or referenced by maintained project files.
  • Every maintained production and test class is located at the path implied by its fully qualified class name and its PSR-4 namespace prefix.
  • No maintained Composer configuration, documentation, or tooling configuration relies on PSR-0 autoloading.
  • Existing public fully qualified class names remain available without code changes for package consumers.
  • A fresh optimized Composer autoloader discovers every production and test class without warnings or errors.

Constraints

  • The migration must preserve the package's public namespaces and class names.
  • Files under vendor/ must not be modified as part of this Story.
  • The resulting autoload configuration must remain compatible with the package's supported PHP version and Composer package layout.

Definition of Done

The project's common Definition of Done applies. Complete this checklist with any additional verification required specifically by this story.

  • composer test-local passes.
  • composer quality passes.
  • composer dump-autoload --optimize completes without warnings or errors.
  • A clean-install or isolated autoload verification confirms that the production and test namespaces resolve from their PSR-4 directories.
  • The migration and any compatibility considerations are documented for maintainers and package consumers.

Activity

  1. linked a pull request that will close this issuechore: PSR-4 improved #9on Sep 28, 2026
  2. self-assigned this
    on Oct 1, 2026
  3. added this to the Version 1.x.0 milestone on Oct 3, 2026
  4. changed the title [-]Migrate Package Autoloading from PSR-0 to PSR-4[/-] [+]Story: Migrate Package Autoloading from PSR-0 to PSR-4[/+] on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomers. Suitable for a first contribution.

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions