achinon/yaml_classer

Transforms YAML files into callable classes for easy reference inside of your IDE.

Installs: 245

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

v1.0.8 2024-10-11 12:04 UTC

This package is auto-updated.

Last update: 2025-09-11 13:52:57 UTC


README

Transforms YAML files into callable classes for easy reference inside of your IDE.

Setup:

To install the package, run composer require achinon/yaml_classer.

With the package installed, to generate PHP code of off your YAML file, peform the command with the filename and the name of the class you wish for it to have.

php bin/console achinon:yaml_classer example_config.yml ExampleConfig

The PHP Class should be created.

Now you can use Dependency Injection to access your config, or just create a new instance without any additional parameters required.

Usage example

YAML file imported in example above:

example: 1
example2: 'example'
example3:
  example4: 'hey'
  example5: 'hi'
  example6:
    example7: 
      - 'hello'
      - 'sadnioaseinko'
  example8: "https://github.com/Achinon/yaml_classer/"