Skip to content

chore(quality): add Pint code style and PHPStan static analysis#24

Merged
jfrosorio merged 2 commits into
mainfrom
chore-23
Jul 14, 2026
Merged

chore(quality): add Pint code style and PHPStan static analysis#24
jfrosorio merged 2 commits into
mainfrom
chore-23

Conversation

@jfrosorio

Copy link
Copy Markdown
Contributor

Closes #23

Mirrors the quality setup used in codetech/laravel-eupago:

  • laravel/pint (^1.29) with the laravel preset
  • larastan/larastan (^3.10) at level 5 over src/, with an ignore for the userland-consumed HasApiLogs trait
  • Composer scripts: lint, format, analyse
  • New quality CI job running Pint and PHPStan alongside the test matrix

Findings fixed in a separate commit: one Pint phpdoc fix in ApiLog, and Redactor's private methods are now called via self:: instead of static::.

Note: README does not yet document the new commands — that lands after #20 merges to avoid conflicting edits to the Testing section.

Local runs: composer lint, composer analyse and composer test (11 tests, 43 assertions) all pass.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds standardized code style (Laravel Pint) and static analysis (Larastan/PHPStan) tooling to the package, aligning contributor workflows and CI with the quality setup described in Issue #23.

Changes:

  • Add laravel/pint and larastan/larastan as dev dependencies, plus lint, format, and analyse Composer scripts.
  • Introduce pint.json (Laravel preset) and a phpstan.neon configuration targeting src/ with an ignore for the userland-consumed HasApiLogs trait.
  • Extend CI with a dedicated quality job to run Pint and PHPStan alongside the existing test matrix.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Support/Redactor.php Switches internal private-method calls to self:: for static analysis correctness and safer resolution.
src/Models/ApiLog.php Adjusts phpdoc inheritance tag formatting for style/tooling compliance.
pint.json Adds Pint configuration using the laravel preset.
phpstan.neon Adds Larastan/PHPStan configuration for static analysis over src/.
composer.json Adds Pint/Larastan dev dependencies and Composer scripts for formatting/linting/analysis.
.github/workflows/tests.yml Adds a new quality CI job running Pint and PHPStan.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jfrosorio
jfrosorio merged commit 017d2ad into main Jul 14, 2026
10 checks passed
@jfrosorio
jfrosorio deleted the chore-23 branch July 14, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Tasks to be performed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Pint code style and PHPStan static analysis

2 participants