Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Yaml Classer Laravel Package

achinon/yaml_classer

Symfony bundle that converts YAML config files into generated PHP classes, enabling IDE-friendly, callable access to YAML values. Install via Composer, run a console command to generate a class, then use via DI or instantiate directly.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Config-as-Code & IDE Autocompletion: Enables developers to treat YAML configs (e.g., Symfony, Laravel, or custom configs) as strongly typed PHP classes, improving IDE tooling (autocomplete, type hints, and refactoring support).
  • Dependency Injection (DI) Integration: Aligns with Laravel/Symfony’s DI containers, allowing configs to be injected as services rather than raw arrays, reducing boilerplate and improving maintainability.
  • Build vs. Buy: Avoids reinventing YAML-to-PHP parsers (e.g., custom scripts or libraries like spatie/array-to-object), saving dev time while adding IDE-friendly features.
  • Use Cases:
    • Configuration Management: Convert app/config files (e.g., services.yml, app.yml) into reusable classes.
    • Legacy System Modernization: Retrofit older YAML-based configs with modern IDE support.
    • Plugin/Extension Development: Distribute configs as classes for easier consumption by other devs.
    • Testing: Mock configs as objects in unit tests (e.g., new ExampleConfig() instead of parsing YAML per test).

When to Consider This Package

  • Adopt When:
    • Your team relies heavily on YAML configs (e.g., Symfony, custom frameworks) and lacks IDE autocompletion.
    • You prioritize developer experience (DX) and want to reduce manual YAML parsing in code.
    • Your project uses Laravel/Symfony’s DI and you want to inject configs as typed objects.
    • You’re maintaining a codebase with scattered YAML files and want to centralize/config-as-code.
  • Look Elsewhere If:
    • Your configs are simple (e.g., flat key-value pairs) and don’t need IDE tooling.
    • You’re using JSON/XML instead of YAML (consider spatie/array-to-object or native PHP json_decode).
    • Your team prefers runtime parsing (e.g., Symfony\Component\Yaml\Yaml::parseFile()) over static classes.
    • The package’s maturity is a concern (low stars, no active maintenance; evaluate alternatives like paragonie/yaml).
    • You need schema validation (pair with webmozart/assert or symfony/yaml validators).

How to Pitch It (Stakeholders)

For Executives: "This package turns our YAML configs into reusable PHP classes, giving developers IDE autocompletion and type safety—just like our core code. It reduces bugs from manual YAML parsing and aligns with our DI architecture. For example, instead of hardcoding config['database']['host'], devs can use new DatabaseConfig()->host, cutting errors and speeding up development. Low-risk to pilot (just composer require + one CLI command per config file), with potential to modernize legacy systems and improve onboarding."

For Engineering: *"Problem: YAML configs are static files—no autocompletion, no type hints, and manual parsing is error-prone. Solution: achinon/yaml_classer converts YAML to PHP classes (e.g., ExampleConfig) that:

  • Work with Laravel/Symfony DI (inject as services).
  • Enable IDE features (autocomplete, refactoring).
  • Reduce boilerplate (no Yaml::parseFile() calls). How to Start:
  1. Install: composer require achinon/yaml_classer.
  2. Generate classes: php artisan achinon:yaml_classer config.yml AppConfig.
  3. Use in code: $config = new AppConfig(); or inject via DI. Tradeoffs: Minimal maintenance risk (simple CLI tool), but lacks schema validation out of the box. Pair with existing validators if needed. Next Steps: Pilot with 1–2 critical configs (e.g., services.yml) and measure dev feedback on IDE experience."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui