Download the PHP package germania-kg/yaml-services without Composer
On this page you can find all versions of the php package germania-kg/yaml-services. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download germania-kg/yaml-services
More information about germania-kg/yaml-services
Files in germania-kg/yaml-services
Package yaml-services
Short Description Callable Symfony YAML wrapper, with Pimple Service provider and PSR-3 Logger support
License MIT
Informations about the package yaml-services
Germania KG · YAML Services
Callable wrappers around Symfony's YAML component, with Pimple 3 Service provider and optional PSR3 Logger support.
Installation with Composer
Parse YAML string
Parse YAML file
Configuration
Both YamlParserCallable and YamlFileParserCallable accept the usual YAML Parser options, as described here: Symfony YAML Component or on GitHub. — Additionally, the constructor accepts any PSR 3 Logger.
Example 1: YamlParserCallable
Example 2: YamlFileParserCallable
Pimple Service Provider
Registering the Service Provider
Use YAML services
Configuring the Service Provider
The PimpleServiceProvider constructor allows you to optionally pass these dependencies:
- YAML Parser options, service name:
Yaml.Flags
- The Symfony Finder instance, service name:
Yaml.Finder
- The PSR 3 Logger instance, service name:
Yaml.Logger
As all dependencies are Pimple services as well, you alternatively may override each service like this:
Development
Unit tests
Either copy phpunit.xml.dist
to phpunit.xml
and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:
All versions of yaml-services with dependencies
pimple/pimple Version ^3.0
symfony/yaml Version ^3.2
symfony/finder Version ^3.0
psr/log Version ^1.0