Skip to content

Leave PHPStan and Larastan out of the release PHAR - #25

Merged
tehwave merged 1 commit into
mainfrom
build/leave-phpstan-out-of-phar
Nov 23, 2026
Merged

tehwave merged 1 commit into
mainfrom
build/leave-phpstan-out-of-phar

Conversation

@tehwave

@tehwave tehwave commented Nov 23, 2026

Copy link
Copy Markdown
Owner

The release PHAR bundles every package in vendor/, development tools included, because Laravel Zero's Packagist setup makes laravel-zero/framework a dev dependency and sets exclude-dev-files to false. Larastan pulls in PHPStan, which made up 69% of the PHAR: 29.7 of 43.1 MB compressed.

Changed

  • box.json packs vendor/ through a finder that leaves out phpstan/phpstan and larastan/larastan.
  • dump-autoload is on, so Box rebuilds the autoloader without them; PHPStan's bootstrap.php would otherwise be loaded on every start.
  • RELEASING.md says why, so a large dev tool added later is left out too.

Testing

Built from main at version 0.3.0: the PHAR is 14.5 MB instead of 45.9 MB, contains no PHPStan or Larastan files, and its autoloader no longer mentions PHPStan. list --raw, the default screen and the help for callbacks:watch, payments:capture, merchants:access and api are identical to the current PHAR. merchants:list, api GET /ping and callbacks:watch run through to the network step. composer check passes.

🤖 Generated with Claude Code

The PHAR bundles development packages because laravel-zero/framework is
one, as Laravel Zero's Packagist instructions require. PHPStan, pulled
in by Larastan, made up 69% of it. box.json now packs vendor/ without
those two packages and rebuilds the autoloader, since PHPStan registers
a bootstrap file that every start would otherwise load.

The 0.3.0 PHAR shrinks from 45.9 MB to 14.5 MB; its command list,
default screen and help output are identical to the unshrunk build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tehwave
tehwave merged commit e3b5702 into main Nov 23, 2026
7 checks passed
@tehwave tehwave mentioned this pull request Nov 23, 2026
@tehwave
tehwave deleted the build/leave-phpstan-out-of-phar branch November 23, 2026 20:15
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