diff --git a/README.md b/README.md index 416b66d..2ddf23e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,9 @@ Documentation is available at: https://docs.dotkernel.org/light-documentation/ [![Continuous Integration](https://github.com/dotkernel/light/actions/workflows/continuous-integration.yml/badge.svg?branch=1.0)](https://github.com/dotkernel/light/actions/workflows/continuous-integration.yml) [![codecov](https://codecov.io/gh/dotkernel/light/graph/badge.svg?token=UpVJ5ELvfZ)](https://codecov.io/gh/dotkernel/light) [![Qodana](https://github.com/dotkernel/light/actions/workflows/qodana_code_quality.yml/badge.svg)](https://github.com/dotkernel/light/actions/workflows/qodana_code_quality.yml) + [![PHPStan](https://github.com/dotkernel/light/actions/workflows/static-analysis.yml/badge.svg?branch=1.0)](https://github.com/dotkernel/light/actions/workflows/static-analysis.yml) +![PHPstan Level](https://img.shields.io/badge/PHPStan-level%208-brightgreen) ## Installing Dotkernel `light` diff --git a/bin/composer-post-install-script.php b/bin/composer-post-install-script.php index 3f55fd9..79ec95a 100644 --- a/bin/composer-post-install-script.php +++ b/bin/composer-post-install-script.php @@ -4,6 +4,9 @@ // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols +/** + * @param array{source: string, destination: string} $file + */ function copyFile(array $file): void { if (is_readable($file['destination'])) { diff --git a/phpstan.neon b/phpstan.neon index ec83f60..c357f01 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ includes: - vendor/phpstan/phpstan-phpunit/extension.neon parameters: - level: 5 + level: 8 paths: - bin - config diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 49c2fcb..82b5fcc 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -10,6 +10,12 @@ class ConfigProvider { + /** + @return array{ + * dependencies: array, + * templates: array, + * } + */ public function __invoke(): array { return [ @@ -18,6 +24,12 @@ public function __invoke(): array ]; } + /** + * @return array{ + * delegators: array>, + * factories: array, + * } + */ public function getDependencies(): array { return [ @@ -32,6 +44,16 @@ public function getDependencies(): array ]; } + /** + * @return array{ + * paths: array{ + * app: array{literal-string&non-falsy-string}, + * error: array{literal-string&non-falsy-string}, + * layout: array{literal-string&non-falsy-string}, + * partial: array{literal-string&non-falsy-string}, + * } + * } + */ public function getTemplates(): array { return [ diff --git a/src/Page/src/ConfigProvider.php b/src/Page/src/ConfigProvider.php index c46dcbe..6041f62 100644 --- a/src/Page/src/ConfigProvider.php +++ b/src/Page/src/ConfigProvider.php @@ -13,6 +13,12 @@ class ConfigProvider { + /** + @return array{ + * dependencies: array, + * templates: array, + * } + */ public function __invoke(): array { return [ @@ -21,6 +27,13 @@ public function __invoke(): array ]; } + /** + @return array{ + * delegators: array>, + * factories: array, + * aliases: array + * } + */ public function getDependencies(): array { return [ @@ -39,6 +52,11 @@ public function getDependencies(): array ]; } + /** + @return array{ + * paths: array{page: array{literal-string&non-falsy-string}} + * } + */ public function getTemplates(): array { return [ diff --git a/test/Unit/App/ConfigProviderTest.php b/test/Unit/App/ConfigProviderTest.php index 18a295f..970ad88 100644 --- a/test/Unit/App/ConfigProviderTest.php +++ b/test/Unit/App/ConfigProviderTest.php @@ -10,6 +10,7 @@ class ConfigProviderTest extends TestCase { + /** @var array>*/ protected array $config = []; protected function setup(): void diff --git a/test/Unit/Page/ConfigProviderTest.php b/test/Unit/Page/ConfigProviderTest.php index 12f8aee..67cd02f 100644 --- a/test/Unit/Page/ConfigProviderTest.php +++ b/test/Unit/Page/ConfigProviderTest.php @@ -13,6 +13,7 @@ class ConfigProviderTest extends TestCase { + /** @var array>*/ protected array $config = []; protected function setup(): void