Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S SWITCHwayf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

We are happy to announce the rollout of GitLab 15.0 in July! 🥳 Please check the information on breaking changes and feature removals to determine if your workflows are impacted.

  • AAI
  • SWITCHwayf
  • Issues
  • #1

Closed
Open
Created Jul 03, 2021 by Sébastien VIGNERON@vignemail1

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking