Skip to content

Use exit(...) as a function#93

Merged
spaze merged 2 commits intomainfrom
spaze/new-phpstan
Apr 13, 2026
Merged

Use exit(...) as a function#93
spaze merged 2 commits intomainfrom
spaze/new-phpstan

Conversation

@spaze
Copy link
Copy Markdown
Owner

@spaze spaze commented Apr 13, 2026

Possible starting with PHP 8.4.

Requires the latest PHPStan.

Close #92

Possible starting with PHP 8.4

Close #92
@spaze spaze self-assigned this Apr 13, 2026
Copilot AI review requested due to automatic review settings April 13, 2026 19:39
Copy link
Copy Markdown

Copilot AI left a comment

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 updates the CLI entrypoint to pass exit as a first-class callable (removing the intermediate $exit closure), and bumps PHPStan to a version that supports this construct. It also includes a small variable renaming in JSON result reconstruction.

Changes:

  • Replace the $exit wrapper closure with exit(...) when constructing SecurityTxtCheckHostCli.
  • Bump phpstan/phpstan from ^2.1.45 to ^2.1.47.
  • Rename loop variables in SecurityTxtJson::createCheckHostResultFromJsonValues() for line error/warning processing.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
bin/checksecuritytxt.php Uses exit(...) as the injected exit callable for the CLI runner.
composer.json Updates PHPStan to a newer patch version needed for analysis support.
src/Json/SecurityTxtJson.php Refactors variable names while reconstructing line errors/warnings from JSON values.

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

Comment thread src/Json/SecurityTxtJson.php Outdated
Comment thread src/Json/SecurityTxtJson.php Outdated
Resolves PHPStan's "Foreach overwrites $line with its key variable."
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.


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

@spaze spaze merged commit 6af30cc into main Apr 13, 2026
10 checks passed
@spaze spaze deleted the spaze/new-phpstan branch April 13, 2026 20:09
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.

Use exit(...) instead of $exit

2 participants