charcoal-config 0.9.0
Key Features
PSR-11
Replaced container-interop/container-interop with psr/container, as per official deprecation.
AbstractConfig
now implements Psr\Container\ContainerInterface
.
File Loader Mixin
Added FileAwareInterface
and FileAwareTrait
to decouple configuration file loading from AbstractConfig
, and implemented by.
Changed INI/JSON/PHP/YAML loader methods to throw UnexpectedValueException
instead of InvalidArgumentException
Unit Tests
The tests were completely rewritten to take advantage of PHPUnit 5.7+ and provide clearer cases, focused assertions, and greater coverage of features.
What's new in 0.9.0?
Added
offsetReplace()
method to decouple data replacement inAbstractConfig::merge()
method:
AbstractConfig::offsetReplace(string $key, mixed $value) : void
FileAwareInterface
andFileAwareTrait
mixin to decouple file loading fromAbstractConfig
- Documentation directory for extended information and examples on this component's features
AbstractTestCase
,AssertionsTrait
, andFixturesTrait
, as the basis for the component's test cases
Changed
- Breaking: Replace deprecated container-interop/container-interop with psr/container, implemented by
AbstractConfig
- Breaking:
ConfigInterface
andAbstractConfig
now implementFileAwareInterface
andFileAwareTrait
, respectively - Breaking:
::loadIniFile()
,::loadJsonFile()
,::loadPhpFile()
, and::loadYamlFile()
methods to throwUnexpectedValueException
- Breaking: Rewrite all unit tests and file and directory structure of tests
ConfigurableTrait::config()
method to accept a custom fallback value if specified key does not exist:
ConfigurableTrait::config(string $key, mixed $default = null) : mixed
- Rewrite
::loadJsonFile()
method to usejson_last_error_msg()
function - Rewrite
::loadPhpFile()
method to catch potential exceptions and throwables - Rewrite
::loadYamlFile()
method to catch potential exceptions from Symfony's YAML parser - Rewrite class, method, and property comments
- Rewrite README and moved details to
docs/
directory - Cleanup repository; Composer manifest, development dependencies, configs for Travis, PHPUnit, PHPCS, and CircleCI
- Cleanup codebase; syntax, indentation, error messages, organization of methods
Fixed
- Issues reported by PHPStan, PHPCS, and PHPUnit
- Support for CircleCI
- Support for subsets in
AbstractEntity::data()
method:
AbstractEntity::data(array $keys = null) : array
- Add edge cases for
setData()
anddata()
methods ofAbstractEntity
- Improve existing edge cases in
ArrayAccess
methods - Support for assignments to non-nested keys in
SeparatorAwareTrait::setWithSeparator()
method