Skip to content

ci: add PHPStan L9 + PHPCS PSR12 + coverage (S1/S2)#5

Merged
detain merged 1 commit into
masterfrom
fix/example-s1
Jun 29, 2026
Merged

ci: add PHPStan L9 + PHPCS PSR12 + coverage (S1/S2)#5
detain merged 1 commit into
masterfrom
fix/example-s1

Conversation

@detain

@detain detain commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Implements S1 (CI gap — no static analysis) and S2 (coverage gap) for phlix-plugin-example.

Changes

  • PHPStan L9: phpstan/phpstan dev dependency + phpstan.neon (level 9, include src/)
  • PHPCS PSR12: squizlabs/php_codesniffer dev dependency + phpcs.xml (PSR12, include src/, exclude vendor/)
  • Coverage: phpunit.xml updated with Cobertura XML output to coverage.xml
  • CI Matrix: Updated .github/workflows/test.yml — PHP 8.3 + 8.4 matrix, pcov coverage driver, PHPStan + PHPCS steps after PHPUnit
  • Composer scripts: "phpstan": "vendor/bin/phpstan analyse src --level=9" and "phpcs": "vendor/bin/phpcs src --standard=PSR12"
  • Bugfix: Removed unused $container property that PHPStan L9 flagged (property.onlyWritten)

Gate Output

$ vendor/bin/phpstan analyse src --level=9
[OK] No errors

$ vendor/bin/phpcs src --standard=PSR12
(no output — clean)

$ vendor/bin/phpunit --colors=always
OK (4 tests, 4 assertions)
Generating code coverage report in Cobertura XML format ... done

Success Conditions

  • vendor/bin/phpstan analyse src --level=9 clean
  • vendor/bin/phpcs src --standard=PSR12 clean
  • vendor/bin/phpunit green
  • CI passes on PHP 8.3 + 8.4
  • Coverage gate active

Finding(s): S1 (CI gap — no static analysis), S2 (coverage gap)
Dependencies: B3 done separately in phlix-server
Consumer impact: None — devinfra only

S1 (CI gap — no static analysis), S2 (coverage gap)

- Add phpstan/phpstan and squizlabs/php_codesniffer as dev dependencies
- Create phpstan.neon at root — level 9, include src/
- Create phpcs.xml at root — PSR12 standard, include src/, exclude vendor/
- Update .github/workflows/test.yml to run PHPStan + PHPCS after PHPUnit
- Update phpunit.xml to enable coverage output to coverage.xml
- Update composer.json with scripts for phpstan and phpcs
- Fix PHPStan error: remove unused $container property (property.onlyWritten)

Gate: vendor/bin/phpunit green + vendor/bin/phpstan analyse src --level=9 clean + vendor/bin/phpcs src --standard=PSR12 clean
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@detain detain merged commit 3f6ae27 into master Jun 29, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant