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
Requires
- php: ^8.2
- achinon/toolset: ^1.0
- symfony/console: ^7.0
- symfony/framework-bundle: ^7.0
- symfony/yaml: ^7.0
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.
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/"