Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-issue-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.3"
php-version: "8.5"

- uses: "ramsey/composer-install@v3"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.3"
php-version: "8.5"

- name: "Install issue-bot dependencies"
uses: "ramsey/composer-install@v3"
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.3"
php-version: "8.5"

- uses: "ramsey/composer-install@v3"
with:
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.3"
php-version: "8.5"

- name: "Install issue-bot dependencies"
uses: "ramsey/composer-install@v3"
Expand Down
1 change: 1 addition & 0 deletions issue-bot/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ parameters:
- src
- tests
- console.php
phpVersion: 80500
35 changes: 19 additions & 16 deletions issue-bot/src/Playground/TabCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace PHPStan\IssueBot\Playground;

// phpcs:ignoreFile

use function array_filter;
use function array_map;
use function array_values;
Expand All @@ -28,22 +30,23 @@ public function create(array $versionedErrors): array
$last = null;

foreach ($versionedErrors as $phpVersion => $errors) {
$errors = array_values(array_filter($errors, static fn (PlaygroundError $error) => $error->getIdentifier() !== 'phpstanPlayground.configParameter'));
$errors = array_map(static function (PlaygroundError $error): PlaygroundError {
if ($error->getIdentifier() === null) {
return $error;
}

if (!str_starts_with($error->getIdentifier(), 'phpstanPlayground.')) {
return $error;
}

return new PlaygroundError(
$error->getLine(),
sprintf('Tip: %s', $error->getMessage()),
$error->getIdentifier(),
);
}, $errors);
$errors = array_filter($errors, static fn (PlaygroundError $error) => $error->getIdentifier() !== 'phpstanPlayground.configParameter')
|> array_values(...)
|> (static fn ($errors) => array_map(static function (PlaygroundError $error): PlaygroundError {
Comment on lines +34 to +35
Copy link
Contributor

Choose a reason for hiding this comment

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

😍

Copy link
Contributor

@staabm staabm Oct 24, 2025

Choose a reason for hiding this comment

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

this mix of old-style callback-functions and pipe-operator looks really weird and hard to understand :/

Copy link
Member Author

Choose a reason for hiding this comment

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

if ($error->getIdentifier() === null) {
return $error;
}

if (!str_starts_with($error->getIdentifier(), 'phpstanPlayground.')) {
return $error;
}

return new PlaygroundError(
$error->getLine(),
sprintf('Tip: %s', $error->getMessage()),
$error->getIdentifier(),
);
}, $errors));
$current = [
'versions' => [$phpVersion],
'errors' => $errors,
Expand Down
Loading