Skip to content

Commit f26cae0

Browse files
committed
phpstan level 9
opencode (opus 4.5)
1 parent 3eda0d6 commit f26cae0

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
6262
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-directory=build/phpunit/cache",
6363
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",
64-
"test:static-analysis": "mkdir -p build && bash -c 'vendor/bin/phpstan analyse src --no-progress --level=8 --error-format=junit | tee build/phpstan.junit.xml; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
64+
"test:static-analysis": "mkdir -p build && bash -c 'vendor/bin/phpstan analyse src --no-progress --level=9 --error-format=junit | tee build/phpstan.junit.xml; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
6565
"test:unit": "vendor/bin/phpunit --testsuite=Unit --coverage-text --coverage-clover=build/phpunit/clover.xml --coverage-html=build/phpunit/coverage-html --coverage-xml=build/phpunit/coverage-xml --log-junit=build/phpunit/junit.xml --cache-directory=build/phpunit/cache"
6666
}
6767
}

phpstan.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
11
parameters:
2-
ignoreErrors:
3-
-
4-
message: '#Trying to invoke \(callable\(\)\: mixed\)\|object\|string but it might not be a callable\.#'
5-
path: %currentWorkingDirectory%/src/Config.php
6-

src/Config.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ public function configureContainer(ContainerInterface $container): void
2222
return;
2323
}
2424

25+
/** @var array{services?: array<string, object>, invokables?: array<string, string>, factories?: array<string, string>, aliases?: array<string, string>, delegators?: array<string, array<int, string>>} */
2526
$dependencies = $this->config['dependencies'];
2627

28+
/** @var array<string, object> */
2729
$services = $dependencies['services'] ?? [];
30+
31+
/** @var array<string, string> */
2832
$invokables = $dependencies['invokables'] ?? [];
33+
34+
/** @var array<string, string> */
2935
$factories = $dependencies['factories'] ?? [];
3036
$aliases = $this->aliases($dependencies['aliases'] ?? [], $invokables);
37+
38+
/** @var array<string, array<int, string>> */
3139
$delegators = $dependencies['delegators'] ?? [];
3240

3341
$this->addServices($container, $services);
@@ -85,6 +93,8 @@ private function addFactories(ContainerInterface $container, array $factories):
8593
$factory = new $factory();
8694
}
8795

96+
/** @var callable(ContainerInterface, string): mixed $factory */
97+
8898
return $factory($psrContainer, $name);
8999
});
90100
}
@@ -124,6 +134,8 @@ static function (ContainerInterface $psrContainer, callable $previous) use ($nam
124134
$delegator = new $delegator();
125135
}
126136

137+
/** @var callable(ContainerInterface, string, callable): mixed $delegator */
138+
127139
return $delegator($psrContainer, $name, static fn () => $previous($psrContainer));
128140
}
129141
);

0 commit comments

Comments
 (0)