hassankhan / config

Config is a lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files
MIT License
971 stars 136 forks source link

Fix #113 #114

Closed filips123 closed 5 years ago

filips123 commented 5 years ago

It fixes #113.

It adds two separated methods for parsers parseFile() and parseString(). Both then call protected method parse() to complete parsing and handle errors.

~~Fix for PHP tags in strings still need to be added. It should remove only first and last line if there are <?php, <? or ?>. If possible, other solution should be https://github.com/hassankhan/config/issues/113#issuecomment-427907512. How can I make this?~~ (fixed in 22b60dcb84097e7129739a21a17e38d0f1b0f318)


This code should work, but maybe there should be better code style and tests.

hassankhan commented 5 years ago

Hi @filips123, I had forgotten about this PR completely, my apologies.

Is there anything to be improved in particular (with regards to code style and tests)? Having had a brief look over, it seems good to me 👍

filips123 commented 5 years ago

It is finished, but code style could maybe be better. What do you think? Tests are also updated so this could probably be merged.

hassankhan commented 5 years ago

Personally, didn't see any major issues with code style 👍 thanks again for your hard work, @filips123, much appreciated 🎉