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 unsetting offset #124

Open filips123 opened 4 years ago

filips123 commented 4 years ago

Fixes unsetting offset. Fixes #123.

Methods unset, offsetUnset and remove now delete offset from data and cache array. I used 1. solution from here.

We should now discuss if changing the interface is really such a breaking change. Are there actually any developers who actually implemented their own AbstractConfig? We can probably release as the minor/normal version, but just add in the release notes that interface is changed.

filips123 commented 4 years ago

There is a problem with this. Problem is (probably) that unset is keyword so it can't be used as a method name for AbstractConfig in old PHP versions (PHP 5). Fix for this is to rename unset to remove or delete.

peter279k commented 4 years ago

There is a problem with this. Problem is (probably) that unset is keyword so it can't be used as a method name for AbstractConfig in old PHP versions (PHP 5). Fix for this is to rename unset to remove or delete.

This will let php-5.5 and php-5.6 can be passed on Travis CI build :).

DavidePastore commented 4 years ago

We should now discuss if changing the interface is really such a breaking change. Are there actually any developers who actually implemented their own AbstractConfig? We can probably release as the minor/normal version, but just add in the release notes that interface is changed.

I think that creating a new major release here is the best choice, but if you think that I'm wrong let's discuss about it. 😄 I'm just trying to adhere to the Semantic Versioning rules for major release:

MAJOR version when you make incompatible API changes

There is a problem with this. Problem is (probably) that unset is keyword so it can't be used as a method name for AbstractConfig in old PHP versions (PHP 5). Fix for this is to rename unset to remove or delete.

I agree that we can rename it to remove for example.