achinon/yaml_classer

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

Maintainers

Package info

github.com/Achinon/yaml_classer

Type:symfony-bundle

pkg:composer/achinon/yaml_classer

Statistics

Installs: 621

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-03-11 14:46:39 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/"