Stricter PHP quality tests in GitLab CI

Created on 19 January 2024, 5 months ago
Updated 20 February 2024, 4 months ago

Problem/Motivation

Currently GitLab CI carries out code quality tests, but they are not required to pass.

Also, phpstan runs at the default level "1". We can do better!

Steps to reproduce

Make a change that causes phpcs or phpstan tests to fail. GitLab CI will report a warning, but will not stop build passing.

Proposed resolution

Set allow_failure to false for phpcs and phpstan.

Also add a phpstan.neon file to specify the phpstan level.

I think the best we can achieve at present is level 3, but we could create follow on tasks to improve that further:

  • There is one error preventing us from reaching level 5.
  • At present there are 36 errors that would need fixing for level 6, but they are mostly parameter and variable types, so shouldn't be too hard to fix.

Remaining tasks

  • Add allow_failure variables to .gitlab-ci.yml
  • Create phpstan.neon file specifying level 3

User interface changes

N/A

API changes

N/A

Data model changes

N/A

📌 Task
Status

Fixed

Version

2.1

Component

Code

Created by

🇮🇪Ireland lostcarpark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024