diff --git a/.phive/phars.xml b/.phive/phars.xml
index 24c7b5b..6a0059c 100644
--- a/.phive/phars.xml
+++ b/.phive/phars.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/tools/.phpstan/composer.json b/tools/.phpstan/composer.json
index 8e13d13..a79f73b 100644
--- a/tools/.phpstan/composer.json
+++ b/tools/.phpstan/composer.json
@@ -1,10 +1,10 @@
{
"require-dev": {
- "phpstan/phpstan": "^2.1.33",
+ "phpstan/phpstan": "^2.1.54",
"phpstan/extension-installer": "^1.4.3",
- "phpstan/phpstan-strict-rules": "^2.0.7",
+ "phpstan/phpstan-strict-rules": "^2.0.11",
"tomasvotruba/type-coverage": "^2.1.0",
- "ergebnis/phpstan-rules": "^2.12.0"
+ "ergebnis/phpstan-rules": "^2.13.1"
},
"config": {
"allow-plugins": {
diff --git a/tools/.phpstan/composer.lock b/tools/.phpstan/composer.lock
index 774d693..2a13142 100644
--- a/tools/.phpstan/composer.lock
+++ b/tools/.phpstan/composer.lock
@@ -4,40 +4,40 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "4409cdc49212f7e878b14b7ae9285bb2",
+ "content-hash": "5352dc46c7b6a0ee40e2263c4eac895f",
"packages": [],
"packages-dev": [
{
"name": "ergebnis/phpstan-rules",
- "version": "2.12.0",
+ "version": "2.13.1",
"source": {
"type": "git",
"url": "https://github.com/ergebnis/phpstan-rules.git",
- "reference": "c4e0121a937b3b551f800a86e7d78794da2783ea"
+ "reference": "f69db86b98595c34fc1f61c89fe3b380141aa519"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/c4e0121a937b3b551f800a86e7d78794da2783ea",
- "reference": "c4e0121a937b3b551f800a86e7d78794da2783ea",
+ "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/f69db86b98595c34fc1f61c89fe3b380141aa519",
+ "reference": "f69db86b98595c34fc1f61c89fe3b380141aa519",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
- "phpstan/phpstan": "^2.1.8"
+ "phpstan/phpstan": "^2.1.35"
},
"require-dev": {
"codeception/codeception": "^4.0.0 || ^5.0.0",
"doctrine/orm": "^2.20.0 || ^3.3.0",
- "ergebnis/composer-normalize": "^2.47.0",
- "ergebnis/license": "^2.6.0",
- "ergebnis/php-cs-fixer-config": "^6.54.0",
+ "ergebnis/composer-normalize": "^2.49.0",
+ "ergebnis/license": "^2.7.0",
+ "ergebnis/php-cs-fixer-config": "^6.59.0",
"ergebnis/phpunit-slow-test-detector": "^2.20.0",
"fakerphp/faker": "^1.24.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
- "phpstan/phpstan-phpunit": "^2.0.7",
- "phpstan/phpstan-strict-rules": "^2.0.6",
+ "phpstan/phpstan-phpunit": "^2.0.12",
+ "phpstan/phpstan-strict-rules": "^2.0.8",
"phpunit/phpunit": "^9.6.21",
"psr/container": "^2.0.2",
"symfony/finder": "^5.4.45",
@@ -78,20 +78,20 @@
"security": "https://github.com/ergebnis/phpstan-rules/blob/main/.github/SECURITY.md",
"source": "https://github.com/ergebnis/phpstan-rules"
},
- "time": "2025-09-07T13:31:33+00:00"
+ "time": "2026-01-27T17:13:06+00:00"
},
{
"name": "nette/utils",
- "version": "v4.1.1",
+ "version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
- "reference": "c99059c0315591f1a0db7ad6002000288ab8dc72"
+ "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nette/utils/zipball/c99059c0315591f1a0db7ad6002000288ab8dc72",
- "reference": "c99059c0315591f1a0db7ad6002000288ab8dc72",
+ "url": "https://api.github.com/repos/nette/utils/zipball/7da6c396d7ebe142bc857c20479d5e70a5e1aac7",
+ "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7",
"shasum": ""
},
"require": {
@@ -103,8 +103,10 @@
},
"require-dev": {
"jetbrains/phpstorm-attributes": "^1.2",
+ "nette/phpstan-rules": "^1.0",
"nette/tester": "^2.5",
- "phpstan/phpstan-nette": "^2.0@stable",
+ "phpstan/extension-installer": "^1.4@stable",
+ "phpstan/phpstan": "^2.1@stable",
"tracy/tracy": "^2.9"
},
"suggest": {
@@ -165,9 +167,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
- "source": "https://github.com/nette/utils/tree/v4.1.1"
+ "source": "https://github.com/nette/utils/tree/v4.1.4"
},
- "time": "2025-12-22T12:14:32+00:00"
+ "time": "2026-05-11T20:49:54+00:00"
},
{
"name": "phpstan/extension-installer",
@@ -219,11 +221,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.33",
+ "version": "2.1.54",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f",
- "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8be50c3992107dc837b17da4d140fbbdf9a5c5bd",
+ "reference": "8be50c3992107dc837b17da4d140fbbdf9a5c5bd",
"shasum": ""
},
"require": {
@@ -268,25 +270,25 @@
"type": "github"
}
],
- "time": "2025-12-05T10:24:31+00:00"
+ "time": "2026-04-29T13:31:09+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",
- "version": "2.0.7",
+ "version": "2.0.11",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
- "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538"
+ "reference": "9b000a578b85b32945b358b172c7b20e91189024"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d6211c46213d4181054b3d77b10a5c5cb0d59538",
- "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538",
+ "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/9b000a578b85b32945b358b172c7b20e91189024",
+ "reference": "9b000a578b85b32945b358b172c7b20e91189024",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
- "phpstan/phpstan": "^2.1.29"
+ "phpstan/phpstan": "^2.1.39"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
@@ -312,11 +314,14 @@
"MIT"
],
"description": "Extra strict and opinionated rules for PHPStan",
+ "keywords": [
+ "static analysis"
+ ],
"support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
- "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.7"
+ "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.11"
},
- "time": "2025-09-26T11:19:08+00:00"
+ "time": "2026-05-02T06:54:10+00:00"
},
{
"name": "tomasvotruba/type-coverage",
diff --git a/tools/.phpstan/vendor/composer/autoload_classmap.php b/tools/.phpstan/vendor/composer/autoload_classmap.php
index c66a950..348b3ff 100644
--- a/tools/.phpstan/vendor/composer/autoload_classmap.php
+++ b/tools/.phpstan/vendor/composer/autoload_classmap.php
@@ -49,6 +49,9 @@ return array(
'Nette\\Utils\\JsonException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
'Nette\\Utils\\ObjectHelpers' => $vendorDir . '/nette/utils/src/Utils/ObjectHelpers.php',
'Nette\\Utils\\Paginator' => $vendorDir . '/nette/utils/src/Utils/Paginator.php',
+ 'Nette\\Utils\\Process' => $vendorDir . '/nette/utils/src/Utils/Process.php',
+ 'Nette\\Utils\\ProcessFailedException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
+ 'Nette\\Utils\\ProcessTimeoutException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
'Nette\\Utils\\Random' => $vendorDir . '/nette/utils/src/Utils/Random.php',
'Nette\\Utils\\Reflection' => $vendorDir . '/nette/utils/src/Utils/Reflection.php',
'Nette\\Utils\\ReflectionMethod' => $vendorDir . '/nette/utils/src/Utils/ReflectionMethod.php',
diff --git a/tools/.phpstan/vendor/composer/autoload_static.php b/tools/.phpstan/vendor/composer/autoload_static.php
index b66b499..1ad0d18 100644
--- a/tools/.phpstan/vendor/composer/autoload_static.php
+++ b/tools/.phpstan/vendor/composer/autoload_static.php
@@ -97,6 +97,9 @@ class ComposerStaticInitf9e7218f71d5874b5632927df4f72bd7
'Nette\\Utils\\JsonException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
'Nette\\Utils\\ObjectHelpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectHelpers.php',
'Nette\\Utils\\Paginator' => __DIR__ . '/..' . '/nette/utils/src/Utils/Paginator.php',
+ 'Nette\\Utils\\Process' => __DIR__ . '/..' . '/nette/utils/src/Utils/Process.php',
+ 'Nette\\Utils\\ProcessFailedException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
+ 'Nette\\Utils\\ProcessTimeoutException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
'Nette\\Utils\\Random' => __DIR__ . '/..' . '/nette/utils/src/Utils/Random.php',
'Nette\\Utils\\Reflection' => __DIR__ . '/..' . '/nette/utils/src/Utils/Reflection.php',
'Nette\\Utils\\ReflectionMethod' => __DIR__ . '/..' . '/nette/utils/src/Utils/ReflectionMethod.php',
diff --git a/tools/.phpstan/vendor/composer/installed.json b/tools/.phpstan/vendor/composer/installed.json
index 5d61f48..1bac664 100644
--- a/tools/.phpstan/vendor/composer/installed.json
+++ b/tools/.phpstan/vendor/composer/installed.json
@@ -2,42 +2,42 @@
"packages": [
{
"name": "ergebnis/phpstan-rules",
- "version": "2.12.0",
- "version_normalized": "2.12.0.0",
+ "version": "2.13.1",
+ "version_normalized": "2.13.1.0",
"source": {
"type": "git",
"url": "https://github.com/ergebnis/phpstan-rules.git",
- "reference": "c4e0121a937b3b551f800a86e7d78794da2783ea"
+ "reference": "f69db86b98595c34fc1f61c89fe3b380141aa519"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/c4e0121a937b3b551f800a86e7d78794da2783ea",
- "reference": "c4e0121a937b3b551f800a86e7d78794da2783ea",
+ "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/f69db86b98595c34fc1f61c89fe3b380141aa519",
+ "reference": "f69db86b98595c34fc1f61c89fe3b380141aa519",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
- "phpstan/phpstan": "^2.1.8"
+ "phpstan/phpstan": "^2.1.35"
},
"require-dev": {
"codeception/codeception": "^4.0.0 || ^5.0.0",
"doctrine/orm": "^2.20.0 || ^3.3.0",
- "ergebnis/composer-normalize": "^2.47.0",
- "ergebnis/license": "^2.6.0",
- "ergebnis/php-cs-fixer-config": "^6.54.0",
+ "ergebnis/composer-normalize": "^2.49.0",
+ "ergebnis/license": "^2.7.0",
+ "ergebnis/php-cs-fixer-config": "^6.59.0",
"ergebnis/phpunit-slow-test-detector": "^2.20.0",
"fakerphp/faker": "^1.24.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
- "phpstan/phpstan-phpunit": "^2.0.7",
- "phpstan/phpstan-strict-rules": "^2.0.6",
+ "phpstan/phpstan-phpunit": "^2.0.12",
+ "phpstan/phpstan-strict-rules": "^2.0.8",
"phpunit/phpunit": "^9.6.21",
"psr/container": "^2.0.2",
"symfony/finder": "^5.4.45",
"symfony/process": "^5.4.47"
},
- "time": "2025-09-07T13:31:33+00:00",
+ "time": "2026-01-27T17:13:06+00:00",
"type": "phpstan-extension",
"extra": {
"phpstan": {
@@ -78,17 +78,17 @@
},
{
"name": "nette/utils",
- "version": "v4.1.1",
- "version_normalized": "4.1.1.0",
+ "version": "v4.1.4",
+ "version_normalized": "4.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
- "reference": "c99059c0315591f1a0db7ad6002000288ab8dc72"
+ "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nette/utils/zipball/c99059c0315591f1a0db7ad6002000288ab8dc72",
- "reference": "c99059c0315591f1a0db7ad6002000288ab8dc72",
+ "url": "https://api.github.com/repos/nette/utils/zipball/7da6c396d7ebe142bc857c20479d5e70a5e1aac7",
+ "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7",
"shasum": ""
},
"require": {
@@ -100,8 +100,10 @@
},
"require-dev": {
"jetbrains/phpstorm-attributes": "^1.2",
+ "nette/phpstan-rules": "^1.0",
"nette/tester": "^2.5",
- "phpstan/phpstan-nette": "^2.0@stable",
+ "phpstan/extension-installer": "^1.4@stable",
+ "phpstan/phpstan": "^2.1@stable",
"tracy/tracy": "^2.9"
},
"suggest": {
@@ -112,7 +114,7 @@
"ext-mbstring": "to use Strings::lower() etc...",
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
},
- "time": "2025-12-22T12:14:32+00:00",
+ "time": "2026-05-11T20:49:54+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -164,7 +166,7 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
- "source": "https://github.com/nette/utils/tree/v4.1.1"
+ "source": "https://github.com/nette/utils/tree/v4.1.4"
},
"install-path": "../nette/utils"
},
@@ -221,12 +223,12 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.33",
- "version_normalized": "2.1.33.0",
+ "version": "2.1.54",
+ "version_normalized": "2.1.54.0",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f",
- "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8be50c3992107dc837b17da4d140fbbdf9a5c5bd",
+ "reference": "8be50c3992107dc837b17da4d140fbbdf9a5c5bd",
"shasum": ""
},
"require": {
@@ -235,7 +237,7 @@
"conflict": {
"phpstan/phpstan-shim": "*"
},
- "time": "2025-12-05T10:24:31+00:00",
+ "time": "2026-04-29T13:31:09+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@@ -277,22 +279,22 @@
},
{
"name": "phpstan/phpstan-strict-rules",
- "version": "2.0.7",
- "version_normalized": "2.0.7.0",
+ "version": "2.0.11",
+ "version_normalized": "2.0.11.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
- "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538"
+ "reference": "9b000a578b85b32945b358b172c7b20e91189024"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d6211c46213d4181054b3d77b10a5c5cb0d59538",
- "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538",
+ "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/9b000a578b85b32945b358b172c7b20e91189024",
+ "reference": "9b000a578b85b32945b358b172c7b20e91189024",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
- "phpstan/phpstan": "^2.1.29"
+ "phpstan/phpstan": "^2.1.39"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
@@ -300,7 +302,7 @@
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^9.6"
},
- "time": "2025-09-26T11:19:08+00:00",
+ "time": "2026-05-02T06:54:10+00:00",
"type": "phpstan-extension",
"extra": {
"phpstan": {
@@ -320,9 +322,12 @@
"MIT"
],
"description": "Extra strict and opinionated rules for PHPStan",
+ "keywords": [
+ "static analysis"
+ ],
"support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
- "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.7"
+ "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.11"
},
"install-path": "../phpstan/phpstan-strict-rules"
},
diff --git a/tools/.phpstan/vendor/composer/installed.php b/tools/.phpstan/vendor/composer/installed.php
index eea1cec..cd5022c 100644
--- a/tools/.phpstan/vendor/composer/installed.php
+++ b/tools/.phpstan/vendor/composer/installed.php
@@ -1,9 +1,9 @@
array(
'name' => '__root__',
- 'pretty_version' => 'dev-main',
- 'version' => 'dev-main',
- 'reference' => 'd4d9bba3c5904cdebea5c9bebab27d8abd6c1af1',
+ 'pretty_version' => '7.0.x-dev',
+ 'version' => '7.0.9999999.9999999-dev',
+ 'reference' => '150ed9dd5535041d546fe5416a20dd4be31f6c36',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -11,27 +11,27 @@
),
'versions' => array(
'__root__' => array(
- 'pretty_version' => 'dev-main',
- 'version' => 'dev-main',
- 'reference' => 'd4d9bba3c5904cdebea5c9bebab27d8abd6c1af1',
+ 'pretty_version' => '7.0.x-dev',
+ 'version' => '7.0.9999999.9999999-dev',
+ 'reference' => '150ed9dd5535041d546fe5416a20dd4be31f6c36',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'ergebnis/phpstan-rules' => array(
- 'pretty_version' => '2.12.0',
- 'version' => '2.12.0.0',
- 'reference' => 'c4e0121a937b3b551f800a86e7d78794da2783ea',
+ 'pretty_version' => '2.13.1',
+ 'version' => '2.13.1.0',
+ 'reference' => 'f69db86b98595c34fc1f61c89fe3b380141aa519',
'type' => 'phpstan-extension',
'install_path' => __DIR__ . '/../ergebnis/phpstan-rules',
'aliases' => array(),
'dev_requirement' => true,
),
'nette/utils' => array(
- 'pretty_version' => 'v4.1.1',
- 'version' => '4.1.1.0',
- 'reference' => 'c99059c0315591f1a0db7ad6002000288ab8dc72',
+ 'pretty_version' => 'v4.1.4',
+ 'version' => '4.1.4.0',
+ 'reference' => '7da6c396d7ebe142bc857c20479d5e70a5e1aac7',
'type' => 'library',
'install_path' => __DIR__ . '/../nette/utils',
'aliases' => array(),
@@ -47,18 +47,18 @@
'dev_requirement' => true,
),
'phpstan/phpstan' => array(
- 'pretty_version' => '2.1.33',
- 'version' => '2.1.33.0',
- 'reference' => '9e800e6bee7d5bd02784d4c6069b48032d16224f',
+ 'pretty_version' => '2.1.54',
+ 'version' => '2.1.54.0',
+ 'reference' => '8be50c3992107dc837b17da4d140fbbdf9a5c5bd',
'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpstan',
'aliases' => array(),
'dev_requirement' => true,
),
'phpstan/phpstan-strict-rules' => array(
- 'pretty_version' => '2.0.7',
- 'version' => '2.0.7.0',
- 'reference' => 'd6211c46213d4181054b3d77b10a5c5cb0d59538',
+ 'pretty_version' => '2.0.11',
+ 'version' => '2.0.11.0',
+ 'reference' => '9b000a578b85b32945b358b172c7b20e91189024',
'type' => 'phpstan-extension',
'install_path' => __DIR__ . '/../phpstan/phpstan-strict-rules',
'aliases' => array(),
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md b/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md
index 7729147..6e0d020 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md
@@ -6,7 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## Unreleased
-For a full diff see [`2.12.0...main`][2.12.0...main].
+For a full diff see [`2.13.1...main`][2.13.1...main].
+
+## [`2.13.1`][2.13.1]
+
+For a full diff see [`2.13.0...2.13.1`][2.13.0...2.13.1].
+
+### Fixed
+
+- Adjusted `Files\NoPhpstanIgnoreRule` to traverse into all nodes ([#1011]), by [@localheinz]
+
+## [`2.13.0`][2.13.0]
+
+For a full diff see [`2.12.0...2.13.0`][2.12.0...2.13.0].
+
+### Added
+
+- Added `Files\NoPhpstanIgnoreRule`, which reports an error when a `@phpstan-ignore`, `@phpstan-ignore-line`, or `@phpstan-ignore-next-line` tag is used to suppress an error ([#1009]), by [@localheinz]
+
+### Changed
+
+- Required `phpstan/phpstan:^2.1.35` ([#1010]), by [@localheinz]
## [`2.12.0`][2.12.0]
@@ -588,6 +608,8 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[2.10.5]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.5
[2.11.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.11.0
[2.12.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.12.0
+[2.13.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.13.0
+[2.13.1]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.13.1
[362c7ea...0.1.0]: https://github.com/ergebnis/phpstan-rules/compare/362c7ea...0.1.0
[0.1.0...0.2.0]: https://github.com/ergebnis/phpstan-rules/compare/0.1.0...0.2.0
@@ -638,7 +660,9 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[2.10.4...2.10.5]: https://github.com/ergebnis/phpstan-rules/compare/2.10.4...2.10.5
[2.10.5...2.11.0]: https://github.com/ergebnis/phpstan-rules/compare/2.10.5...2.11.0
[2.11.0...2.12.0]: https://github.com/ergebnis/phpstan-rules/compare/2.11.0...2.12.0
-[2.12.0...main]: https://github.com/ergebnis/phpstan-rules/compare/2.12.0...main
+[2.12.0...2.13.0]: https://github.com/ergebnis/phpstan-rules/compare/2.12.0...2.13.0
+[2.13.0...2.13.1]: https://github.com/ergebnis/phpstan-rules/compare/2.13.0...2.13.1
+[2.13.1...main]: https://github.com/ergebnis/phpstan-rules/compare/2.13.1...main
[#1]: https://github.com/ergebnis/phpstan-rules/pull/1
[#4]: https://github.com/ergebnis/phpstan-rules/pull/4
@@ -736,6 +760,9 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[#958]: https://github.com/ergebnis/phpstan-rules/pull/958
[#972]: https://github.com/ergebnis/phpstan-rules/pull/972
[#977]: https://github.com/ergebnis/phpstan-rules/pull/977
+[#1009]: https://github.com/ergebnis/phpstan-rules/pull/1009
+[#1010]: https://github.com/ergebnis/phpstan-rules/pull/1010
+[#1011]: https://github.com/ergebnis/phpstan-rules/pull/1011
[@cosmastech]: https://github.com/cosmastech
[@enumag]: https://github.com/enumag
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/LICENSE.md b/tools/.phpstan/vendor/ergebnis/phpstan-rules/LICENSE.md
index 130e719..987526c 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/LICENSE.md
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/LICENSE.md
@@ -1,6 +1,6 @@
# The MIT License (MIT)
-Copyright (c) 2018-2025 Andreas Möller
+Copyright (c) 2018-2026 Andreas Möller
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md b/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md
index 690d4ad..afe6464 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md
@@ -58,6 +58,7 @@ This package provides the following rules for use with [`phpstan/phpstan`](https
- [`Ergebnis\PHPStan\Rules\Expressions\NoEvalRule`](https://github.com/ergebnis/phpstan-rules#expressionsnoevalrule)
- [`Ergebnis\PHPStan\Rules\Expressions\NoIssetRule`](https://github.com/ergebnis/phpstan-rules#expressionsnoissetrule)
- [`Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule`](https://github.com/ergebnis/phpstan-rules#filesdeclarestricttypesrule)
+- [`Ergebnis\PHPStan\Rules\Files\NoPhpstanIgnoreRule`](https://github.com/ergebnis/phpstan-rules#filesnophpstanignorerule)
- [`Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule`](https://github.com/ergebnis/phpstan-rules#functionsnonullablereturntypedeclarationrule)
- [`Ergebnis\PHPStan\Rules\Functions\NoParameterPassedByReferenceRule`](https://github.com/ergebnis/phpstan-rules#functionsnoparameterpassedbyreferencerule)
- [`Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule`](https://github.com/ergebnis/phpstan-rules#functionsnoparameterwithnullabletypedeclarationrule)
@@ -348,6 +349,21 @@ parameters:
enabled: false
```
+#### `Files\NoPhpstanIgnoreRule`
+
+This rule reports an error when a `@phpstan-ignore`, `@phpstan-ignore-line`, or `@phpstan-ignore-next-line` tag is used to [ignore errors reported by `phpstan/phpstan`](https://phpstan.org/user-guide/ignoring-errors#ignoring-in-code-using-phpdocs).
+
+##### Disabling the rule
+
+You can set the `enabled` parameter to `false` to disable this rule.
+
+```neon
+parameters:
+ ergebnis:
+ noPhpstanIgnore:
+ enabled: false
+```
+
### Functions
#### `Functions\NoNullableReturnTypeDeclarationRule`
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json b/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json
index 5060dde..7235712 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json
@@ -23,20 +23,20 @@
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"ext-mbstring": "*",
- "phpstan/phpstan": "^2.1.8"
+ "phpstan/phpstan": "^2.1.35"
},
"require-dev": {
"codeception/codeception": "^4.0.0 || ^5.0.0",
"doctrine/orm": "^2.20.0 || ^3.3.0",
- "ergebnis/composer-normalize": "^2.47.0",
- "ergebnis/license": "^2.6.0",
- "ergebnis/php-cs-fixer-config": "^6.54.0",
+ "ergebnis/composer-normalize": "^2.49.0",
+ "ergebnis/license": "^2.7.0",
+ "ergebnis/php-cs-fixer-config": "^6.59.0",
"ergebnis/phpunit-slow-test-detector": "^2.20.0",
"fakerphp/faker": "^1.24.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
- "phpstan/phpstan-phpunit": "^2.0.7",
- "phpstan/phpstan-strict-rules": "^2.0.6",
+ "phpstan/phpstan-phpunit": "^2.0.12",
+ "phpstan/phpstan-strict-rules": "^2.0.8",
"phpunit/phpunit": "^9.6.21",
"psr/container": "^2.0.2",
"symfony/finder": "^5.4.45",
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/rules.neon b/tools/.phpstan/vendor/ergebnis/phpstan-rules/rules.neon
index 0458e5a..e1287c5 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/rules.neon
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/rules.neon
@@ -25,6 +25,8 @@ conditionalTags:
phpstan.rules.rule: %ergebnis.noIsset.enabled%
Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule:
phpstan.rules.rule: %ergebnis.declareStrictTypes.enabled%
+ Ergebnis\PHPStan\Rules\Files\NoPhpstanIgnoreRule:
+ phpstan.rules.rule: %ergebnis.noPhpstanIgnore.enabled%
Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule:
phpstan.rules.rule: %ergebnis.noNullableReturnTypeDeclaration.enabled%
Ergebnis\PHPStan\Rules\Functions\NoParameterPassedByReferenceRule:
@@ -102,6 +104,8 @@ parameters:
enabled: %ergebnis.allRules%
noParameterWithNullDefaultValue:
enabled: %ergebnis.allRules%
+ noPhpstanIgnore:
+ enabled: %ergebnis.allRules%
noReturnByReference:
enabled: %ergebnis.allRules%
noSwitch:
@@ -176,6 +180,9 @@ parametersSchema:
noParameterWithNullDefaultValue: structure([
enabled: bool(),
])
+ noPhpstanIgnore: structure([
+ enabled: bool(),
+ ])
noReturnByReference: structure([
enabled: bool(),
])
@@ -238,6 +245,9 @@ services:
-
class: Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
+ -
+ class: Ergebnis\PHPStan\Rules\Files\NoPhpstanIgnoreRule
+
-
class: Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Analyzer.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Analyzer.php
index 938cab7..996aea2 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Analyzer.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Analyzer.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/CallLikes/NoNamedArgumentRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/CallLikes/NoNamedArgumentRule.php
index a87bbaf..d76397e 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/CallLikes/NoNamedArgumentRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/CallLikes/NoNamedArgumentRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ClassName.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ClassName.php
index e62b908..1aa116f 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ClassName.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ClassName.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/FinalRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/FinalRule.php
index 05a9f3c..7deed48 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/FinalRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/FinalRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/NoExtendsRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/NoExtendsRule.php
index 4d4864e..7674298 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/NoExtendsRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/NoExtendsRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php
index 4b6d479..7c1ee57 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoNullableReturnTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoNullableReturnTypeDeclarationRule.php
index 6435157..cca6f29 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoNullableReturnTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoNullableReturnTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterPassedByReferenceRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterPassedByReferenceRule.php
index 2c47cb7..7a5027e 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterPassedByReferenceRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterPassedByReferenceRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullDefaultValueRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullDefaultValueRule.php
index 94bd146..0982f9e 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullDefaultValueRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullDefaultValueRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullableTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullableTypeDeclarationRule.php
index 3cff6ee..b314519 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullableTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Closures/NoParameterWithNullableTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ErrorIdentifier.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ErrorIdentifier.php
index 3435c19..8f9d6f6 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ErrorIdentifier.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/ErrorIdentifier.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
@@ -110,6 +110,11 @@ final class ErrorIdentifier
return new self('noNullableReturnTypeDeclaration');
}
+ public static function noPhpstanIgnore(): self
+ {
+ return new self('noPhpstanIgnore');
+ }
+
public static function noReturnByReference(): self
{
return new self('noReturnByReference');
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoAssignByReferenceRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoAssignByReferenceRule.php
index ad8cc1e..9f1f09c 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoAssignByReferenceRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoAssignByReferenceRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoCompactRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoCompactRule.php
index cd12ffe..0374f3a 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoCompactRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoCompactRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoErrorSuppressionRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoErrorSuppressionRule.php
index 49c0939..3640166 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoErrorSuppressionRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoErrorSuppressionRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoEvalRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoEvalRule.php
index b542057..3cc858a 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoEvalRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoEvalRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoIssetRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoIssetRule.php
index f1443d6..3b78517 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoIssetRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Expressions/NoIssetRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/DeclareStrictTypesRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/DeclareStrictTypesRule.php
index 5f9ec11..e62a854 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/DeclareStrictTypesRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/DeclareStrictTypesRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/NoPhpstanIgnoreRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/NoPhpstanIgnoreRule.php
new file mode 100644
index 0000000..28ba7e7
--- /dev/null
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Files/NoPhpstanIgnoreRule.php
@@ -0,0 +1,70 @@
+
+ */
+final class NoPhpstanIgnoreRule implements Rules\Rule
+{
+ public function getNodeType(): string
+ {
+ return FileNode::class;
+ }
+
+ public function processNode(
+ Node $node,
+ Analyser\Scope $scope
+ ): array {
+ $nodeFinder = new NodeFinder();
+
+ $foundNodes = $nodeFinder->find($node->getNodes(), static function (Node $node): bool {
+ return true;
+ });
+
+ $errors = [];
+
+ foreach ($foundNodes as $foundNode) {
+ foreach ($foundNode->getComments() as $comment) {
+ foreach (\explode("\n", $comment->getText()) as $index => $line) {
+ if (0 === \preg_match('/@phpstan-ignore(-line|-next-line)?(?=\s|$|,)/', $line, $matches)) {
+ continue;
+ }
+
+ $tag = $matches[0];
+
+ $message = \sprintf(
+ 'Errors reported by phpstan/phpstan should not be ignored via "%s", fix the error or use the baseline instead.',
+ $tag,
+ );
+
+ $errors[] = Rules\RuleErrorBuilder::message($message)
+ ->identifier(ErrorIdentifier::noPhpstanIgnore()->toString())
+ ->line($comment->getStartLine() + $index)
+ ->nonIgnorable()
+ ->build();
+ }
+ }
+ }
+
+ return $errors;
+ }
+}
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoNullableReturnTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoNullableReturnTypeDeclarationRule.php
index 06da4f7..32c4f2e 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoNullableReturnTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoNullableReturnTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterPassedByReferenceRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterPassedByReferenceRule.php
index e461aa1..e36f07f 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterPassedByReferenceRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterPassedByReferenceRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullDefaultValueRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullDefaultValueRule.php
index fe82a4e..f22c006 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullDefaultValueRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullDefaultValueRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullableTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullableTypeDeclarationRule.php
index 9027553..92a8ae5 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullableTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoParameterWithNullableTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoReturnByReferenceRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoReturnByReferenceRule.php
index 0efb700..2c621e0 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoReturnByReferenceRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Functions/NoReturnByReferenceRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HasContent.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HasContent.php
index ced8177..c37afe8 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HasContent.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HasContent.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HookMethod.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HookMethod.php
index 2d14cad..b944e5e 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HookMethod.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/HookMethod.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Invocation.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Invocation.php
index 722ff5f..3afcc9f 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Invocation.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Invocation.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/MethodName.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/MethodName.php
index 47116ce..597a586 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/MethodName.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/MethodName.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/FinalInAbstractClassRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/FinalInAbstractClassRule.php
index 271870a..9c9e6fa 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/FinalInAbstractClassRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/FinalInAbstractClassRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/InvokeParentHookMethodRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/InvokeParentHookMethodRule.php
index 888aa92..041858d 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/InvokeParentHookMethodRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/InvokeParentHookMethodRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoConstructorParameterWithDefaultValueRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoConstructorParameterWithDefaultValueRule.php
index e8b7e34..9315474 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoConstructorParameterWithDefaultValueRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoConstructorParameterWithDefaultValueRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoNullableReturnTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoNullableReturnTypeDeclarationRule.php
index e0e84c9..facc9fc 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoNullableReturnTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoNullableReturnTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterPassedByReferenceRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterPassedByReferenceRule.php
index 4c90f69..e50a0ef 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterPassedByReferenceRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterPassedByReferenceRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithContainerTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithContainerTypeDeclarationRule.php
index f64a831..cfd88cf 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithContainerTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithContainerTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullDefaultValueRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullDefaultValueRule.php
index 9888974..5a100a1 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullDefaultValueRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullDefaultValueRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullableTypeDeclarationRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullableTypeDeclarationRule.php
index 632cd7b..73d714d 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullableTypeDeclarationRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoParameterWithNullableTypeDeclarationRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoReturnByReferenceRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoReturnByReferenceRule.php
index a1bf87f..11ecbcd 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoReturnByReferenceRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/NoReturnByReferenceRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/PrivateInFinalClassRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/PrivateInFinalClassRule.php
index 9aa2c3c..91fa562 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/PrivateInFinalClassRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/PrivateInFinalClassRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Statements/NoSwitchRule.php b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Statements/NoSwitchRule.php
index 127e5ee..38461f5 100644
--- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Statements/NoSwitchRule.php
+++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Statements/NoSwitchRule.php
@@ -3,7 +3,7 @@
declare(strict_types=1);
/**
- * Copyright (c) 2018-2025 Andreas Möller
+ * Copyright (c) 2018-2026 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
diff --git a/tools/.phpstan/vendor/nette/utils/.phpstorm.meta.php b/tools/.phpstan/vendor/nette/utils/.phpstorm.meta.php
index 25851af..64dc487 100644
--- a/tools/.phpstan/vendor/nette/utils/.phpstorm.meta.php
+++ b/tools/.phpstan/vendor/nette/utils/.phpstorm.meta.php
@@ -1,6 +1,4 @@
->
* @property-read bool $first
* @property-read bool $last
* @property-read bool $empty
* @property-read bool $odd
* @property-read bool $even
* @property-read int $counter
- * @property-read mixed $nextKey
- * @property-read mixed $nextValue
+ * @property-read TKey $nextKey
+ * @property-read TValue $nextValue
*/
class CachingIterator extends \CachingIterator implements \Countable
{
@@ -31,6 +32,7 @@ class CachingIterator extends \CachingIterator implements \Countable
private int $counter = 0;
+ /** @param iterable|\stdClass $iterable */
public function __construct(iterable|\stdClass $iterable)
{
$iterable = $iterable instanceof \stdClass
@@ -58,45 +60,30 @@ class CachingIterator extends \CachingIterator implements \Countable
}
- /**
- * Is the iterator empty?
- */
public function isEmpty(): bool
{
return $this->counter === 0;
}
- /**
- * Is the counter odd?
- */
public function isOdd(): bool
{
return $this->counter % 2 === 1;
}
- /**
- * Is the counter even?
- */
public function isEven(): bool
{
return $this->counter % 2 === 0;
}
- /**
- * Returns the counter.
- */
public function getCounter(): int
{
return $this->counter;
}
- /**
- * Returns the count of elements.
- */
public function count(): int
{
$inner = $this->getInnerIterator();
@@ -131,18 +118,14 @@ class CachingIterator extends \CachingIterator implements \Countable
}
- /**
- * Returns the next key.
- */
+ /** @return TKey */
public function getNextKey(): mixed
{
return $this->getInnerIterator()->key();
}
- /**
- * Returns the next element.
- */
+ /** @return TValue */
public function getNextValue(): mixed
{
return $this->getInnerIterator()->current();
diff --git a/tools/.phpstan/vendor/nette/utils/src/Iterators/Mapper.php b/tools/.phpstan/vendor/nette/utils/src/Iterators/Mapper.php
index 284da29..a9cfba0 100644
--- a/tools/.phpstan/vendor/nette/utils/src/Iterators/Mapper.php
+++ b/tools/.phpstan/vendor/nette/utils/src/Iterators/Mapper.php
@@ -1,12 +1,10 @@
-callback = $callback;
+ $this->callback = $callback(...);
}
diff --git a/tools/.phpstan/vendor/nette/utils/src/SmartObject.php b/tools/.phpstan/vendor/nette/utils/src/SmartObject.php
index 3b2203f..d9742c8 100644
--- a/tools/.phpstan/vendor/nette/utils/src/SmartObject.php
+++ b/tools/.phpstan/vendor/nette/utils/src/SmartObject.php
@@ -1,12 +1,10 @@
-
* @implements \ArrayAccess
@@ -39,7 +37,6 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator
/**
- * Returns an iterator over all items.
* @return \Iterator
*/
public function &getIterator(): \Iterator
@@ -50,9 +47,6 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator
}
- /**
- * Returns items count.
- */
public function count(): int
{
return count((array) $this);
diff --git a/tools/.phpstan/vendor/nette/utils/src/Utils/ArrayList.php b/tools/.phpstan/vendor/nette/utils/src/Utils/ArrayList.php
index 98a5082..628cc45 100644
--- a/tools/.phpstan/vendor/nette/utils/src/Utils/ArrayList.php
+++ b/tools/.phpstan/vendor/nette/utils/src/Utils/ArrayList.php
@@ -1,12 +1,10 @@
-
* @implements \ArrayAccess
*/
class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
{
+ /** @var list */
private array $list = [];
@@ -41,7 +40,6 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
/**
- * Returns an iterator over all items.
* @return \Iterator
*/
public function &getIterator(): \Iterator
@@ -52,9 +50,6 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
}
- /**
- * Returns items count.
- */
public function count(): int
{
return count($this->list);
@@ -63,7 +58,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
/**
* Replaces or appends an item.
- * @param int|null $index
+ * @param ?int $index
* @param T $value
* @throws Nette\OutOfRangeException
*/
diff --git a/tools/.phpstan/vendor/nette/utils/src/Utils/Arrays.php b/tools/.phpstan/vendor/nette/utils/src/Utils/Arrays.php
index 986118c..3769433 100644
--- a/tools/.phpstan/vendor/nette/utils/src/Utils/Arrays.php
+++ b/tools/.phpstan/vendor/nette/utils/src/Utils/Arrays.php
@@ -1,12 +1,10 @@
- $array1
* @param array $array2
- * @return array
+ * @return array>
*/
public static function mergeTree(array $array1, array $array2): array
{
@@ -96,6 +94,7 @@ class Arrays
/**
* Returns zero-indexed position of given array key. Returns null if key is not found.
+ * @param array $array
*/
public static function getKeyOffset(array $array, string|int $key): ?int
{
@@ -104,9 +103,10 @@ class Arrays
/**
+ * @param array $array
* @deprecated use getKeyOffset()
*/
- public static function searchKey(array $array, $key): ?int
+ public static function searchKey(array $array, string|int $key): ?int
{
return self::getKeyOffset($array, $key);
}
@@ -114,10 +114,11 @@ class Arrays
/**
* Tests an array for the presence of value.
+ * @param array $array
*/
public static function contains(array $array, mixed $value): bool
{
- return in_array($value, $array, true);
+ return in_array($value, $array, strict: true);
}
@@ -125,9 +126,11 @@ class Arrays
* Returns the first item (matching the specified predicate if given). If there is no such item, it returns result of invoking $else or null.
* @template K of int|string
* @template V
+ * @template E
* @param array $array
* @param ?callable(V, K, array): bool $predicate
- * @return ?V
+ * @param ?callable(): E $else
+ * @return ($else is null ? ?V : V|E)
*/
public static function first(array $array, ?callable $predicate = null, ?callable $else = null): mixed
{
@@ -142,9 +145,11 @@ class Arrays
* Returns the last item (matching the specified predicate if given). If there is no such item, it returns result of invoking $else or null.
* @template K of int|string
* @template V
+ * @template E
* @param array $array
* @param ?callable(V, K, array): bool $predicate
- * @return ?V
+ * @param ?callable(): E $else
+ * @return ($else is null ? ?V : V|E)
*/
public static function last(array $array, ?callable $predicate = null, ?callable $else = null): mixed
{
@@ -194,8 +199,10 @@ class Arrays
/**
- * Inserts the contents of the $inserted array into the $array immediately after the $key.
+ * Inserts the contents of the $inserted array into the $array immediately before the $key.
* If $key is null (or does not exist), it is inserted at the beginning.
+ * @param array $array
+ * @param array $inserted
*/
public static function insertBefore(array &$array, string|int|null $key, array $inserted): void
{
@@ -207,8 +214,10 @@ class Arrays
/**
- * Inserts the contents of the $inserted array into the $array before the $key.
+ * Inserts the contents of the $inserted array into the $array immediately after the $key.
* If $key is null (or does not exist), it is inserted at the end.
+ * @param array $array
+ * @param array $inserted
*/
public static function insertAfter(array &$array, string|int|null $key, array $inserted): void
{
@@ -224,6 +233,7 @@ class Arrays
/**
* Renames key in array.
+ * @param array $array
*/
public static function renameKey(array &$array, string|int $oldKey, string|int $newKey): bool
{
@@ -260,6 +270,8 @@ class Arrays
/**
* Transforms multidimensional array to flat array.
+ * @param array $array
+ * @return array
*/
public static function flatten(array $array, bool $preserveKeys = false): array
{
@@ -283,17 +295,19 @@ class Arrays
/**
- * Reformats table to associative tree. Path looks like 'field|field[]field->field=field'.
- * @param string|string[] $path
+ * Transforms a flat array of rows into an associative tree using a path expression like 'field|field[]field->field=field'.
+ * @param array $array
+ * @param string|list $path
+ * @return array|\stdClass
*/
- public static function associate(array $array, $path): array|\stdClass
+ public static function associate(array $array, string|array $path): array|\stdClass
{
$parts = is_array($path)
? $path
: preg_split('#(\[\]|->|=|\|)#', $path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
if (!$parts || $parts === ['->'] || $parts[0] === '=' || $parts[0] === '|') {
- throw new Nette\InvalidArgumentException("Invalid path '$path'.");
+ throw new Nette\InvalidArgumentException("Invalid path '" . (is_array($path) ? implode('', $path) : $path) . "'.");
}
$res = $parts[0] === '->' ? new \stdClass : [];
@@ -312,6 +326,8 @@ class Arrays
$x = $row[$parts[$i]];
$row = null;
}
+ break; // '=' is always the final operation
+
} elseif ($part === '->') {
if (isset($parts[++$i])) {
if ($x === null) {
@@ -337,7 +353,9 @@ class Arrays
/**
- * Normalizes array to associative array. Replace numeric keys with their values, the new value will be $filling.
+ * Converts array to associative: items with numeric keys are converted to keys, with $filling as their value.
+ * @param array $array
+ * @return array
*/
public static function normalize(array $array, mixed $filling = null): array
{
@@ -480,9 +498,10 @@ class Arrays
/**
* Invokes all callbacks and returns array of results.
- * @param callable[] $callbacks
+ * @param iterable $callbacks
+ * @return array
*/
- public static function invoke(iterable $callbacks, ...$args): array
+ public static function invoke(iterable $callbacks, mixed ...$args): array
{
$res = [];
foreach ($callbacks as $k => $cb) {
@@ -495,9 +514,10 @@ class Arrays
/**
* Invokes method on every object in an array and returns array of results.
- * @param object[] $objects
+ * @param iterable