This repository has been archived by the owner on Nov 2, 2022. It is now read-only.
[CS] PSR-2 compliance: breaks compatibility (snake case => camel case) #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is only about code style and introducing compliance to PSR-2 standards, which is the de facto standard for libraries.
When reading the PR files, please consider using
SourceTree
or any software that allows you toIgnore whitespace
, because the indentation moved from tab to spaces and you wouldn't be able to check the real changes easily.It has been tested with both phpcs and php-cs-fixer.
Major BC problem:
Unfortunately, due to the renaming of the methods from snake case to camel case, all the user calls would be broken.
I can see 2 solutions to this problem:
readme.md
to add a warning and tell people to change their composer.json file requirements to v0.0.1if they do not want to change their calls yet. Maybe even add a post update / post install script that echoes something into the terminal during operations.__call
in every files to map from snake to camel case. We can useZend\Filter\Word\UnderscoreToCamelCase
(doc) andmethod-exists($this, $filter->filter($methodCalled));
(doc).