summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2026-01-13 12:43:23 +0000
committerGreg Roach <greg@subaqua.co.uk>2026-01-13 12:43:23 +0000
commitc90dad7e7a7be34733462ffae2da48dc254a036c (patch)
treed84e4c80e6c6fdea076d59ebe1552345a8fe2132
parent4ac9f75c15214a226b21ec90625c1f3641400d93 (diff)
downloadwebtrees-c90dad7e7a7be34733462ffae2da48dc254a036c.tar.gz
webtrees-c90dad7e7a7be34733462ffae2da48dc254a036c.tar.bz2
webtrees-c90dad7e7a7be34733462ffae2da48dc254a036c.zip
Remove PHPSTAN strict checks. 2.1 is moving out of support, and these issues won't be fixed
-rw-r--r--app/StatisticsData.php2
-rw-r--r--composer.json9
-rw-r--r--composer.lock198
-rw-r--r--phpstan-baseline.neon8
-rw-r--r--tests/TestCase.php2
-rw-r--r--tests/app/Http/RequestHandlers/AccountUpdateTest.php10
-rw-r--r--tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php2
-rw-r--r--tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php2
-rw-r--r--tests/app/Services/TimeoutServiceTest.php4
-rw-r--r--tests/app/Services/UserServiceTest.php2
-rw-r--r--tests/feature/ImportGedcomTest.php2
11 files changed, 16 insertions, 225 deletions
diff --git a/app/StatisticsData.php b/app/StatisticsData.php
index d2e345b801..2b91d9e49d 100644
--- a/app/StatisticsData.php
+++ b/app/StatisticsData.php
@@ -552,7 +552,7 @@ class StatisticsData
->where('d_file', '=', $this->tree->id())
->whereIn('d_fact', $events)
->distinct()
- ->count(['i_id']);
+ ->count('i_id');
}
public function countIndividualsWithSources(): int
diff --git a/composer.json b/composer.json
index 990a1c8d2b..a41ff85a20 100644
--- a/composer.json
+++ b/composer.json
@@ -27,10 +27,7 @@
"php": "7.4"
},
"sort-packages": true,
- "process-timeout": 3600,
- "allow-plugins": {
- "phpstan/extension-installer": true
- }
+ "process-timeout": 3600
},
"require": {
"php": "7.4 - 8.6",
@@ -90,11 +87,7 @@
"composer/composer": "2.9.3",
"league/flysystem-memory": "2.0.6",
"php-coveralls/php-coveralls": "2.9.1",
- "phpstan/extension-installer": "1.4.3",
"phpstan/phpstan": "2.1.33",
- "phpstan/phpstan-deprecation-rules": "2.0.3",
- "phpstan/phpstan-phpunit": "2.0.11",
- "phpstan/phpstan-strict-rules": "2.0.7",
"phpunit/phpunit": "9.6.31",
"squizlabs/php_codesniffer": "4.0.1"
},
diff --git a/composer.lock b/composer.lock
index 3fb43860f3..eccb93284f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "a7f5ed611c4ddc4b8b6d1ca5c10335ce",
+ "content-hash": "b94e1dafdc25b28714510308062fb819",
"packages": [
{
"name": "aura/router",
@@ -7076,54 +7076,6 @@
"time": "2025-12-18T13:08:37+00:00"
},
{
- "name": "phpstan/extension-installer",
- "version": "1.4.3",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/extension-installer.git",
- "reference": "85e90b3942d06b2326fba0403ec24fe912372936"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936",
- "reference": "85e90b3942d06b2326fba0403ec24fe912372936",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^2.0",
- "php": "^7.2 || ^8.0",
- "phpstan/phpstan": "^1.9.0 || ^2.0"
- },
- "require-dev": {
- "composer/composer": "^2.0",
- "php-parallel-lint/php-parallel-lint": "^1.2.0",
- "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "PHPStan\\ExtensionInstaller\\Plugin"
- },
- "autoload": {
- "psr-4": {
- "PHPStan\\ExtensionInstaller\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Composer plugin for automatic installation of PHPStan extensions",
- "keywords": [
- "dev",
- "static analysis"
- ],
- "support": {
- "issues": "https://github.com/phpstan/extension-installer/issues",
- "source": "https://github.com/phpstan/extension-installer/tree/1.4.3"
- },
- "time": "2024-09-04T20:21:43+00:00"
- },
- {
"name": "phpstan/phpstan",
"version": "2.1.33",
"dist": {
@@ -7177,154 +7129,6 @@
"time": "2025-12-05T10:24:31+00:00"
},
{
- "name": "phpstan/phpstan-deprecation-rules",
- "version": "2.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
- "reference": "468e02c9176891cc901143da118f09dc9505fc2f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f",
- "reference": "468e02c9176891cc901143da118f09dc9505fc2f",
- "shasum": ""
- },
- "require": {
- "php": "^7.4 || ^8.0",
- "phpstan/phpstan": "^2.1.15"
- },
- "require-dev": {
- "php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/phpstan-phpunit": "^2.0",
- "phpunit/phpunit": "^9.6"
- },
- "type": "phpstan-extension",
- "extra": {
- "phpstan": {
- "includes": [
- "rules.neon"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "PHPStan\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
- "support": {
- "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues",
- "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3"
- },
- "time": "2025-05-14T10:56:57+00:00"
- },
- {
- "name": "phpstan/phpstan-phpunit",
- "version": "2.0.11",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan-phpunit.git",
- "reference": "5e30669bef866eff70db8b58d72a5c185aa82414"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/5e30669bef866eff70db8b58d72a5c185aa82414",
- "reference": "5e30669bef866eff70db8b58d72a5c185aa82414",
- "shasum": ""
- },
- "require": {
- "php": "^7.4 || ^8.0",
- "phpstan/phpstan": "^2.1.32"
- },
- "conflict": {
- "phpunit/phpunit": "<7.0"
- },
- "require-dev": {
- "nikic/php-parser": "^5",
- "php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/phpstan-deprecation-rules": "^2.0",
- "phpstan/phpstan-strict-rules": "^2.0",
- "phpunit/phpunit": "^9.6"
- },
- "type": "phpstan-extension",
- "extra": {
- "phpstan": {
- "includes": [
- "extension.neon",
- "rules.neon"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "PHPStan\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "PHPUnit extensions and rules for PHPStan",
- "support": {
- "issues": "https://github.com/phpstan/phpstan-phpunit/issues",
- "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.11"
- },
- "time": "2025-12-19T09:05:35+00:00"
- },
- {
- "name": "phpstan/phpstan-strict-rules",
- "version": "2.0.7",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan-strict-rules.git",
- "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d6211c46213d4181054b3d77b10a5c5cb0d59538",
- "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538",
- "shasum": ""
- },
- "require": {
- "php": "^7.4 || ^8.0",
- "phpstan/phpstan": "^2.1.29"
- },
- "require-dev": {
- "php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/phpstan-deprecation-rules": "^2.0",
- "phpstan/phpstan-phpunit": "^2.0",
- "phpunit/phpunit": "^9.6"
- },
- "type": "phpstan-extension",
- "extra": {
- "phpstan": {
- "includes": [
- "rules.neon"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "PHPStan\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Extra strict and opinionated rules for PHPStan",
- "support": {
- "issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
- "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.7"
- },
- "time": "2025-09-26T11:19:08+00:00"
- },
- {
"name": "phpunit/php-code-coverage",
"version": "9.2.32",
"source": {
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index cea40fe173..73bac3e28e 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1417,12 +1417,6 @@ parameters:
path: app/GedcomRecord.php
-
- rawMessage: 'Parameter #2 $gedcom of method Fisharebest\Webtrees\GedcomRecord::updateFact() expects string, string|null given.'
- identifier: argument.type
- count: 1
- path: app/GedcomRecord.php
-
- -
rawMessage: 'Parameter #2 $haystack of function array_search expects array, array<int<1, max>, string>|false given.'
identifier: argument.type
count: 2
@@ -1443,7 +1437,7 @@ parameters:
-
rawMessage: 'Parameter #3 $subject of function preg_replace expects array<float|int|string>|string, string|null given.'
identifier: argument.type
- count: 2
+ count: 1
path: app/GedcomRecord.php
-
diff --git a/tests/TestCase.php b/tests/TestCase.php
index 1374cde7ac..939f729bde 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -217,7 +217,7 @@ class TestCase extends \PHPUnit\Framework\TestCase
{
self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
- self::assertEquals('text/html; charset=UTF-8', $response->getHeaderLine('content-type'));
+ self::assertSame('text/html; charset=UTF-8', $response->getHeaderLine('content-type'));
$html = $response->getBody()->getContents();
diff --git a/tests/app/Http/RequestHandlers/AccountUpdateTest.php b/tests/app/Http/RequestHandlers/AccountUpdateTest.php
index 96181eb981..83a9997bdb 100644
--- a/tests/app/Http/RequestHandlers/AccountUpdateTest.php
+++ b/tests/app/Http/RequestHandlers/AccountUpdateTest.php
@@ -36,11 +36,11 @@ class AccountUpdateTest extends TestCase
$user_service = $this->createMock(UserService::class);
$user = $this->createMock(User::class);
- $user->expects($this->once())->method('setEmail')->with('b');
- $user->expects($this->once())->method('setPassword')->with('e');
- $user->expects($this->once())->method('setRealName')->with('d');
- $user->expects($this->once())->method('setUserName')->with('h');
- $user->expects($this->exactly(4))
+ $user->expects(self::once())->method('setEmail')->with('b');
+ $user->expects(self::once())->method('setPassword')->with('e');
+ $user->expects(self::once())->method('setRealName')->with('d');
+ $user->expects(self::once())->method('setUserName')->with('h');
+ $user->expects(self::exactly(4))
->method('setPreference')
->with(
self::withConsecutive([UserInterface::PREF_CONTACT_METHOD, UserInterface::PREF_LANGUAGE, UserInterface::PREF_TIME_ZONE, UserInterface::PREF_IS_VISIBLE_ONLINE]),
diff --git a/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php b/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php
index 35526c8d2e..e493d0070a 100644
--- a/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php
+++ b/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php
@@ -72,7 +72,7 @@ class RedirectAncestryPhpTest extends TestCase
$module_service = $this->createMock(ModuleService::class);
$module_service
- ->expects($this->once())
+ ->expects(self::once())
->method('findByComponent')
->with(ModuleChartInterface::class)
->willReturn(new Collection([$module]));
diff --git a/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php b/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php
index 2b3e0627d9..74451a066c 100644
--- a/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php
+++ b/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php
@@ -102,7 +102,7 @@ class RedirectFanChartPhpTest extends TestCase
$module_service = $this->createMock(ModuleService::class);
$module_service
- ->expects($this->once())->method('findByComponent')
+ ->expects(self::once())->method('findByComponent')
->with(ModuleChartInterface::class)
->willReturn(new Collection());
diff --git a/tests/app/Services/TimeoutServiceTest.php b/tests/app/Services/TimeoutServiceTest.php
index 4948c9c001..1a3d239e2b 100644
--- a/tests/app/Services/TimeoutServiceTest.php
+++ b/tests/app/Services/TimeoutServiceTest.php
@@ -54,9 +54,9 @@ class TimeoutServiceTest extends TestCase
protected function tearDown(): void
{
- parent::setUp();
-
self::$mock_functions = null;
+
+ parent::tearDown();
}
public function testNoTimeOut(): void
diff --git a/tests/app/Services/UserServiceTest.php b/tests/app/Services/UserServiceTest.php
index 55156aabee..7aef56d49c 100644
--- a/tests/app/Services/UserServiceTest.php
+++ b/tests/app/Services/UserServiceTest.php
@@ -133,7 +133,7 @@ class UserServiceTest extends TestCase
$users = $user_service->all();
- self::assertSame(2, $users->count());
+ self::assertCount(2, $users);
self::assertSame($user2->id(), $users[0]->id());
self::assertSame($user1->id(), $users[1]->id());
}
diff --git a/tests/feature/ImportGedcomTest.php b/tests/feature/ImportGedcomTest.php
index bb046616ea..63c9890915 100644
--- a/tests/feature/ImportGedcomTest.php
+++ b/tests/feature/ImportGedcomTest.php
@@ -22,7 +22,7 @@ namespace Fisharebest\Webtrees;
use Fisharebest\Webtrees\Services\GedcomImportService;
/**
- * @covers \Fisharebest\Webtrees\Services\GedcomImportService;
+ * @covers \Fisharebest\Webtrees\Services\GedcomImportService
*/
class ImportGedcomTest extends TestCase
{