Skip to content

Require --autoload option when running phparkitect as PHAR#601

Open
fain182 wants to merge 2 commits intomainfrom
claude/add-phar-mandatory-option-4tDuL
Open

Require --autoload option when running phparkitect as PHAR#601
fain182 wants to merge 2 commits intomainfrom
claude/add-phar-mandatory-option-4tDuL

Conversation

@fain182
Copy link
Copy Markdown
Collaborator

@fain182 fain182 commented Mar 29, 2026

Summary

This PR adds validation to require the --autoload option when phparkitect is executed as a PHAR file, preventing runtime errors from missing autoloader configuration.

Implementation Details

  • The isRunningAsPhar() method is protected to allow test mocking/overriding
  • Error handling occurs early in the execute flow, before attempting to load configuration
  • The error message clearly indicates the --autoload option is required for PHAR execution
  • Uses self::ERROR_CODE for consistent error exit code handling

https://claude.ai/code/session_01DHLEWujytAcAhyLyxELTuS

When phparkitect is used as a PHAR, no project autoloader is loaded
automatically, so --autoload must be explicitly provided to avoid
silent class-resolution failures.

https://claude.ai/code/session_01DHLEWujytAcAhyLyxELTuS
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.32%. Comparing base (9498feb) to head (720a0c5).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #601   +/-   ##
=========================================
  Coverage     98.31%   98.32%           
- Complexity      681      684    +3     
=========================================
  Files            86       86           
  Lines          1960     1965    +5     
=========================================
+ Hits           1927     1932    +5     
  Misses           33       33           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants