Refactor userـldap app commands
Summary
I have made some adjustments to the apps/user_ldap/lib/Command classes to improve the code readability.
The improvements in this PR include but are not limited to:
- Using PHP8's constructor property promotion
- Adding return types
- Replacing return code integers with more readable strings.
- Using early returns
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
Looks like some void-annotated methods do actually return values?
Hello @Fenn-CS, Thank you for reviewing the PR.
No method with the return type of void returns any values. The git diff seems like the return belongs to the method with a void return type, but it actually does not.
These two lines do not belong to the same method:
Here is the expanded diff:
I’m not sure why there is so much hate towards
elsestatements, I find things clearer with them that without. Especially thecontinuein the loop instead of a simpleelselooks convoluted. I like the strong typing, constructor promotion and constant usage in returns though.Please revert at least the
match (true).
Thank you for taking the time to review the changes Come. This was one of my older PRs and I appreciate your suggestions.