Skip to content

Commit

Permalink
Working on phpstan issues in test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Jan 6, 2025
1 parent ab70d7f commit 24cb754
Show file tree
Hide file tree
Showing 45 changed files with 362 additions and 558 deletions.
294 changes: 0 additions & 294 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10626,60 +10626,6 @@ parameters:
count: 1
path: resources/views/statistics/other/charts/custom.phtml

-
message: '#^Cannot call method createServerRequest\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/TestCase.php

-
message: '#^Cannot call method createStreamFromFile\(\) on mixed\.$#'
identifier: method.nonObject
count: 2
path: tests/TestCase.php

-
message: '#^Cannot call method createUploadedFile\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/TestCase.php

-
message: '#^Cannot call method withAttribute\(\) on mixed\.$#'
identifier: method.nonObject
count: 5
path: tests/TestCase.php

-
message: '#^Cannot call method withParsedBody\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/TestCase.php

-
message: '#^Cannot call method withQueryParams\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/TestCase.php

-
message: '#^Cannot call method withUploadedFiles\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/TestCase.php

-
message: '#^Method Fisharebest\\Webtrees\\TestCase\:\:createRequest\(\) should return Psr\\Http\\Message\\ServerRequestInterface but returns mixed\.$#'
identifier: return.type
count: 1
path: tests/TestCase.php

-
message: '#^Method Fisharebest\\Webtrees\\TestCase\:\:createUploadedFile\(\) should return Psr\\Http\\Message\\UploadedFileInterface but returns mixed\.$#'
identifier: return.type
count: 1
path: tests/TestCase.php

-
message: '#^Method Fisharebest\\Webtrees\\TestCase\:\:withConsecutive\(\) return type with generic class PHPUnit\\Framework\\Constraint\\Callback does not specify its types\: CallbackInput$#'
identifier: missingType.generics
Expand All @@ -10692,216 +10638,6 @@ parameters:
count: 1
path: tests/TestCase.php

-
message: '#^Parameter \#2 \$object of method Fisharebest\\Webtrees\\Contracts\\ContainerInterface\:\:set\(\) expects object, Fisharebest\\Webtrees\\Tree\|string given\.$#'
identifier: argument.type
count: 1
path: tests/TestCase.php

-
message: '#^Parameter \#2 \$object of method Fisharebest\\Webtrees\\Contracts\\ContainerInterface\:\:set\(\) expects object, mixed given\.$#'
identifier: argument.type
count: 1
path: tests/TestCase.php

-
message: '#^Parameter \#2 \$offset of function substr expects int, int\<0, max\>\|false given\.$#'
identifier: argument.type
count: 1
path: tests/TestCase.php

-
message: '#^Parameter \#2 \$stream of method Fisharebest\\Webtrees\\Services\\TreeService\:\:importGedcomFile\(\) expects Psr\\Http\\Message\\StreamInterface, mixed given\.$#'
identifier: argument.type
count: 1
path: tests/TestCase.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefFamilyTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefFamilyTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefIndividualTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefIndividualTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefLocationTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefLocationTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefMediaTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefMediaTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefNoteTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefNoteTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefRepositoryTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefRepositoryTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSharedNoteTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSharedNoteTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSourceTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSourceTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSubmissionTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSubmissionTest.php

-
message: '#^Cannot call method count\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSubmitterTest.php

-
message: '#^Cannot call method getElementsByTagName\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Elements/XrefSubmitterTest.php

-
message: '#^Cannot access offset 0 on list\<string\>\|false\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: tests/app/Encodings/AnselTest.php

-
message: '#^Cannot access offset 1 on list\<string\>\|false\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: tests/app/Encodings/AnselTest.php

-
message: '#^Parameter \#2 \$subject of function preg_split expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: tests/app/Encodings/AnselTest.php

-
message: '#^Cannot call method createUri\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: tests/app/Http/Middleware/CheckCsrfTest.php

-
message: '#^Parameter \#1 \$uri of method Psr\\Http\\Message\\RequestInterface\:\:withUri\(\) expects Psr\\Http\\Message\\UriInterface, mixed given\.$#'
identifier: argument.type
count: 1
path: tests/app/Http/Middleware/CheckCsrfTest.php

-
message: '#^Parameter \#3 \$params of static method Fisharebest\\Webtrees\\TestCase\:\:createRequest\(\) expects array\<string\>, array\<string, int\|string\> given\.$#'
identifier: argument.type
count: 1
path: tests/app/Http/RequestHandlers/FixLevel0MediaActionTest.php

-
message: '#^Parameter \#2 \$query of static method Fisharebest\\Webtrees\\TestCase\:\:createRequest\(\) expects array\<string\>, array\<string, int\> given\.$#'
identifier: argument.type
count: 1
path: tests/app/Http/RequestHandlers/FixLevel0MediaDataTest.php

-
message: '#^Parameter \#2 \$query of static method Fisharebest\\Webtrees\\TestCase\:\:createRequest\(\) expects array\<string\>, array\<string, array\<string, string\>\|string\> given\.$#'
identifier: argument.type
count: 3
path: tests/app/Http/RequestHandlers/ManageMediaDataTest.php

-
message: '#^Parameter \#2 \$query of static method Fisharebest\\Webtrees\\TestCase\:\:createRequest\(\) expects array\<string\>, array\<string, list\<string\>\|string\> given\.$#'
identifier: argument.type
count: 3
path: tests/app/Http/RequestHandlers/RedirectTimeLinePhpTest.php

-
message: '#^Parameter \#3 \$params of static method Fisharebest\\Webtrees\\TestCase\:\:createRequest\(\) expects array\<string\>, array\<string, int\|string\> given\.$#'
identifier: argument.type
count: 1
path: tests/app/Http/RequestHandlers/UserEditActionTest.php

-
message: '#^Cannot call method tag\(\) on Fisharebest\\Webtrees\\Fact\|null\.$#'
identifier: method.nonObject
count: 2
path: tests/app/Services/GedcomEditServiceTest.php

-
message: '#^Parameter \#1 \$interface of method Fisharebest\\Webtrees\\Services\\ModuleService\:\:findByInterface\(\) expects class\-string\<Fisharebest\\Webtrees\\Module\\ModuleInterface\|Psr\\Http\\Server\\MiddlewareInterface\>, string given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -10943,33 +10679,3 @@ parameters:
identifier: argument.type
count: 1
path: tests/app/Services/TimeoutServiceTest.php

-
message: '#^Cannot call method id\(\) on Fisharebest\\Webtrees\\User\|null\.$#'
identifier: method.nonObject
count: 5
path: tests/app/Services/UserServiceTest.php

-
message: '#^Parameter \#1 \$timestamp of class Fisharebest\\Webtrees\\Timestamp constructor expects int, int\|false given\.$#'
identifier: argument.type
count: 19
path: tests/app/TimestampTest.php

-
message: '#^Parameter \#3 \$subject of function preg_replace expects array\<float\|int\|string\>\|string, string\|false given\.$#'
identifier: argument.type
count: 2
path: tests/app/TreeTest.php

-
message: '#^Parameter \#3 \$subject of function preg_replace expects array\<float\|int\|string\>\|string, string\|null given\.$#'
identifier: argument.type
count: 4
path: tests/app/TreeTest.php

-
message: '#^Cannot call method deleteRecord\(\) on Fisharebest\\Webtrees\\Individual\|null\.$#'
identifier: method.nonObject
count: 1
path: tests/feature/IndividualListTest.php
Loading

0 comments on commit 24cb754

Please sign in to comment.