Skip to content

Commit 3dbc5cb

Browse files
authored
Fix phpstan (#200)
1 parent 487f878 commit 3dbc5cb

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"require-dev": {
2929
"friendsofphp/php-cs-fixer": "^3.49",
30-
"phpstan/phpstan": "^1.10",
30+
"phpstan/phpstan": "^2.0",
3131
"phpunit/phpunit": "^10.4"
3232
},
3333
"autoload-dev": {
@@ -40,5 +40,9 @@
4040
"platform": {
4141
"php": "8.1.27"
4242
}
43+
},
44+
"scripts": {
45+
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix",
46+
"phpstan": "phpstan"
4347
}
4448
}

composer.lock

+17-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon.dist

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ parameters:
55
excludePaths:
66
- %currentWorkingDirectory%/src/Container.php
77
level: 8
8-
checkMissingIterableValueType: false
8+
ignoreErrors:
9+
- '#(Property|Method) .+ type has no value type specified in iterable type array.#'
10+
- '#Method .+ has parameter .+ with no value type specified in iterable type array.#'

src/Container.php

+10-14
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,19 @@ public function __construct(Config $config, Runtime $runtime = Runtime::NORMAL)
4545
);
4646
};
4747

48-
$this[ScraperLocator::class] = static function (self $container) {
49-
return new ScraperLocator([
50-
'berlin_service' => $container[BerlinServiceScraper::class],
51-
]);
52-
};
48+
$this[ScraperLocator::class] = static fn (self $container) => new ScraperLocator([
49+
'berlin_service' => $container[BerlinServiceScraper::class],
50+
]);
5351

5452
$this[Filter::class] = static fn () => new Filter($config->getRules());
5553

56-
$this[Termin::class] = static function (self $container) use ($config) {
57-
return new Termin(
58-
$container[ScraperLocator::class],
59-
$container[LoggerInterface::class],
60-
$container[NotifierInterface::class],
61-
$container[Filter::class],
62-
$config
63-
);
64-
};
54+
$this[Termin::class] = static fn (self $container) => new Termin(
55+
$container[ScraperLocator::class],
56+
$container[LoggerInterface::class],
57+
$container[NotifierInterface::class],
58+
$container[Filter::class],
59+
$config
60+
);
6561
}
6662

6763
public function getTermin(): Termin

0 commit comments

Comments
 (0)