Code style and code quality improvements
First, beautiful implementation of a discovery service, easy to install and manage. Great job.
My proposal: in order to make the code clearer to read and to be easier for others to reuse or contribute to the code, it seems to me that the application of PSR standards and the use of code analysis tools would allow to improve the code and to avoid bringing regressions in the code.
For this purpose, I propose you an improved version of the code with the application of the PSR12 standard, the missing phpdoc annotations on functions and the correction of some typos in comments. You can evaluate the modifications with the following commit (not being allowed to fork or create a personal project on the SWITCH gitlab, I imported the code as a Github project).
https://github.com/vignemail1/SWITCHwayf/commit/e2d408feee789cd6bb756fe09d19590de87ef893
PSR12 standard was applied using php_CodeSniffer binaries (phpcs
for detection and phpcbf
for fix), which are easy to automate using Gitlab-CI.
Other tools can also help identify which variables or functions are not used (phpstan
or phpmd
for example).
Finally, with the use of appropriate extensions in the IDEs, all these tools can be used to detect errors or deviations from the proposed standards.
If you think these modifications are acceptable, you can either cherry-pick them or grant me some right on the SWITCH gitlab so that I can submit a Merge Request.