summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2021-01-12 12:31:23 +0000
committerGreg Roach <greg@subaqua.co.uk>2021-01-12 13:01:03 +0000
commit96c9e653a2a8dd1bb540e35cfd8ff1b4e5861c26 (patch)
tree5fcb2e393a984f9bea1f8a70ec235416ed696747
parentd60df70422eb23703970bb06d7c86d522dc187dc (diff)
downloadwebtrees-96c9e653a2a8dd1bb540e35cfd8ff1b4e5861c26.tar.gz
webtrees-96c9e653a2a8dd1bb540e35cfd8ff1b4e5861c26.tar.bz2
webtrees-96c9e653a2a8dd1bb540e35cfd8ff1b4e5861c26.zip
Fix: do not cast Expressions to strings
-rw-r--r--app/Http/RequestHandlers/ManageMediaData.php4
-rw-r--r--phpstan-baseline.neon63
2 files changed, 16 insertions, 51 deletions
diff --git a/app/Http/RequestHandlers/ManageMediaData.php b/app/Http/RequestHandlers/ManageMediaData.php
index 7119fb0b3d..1c9f62a162 100644
--- a/app/Http/RequestHandlers/ManageMediaData.php
+++ b/app/Http/RequestHandlers/ManageMediaData.php
@@ -102,7 +102,7 @@ class ManageMediaData implements RequestHandlerInterface
$sort_columns = [
0 => 'multimedia_file_refn',
- 2 => (string) new Expression('descriptive_title || multimedia_file_refn'),
+ 2 => new Expression('descriptive_title || multimedia_file_refn'),
];
// Convert a row from the database into a row for datatables
@@ -180,7 +180,7 @@ class ManageMediaData implements RequestHandlerInterface
'media.*',
'multimedia_file_refn',
'descriptive_title',
- (string) new Expression("'' AS media_folder"),
+ new Expression("'' AS media_folder"),
]);
return $this->datatables_service->handleQuery($request, $query, $search_columns, $sort_columns, $callback);
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 0f74520e00..f276406ed8 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -225,11 +225,6 @@ parameters:
path: app/GedcomRecord.php
-
- message: "#^Parameter \\#2 \\$input1 of function array_map expects array, array\\|false given\\.$#"
- count: 1
- path: app/GedcomTag.php
-
- -
message: "#^Parameter \\#1 \\$num of function dechex expects int, float\\|int given\\.$#"
count: 1
path: app/GedcomTag.php
@@ -380,31 +375,6 @@ parameters:
path: app/Http/Controllers/Admin/LocationController.php
-
- message: "#^Cannot access offset 'fqpn' on array\\|false\\.$#"
- count: 1
- path: app/Http/Controllers/Admin/LocationController.php
-
- -
- message: "#^Cannot access offset 'pl_lati' on array\\|false\\.$#"
- count: 1
- path: app/Http/Controllers/Admin/LocationController.php
-
- -
- message: "#^Cannot access offset 'pl_long' on array\\|false\\.$#"
- count: 1
- path: app/Http/Controllers/Admin/LocationController.php
-
- -
- message: "#^Cannot access offset 'pl_zoom' on array\\|false\\.$#"
- count: 1
- path: app/Http/Controllers/Admin/LocationController.php
-
- -
- message: "#^Cannot access offset 'pl_icon' on array\\|false\\.$#"
- count: 1
- path: app/Http/Controllers/Admin/LocationController.php
-
- -
message: "#^Method Fisharebest\\\\Webtrees\\\\Http\\\\Controllers\\\\Admin\\\\UsersController\\:\\:themeOptions\\(\\) should return Illuminate\\\\Support\\\\Collection&iterable\\<string\\> but returns Illuminate\\\\Support\\\\Collection&iterable\\<Fisharebest\\\\Webtrees\\\\Module\\\\ModuleInterface\\>\\.$#"
count: 1
path: app/Http/Controllers/Admin/UsersController.php
@@ -580,6 +550,11 @@ parameters:
path: app/Http/RequestHandlers/IndividualPage.php
-
+ message: "#^Parameter \\#4 \\$sort_columns of method Fisharebest\\\\Webtrees\\\\Services\\\\DatatablesService\\:\\:handleQuery\\(\\) expects array\\<string\\>, array\\<int, Illuminate\\\\Database\\\\Query\\\\Expression\\|string\\> given\\.$#"
+ count: 2
+ path: app/Http/RequestHandlers/ManageMediaData.php
+
+ -
message: "#^Cannot access offset '0' on array\\|false\\.$#"
count: 1
path: app/Http/RequestHandlers/ManageMediaData.php
@@ -970,11 +945,6 @@ parameters:
path: app/Module/LifespansChartModule.php
-
- message: "#^Method Fisharebest\\\\Webtrees\\\\Module\\\\MediaListModule\\:\\:allFolders\\(\\) should return array\\<string\\> but returns array\\|false\\.$#"
- count: 1
- path: app/Module/MediaListModule.php
-
- -
message: "#^Method Fisharebest\\\\Webtrees\\\\Module\\\\ModuleBlockInterface\\:\\:getBlock\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
count: 1
path: app/Module/ModuleBlockInterface.php
@@ -982,22 +952,22 @@ parameters:
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#"
count: 1
- path: modules_v4/example-theme.disable/module.php
+ path: modules_v4/example.disable/module.php
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#"
count: 1
- path: modules_v4/example.disable/module.php
+ path: modules_v4/example-theme.disable/module.php
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#"
count: 1
- path: modules_v4/example-middleware.disable/module.php
+ path: modules_v4/example-report.disable/module.php
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#"
count: 1
- path: modules_v4/example-report.disable/module.php
+ path: modules_v4/example-middleware.disable/module.php
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#"
@@ -1040,7 +1010,7 @@ parameters:
path: app/Module/CloudsTheme.php
-
- message: "#^Cannot access offset mixed on array\\<int, string\\>\\|false\\.$#"
+ message: "#^Cannot access offset mixed on \\(array\\<int, string\\>&nonEmpty\\)\\|false\\.$#"
count: 1
path: app/Module/CloudsTheme.php
@@ -1065,7 +1035,7 @@ parameters:
path: app/Module/FabTheme.php
-
- message: "#^Cannot access offset mixed on array\\<int, string\\>\\|false\\.$#"
+ message: "#^Cannot access offset mixed on \\(array\\<int, string\\>&nonEmpty\\)\\|false\\.$#"
count: 1
path: app/Module/FabTheme.php
@@ -1090,7 +1060,7 @@ parameters:
path: app/Module/MinimalTheme.php
-
- message: "#^Cannot access offset mixed on array\\<int, string\\>\\|false\\.$#"
+ message: "#^Cannot access offset mixed on \\(array\\<int, string\\>&nonEmpty\\)\\|false\\.$#"
count: 1
path: app/Module/MinimalTheme.php
@@ -1115,7 +1085,7 @@ parameters:
path: app/Module/WebtreesTheme.php
-
- message: "#^Cannot access offset mixed on array\\<int, string\\>\\|false\\.$#"
+ message: "#^Cannot access offset mixed on \\(array\\<int, string\\>&nonEmpty\\)\\|false\\.$#"
count: 1
path: app/Module/WebtreesTheme.php
@@ -1140,7 +1110,7 @@ parameters:
path: app/Module/XeneaTheme.php
-
- message: "#^Cannot access offset mixed on array\\<int, string\\>\\|false\\.$#"
+ message: "#^Cannot access offset mixed on \\(array\\<int, string\\>&nonEmpty\\)\\|false\\.$#"
count: 1
path: app/Module/XeneaTheme.php
@@ -1760,11 +1730,6 @@ parameters:
path: app/Services/MediaFileService.php
-
- message: "#^Method Fisharebest\\\\Webtrees\\\\Services\\\\MediaFileService\\:\\:unusedFiles\\(\\) should return array\\<string\\> but returns array\\|false\\.$#"
- count: 1
- path: app/Services/MediaFileService.php
-
- -
message: "#^Parameter \\#1 \\$path of function pathinfo expects string, string\\|null given\\.$#"
count: 1
path: app/Services/MediaFileService.php