You just need to create an json report, store it in a Gitlab artifact and mark it as a code quality one:
phpstan:
image: my_image_with_phpstan:8
script:
- phpstan analyse src/ --error-format gitlab --no-progress > phpstan.json
artifacts:
when: always
reports:
codequality: phpstan.json