diff --git a/DependencyInjection/DemoExtension.php b/DependencyInjection/DemoExtension.php index c01e385..ba2f80c 100644 --- a/DependencyInjection/DemoExtension.php +++ b/DependencyInjection/DemoExtension.php @@ -21,7 +21,7 @@ class DemoExtension extends AbstractPluginExtension implements PrependExtensionInterface { /** - * @param array $configs + * @param array $configs * @throws \Exception */ public function load(array $configs, ContainerBuilder $container): void diff --git a/Invoice/DemoSortActivityInvoiceCalculator.php b/Invoice/DemoSortActivityInvoiceCalculator.php index 9635d2e..d890c1f 100644 --- a/Invoice/DemoSortActivityInvoiceCalculator.php +++ b/Invoice/DemoSortActivityInvoiceCalculator.php @@ -45,7 +45,7 @@ protected function mergeSumInvoiceItem(InvoiceItem $invoiceItem, ExportableItem public function getEntries(): array { $entries = $this->model->getEntries(); - if (empty($entries)) { + if (\count($entries) === 0) { return []; } @@ -68,7 +68,7 @@ public function getEntries(): array $compare_a = $a->getActivity()?->getName(); $compare_b = $b->getActivity()?->getName(); - if ($compare_a == $compare_b) { + if ($compare_a === $compare_b) { return 0; } diff --git a/Widget/DemoWidget.php b/Widget/DemoWidget.php index 7628a44..dc509b5 100644 --- a/Widget/DemoWidget.php +++ b/Widget/DemoWidget.php @@ -17,7 +17,7 @@ class DemoWidget extends AbstractWidget { - public function __construct(private UserRepository $repository) + public function __construct(private readonly UserRepository $repository) { } @@ -41,7 +41,7 @@ public function getOptions(array $options = []): array } /** - * @param array $options + * @param array> $options */ public function getData(array $options = []): mixed { diff --git a/composer.json b/composer.json index 8c87f8a..0da3f9a 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,9 @@ "friendsofphp/php-cs-fixer": "^3.0", "kimai/kimai": "dev-main", "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-doctrine": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", "phpstan/phpstan-symfony": "^2.0", "symfony/console": "^6.0", "symfony/event-dispatcher": "^6.0" diff --git a/phpstan.neon b/phpstan.neon index c4993f7..9736d70 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,13 +1,17 @@ includes: - - %rootDir%/../phpstan-symfony/extension.neon - - %rootDir%/../phpstan-symfony/rules.neon - - %rootDir%/../phpstan-doctrine/extension.neon - - %rootDir%/../phpstan-doctrine/rules.neon - - %rootDir%/../phpstan/conf/bleedingEdge.neon + - %rootDir%/../phpstan-symfony/extension.neon + - %rootDir%/../phpstan-symfony/rules.neon + - %rootDir%/../phpstan-doctrine/extension.neon + - %rootDir%/../phpstan-doctrine/rules.neon + - %rootDir%/../phpstan-deprecation-rules/rules.neon + - %rootDir%/../phpstan-strict-rules/rules.neon + - %rootDir%/../phpstan/conf/bleedingEdge.neon parameters: - level: 9 - excludePaths: - - vendor/(?) - treatPhpDocTypesAsCertain: false - inferPrivatePropertyTypeFromConstructor: true + level: 9 + excludePaths: + - vendor/(?) + treatPhpDocTypesAsCertain: false + inferPrivatePropertyTypeFromConstructor: true + doctrine: + allowNullablePropertyForRequiredField: true