Use static instead of self when calling static functions to allow easier customisation in subclasses #96
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 replaces the usage of "self" with "static" when calling the static functions in the ResourceController. This makes it possible to inherit from the ResourceController and overwrite e.g. validateScim() without having to duplicate all methods that reference a static method as well. Without those changes the validateScim() method of the subclass would never be called.
Short example:
More infos can be found here: https://www.php.net/oop5.late-static-bindings
As far as I can see the methods don't even need to be static but changing that would be a breaking change.
Why do I need these changes? https://scimvalidator.microsoft.com requires a specific status code and scimType when creating a user fails due to the user already existing.
So what I trying to do is:
Not sure if there is an easier way to achieve this. But without the changes from the PR I would have to duplicate at least createObject() and createFromSCIM() as well which means I have to update / check them every time this plugin is updated.