Skip to content

Commit 080b82f

Browse files
authored
feat: update phpstan 2.0 (#11)
* feat: update phpstan 2.0 * chore: update gitignore * fix: change handlers type * fix: adding a more descriptive argument for handlers setter
1 parent c92407e commit 080b82f

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

.gitignore

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
.build/
2-
vendor
3-
composer.lock
4-
.php-cs-fixer.cache
5-
phpunit.xml
6-
.idea
7-
.phpunit.result.cache
8-
var/
1+
# Composer
2+
/vendor/
3+
/composer.lock
4+
5+
# PHPUnit
6+
/phpunit.xml
7+
/.phpunit.result.cache
8+
/.phpunit.cache/
9+
10+
# PHP-CS-Fixer
11+
/.php-cs-fixer.cache
12+
13+
# Build artifacts
14+
/.build/
15+
/var/

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"php": ">=8.3",
1414
"oskarstark/enum-helper": "^1.5",
1515
"psr/log": "^3.0",
16-
"storyblok/php-content-api-client": ">=0.2.0",
16+
"storyblok/php-content-api-client": ">=0.4.0",
1717
"symfony/config": "^6.0 || ^7.0",
1818
"symfony/dependency-injection": "^6.0 || ^7.0",
1919
"symfony/framework-bundle": "^6.0 || ^7.0",
2020
"symfony/http-client": "^6.0 || ^7.0",
2121
"symfony/http-kernel": "^6.0 || ^7.0",
2222
"symfony/monolog-bundle": "^3.10",
23-
"thecodingmachine/safe": "^2.0",
23+
"thecodingmachine/safe": "^2.0 || ^3.0",
2424
"webmozart/assert": "^1.11"
2525
},
2626
"require-dev": {
@@ -30,11 +30,11 @@
3030
"ergebnis/test-util": "^1.5",
3131
"matthiasnoback/symfony-config-test": "^5.2",
3232
"phpstan/extension-installer": "^1.0",
33-
"phpstan/phpstan": "^1.0",
34-
"phpstan/phpstan-webmozart-assert": "^1.0",
33+
"phpstan/phpstan": "^2.0",
34+
"phpstan/phpstan-webmozart-assert": "^2.0",
3535
"phpunit/phpunit": "^9.0",
3636
"symfony/event-dispatcher": "^6.0 || ^7.1",
37-
"thecodingmachine/phpstan-safe-rule": "^1.0"
37+
"thecodingmachine/phpstan-safe-rule": "^1.4"
3838
},
3939
"config": {
4040
"sort-packages": true,

src/Webhook/WebhookEventHandlerChain.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
iterable $handlers,
3737
private LoggerInterface $logger,
3838
) {
39-
$this->handlers = iterator_to_array($handlers);
39+
$this->handlers = iterator_to_array($handlers, preserve_keys: false);
4040
}
4141

4242
/**
@@ -78,9 +78,9 @@ public function supports(Event $event): bool
7878
*/
7979
private function getHandlers(Event $event): array
8080
{
81-
return array_filter(
81+
return array_values(array_filter(
8282
$this->handlers,
8383
static fn (WebhookHandlerInterface $handler) => $handler->supports($event),
84-
);
84+
));
8585
}
8686
}

0 commit comments

Comments
 (0)