-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Yaml] Warnings emitted if configuration file is empty #44
Comments
Nice catch! Can you create a PR with this check (and a related test)? |
hassankhan
added a commit
that referenced
this issue
Jan 23, 2016
* release/0.9.0: Updated `CHANGELOG.md` Close #55. Unset cache after a set (another case) Close #55. Unset cache after a set Fixed code sniffer errors Added unit tests for Iterator methods and implementation as a whole Fixed explanation in docblocks for current and key AbstractConfig implements Iterator; added declaration and five needed methods PSR-2 Closed #44. Add documentation for all method Add all() method to AbstractConfig.php, ConfigInterface.php and add test. Close #48. Fix #49. Remove !$temp check to fix loading an empty array [ci skip] Names update Some refactoring in `Config` General fixes, updated tests Update .gitignore Remove remove ùethod Add has and remove methods
peter279k
pushed a commit
to open-source-contributions/config
that referenced
this issue
May 8, 2021
…it/phpunit-8.1.3 Bump phpunit/phpunit from 8.1.2 to 8.1.3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When constructing a new Config object, if the target file is empty, the following two warnings are emitted:
config/src/Config.php
Line 65 in b7ab317
This is due to the fact that the Yaml parser will return null if the file is empty (thus not an array). An "easy" fix would be to cast the result of $parser->parse($path) to an array:
What do you think?
The text was updated successfully, but these errors were encountered: