Repository navigation
fix(stubs): generate code that passes phpstan and pint - #52
Merged
Merged
Conversation
Sort the imports of every generated PHP file the way Pint orders them, import the classes the autoload guard checks and drop the spaces around the concatenation operator, so regenerating the file no longer dirties the diff.
danielebarbaro
force-pushed
the
docs/boost-class-placement
branch
from
November 16, 2026 13:09
e9ef55b to
3441652
Compare
danielebarbaro
force-pushed
the
fix/generated-code-quality
branch
from
November 16, 2026 13:09
8f8e1bf to
6951c39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #51, merge that first.
I ran the package on a Laravel 13 app with PHPStan level 7 (Larastan) and Pint, and the generated code needed manual fixes before it could be committed. This PR fixes that.
PHPStan. The classes written by
clean-arch:installhad 19 errors at level 7. The stubs now have proper array shapes, generics, return and parameter types. The other generators got the same cleanup.Pint. Generated files had trailing spaces, missing final newlines, missing trailing commas and unsorted or unused imports. The stubs are fixed and the generators now sort imports the way Pint does.
phparkitect.phpis also Pint clean now, so regenerating it with--forceno longer dirties the diff.Smaller fixes:
CLEAN_ARCHITECTURE.mdis now formatted the way Prettier expects.clean-arch:installpointed to aREADME.mdit never writes and suggested a plural domain name (Users). It now mentionsCLEAN_ARCHITECTURE.mdand suggestsProduct.clean-arch:make-arch-rulesonly tells you to install phparkitect when it's actually missing.Docs. README and Boost skill now explain:
Exceptionsfolder next to the model, extendingDomainException)boost:updateonly offers new packages in an interactive terminal, so in CI you add the package toboost.jsonby handphp artisan make:classNew tests run the real Pint and PHPStan level 7 on everything the generators produce.
Generated files change in types, docblocks, import order and whitespace, but no public class or method is removed. Patch release.
One thing left out on purpose: the three exceptions
installputs inInfrastructure/Exceptionscan't be thrown from an action without breaking the layer rules. Moving them would affect existing projects, so for now the skill just says not to throw them from actions or models.