Repository Guidelines
Project Structure & Module Organization
This is a PHP 8.5 library with PSR-4 autoloading (Dev\\MetadataBundle\\ mapped to the repo root).
Key directories:
src/holds the library code, organized by feature areas such asDependencyInjection/,EventSubscriber/,Mapping/, andReader/.src/Resources/contains framework resources and configuration assets.tests/Integrational/andtests/Unit/hold PHPUnit tests (current coverage is minimal).bin/phpunitis the local PHPUnit runner.
Build, Test, and Development Commands
Use Composer to install dependencies and run tests:
composer installinstalls PHP dependencies intovendor/.bin/phpunitruns the test suite usingphpunit.xml.dist(bootstrapsvendor/autoload.php).bin/phpunit --filter SomeTestruns a focused subset of tests by class or method.
Coding Style & Naming Conventions
- Indentation: 4 spaces, no tabs.
- Follow PSR-12 conventions for PHP formatting.
- Names:
PascalCasefor classes (MetadataReader),camelCasefor methods (loadMetadata), andsnake_caseonly when required by external APIs. - Keep namespaces aligned with directory structure under
src/.
Testing Guidelines
- Framework: PHPUnit (configured in
phpunit.xml.dist). - Test locations: place unit tests in
tests/Unit/and integration tests intests/Integrational/. - Naming: suffix test classes with
Test(e.g.,ReaderTest). - Run all tests with
bin/phpunitbefore opening a PR.
Commit & Pull Request Guidelines
- There is no established commit message convention yet; use clear, imperative messages (e.g., "Add metadata reader support").
- PRs should include a short description, the rationale for changes, and any relevant test evidence (command output or notes).
Configuration Tips
- PHPUnit sets
APP_ENV=testandAPP_DEBUG=truefor tests; avoid hard-coding environment values in production code.