Skip to content

Commit

Permalink
phpstan now supports PHP8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Aug 27, 2024
1 parent 039a373 commit f077613
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-version: ['8.2', '8.3' ]
php-version: ['8.2', '8.3', '8.4']
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion app/Services/GedcomImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ private function createMediaObject(string $gedcom, Tree $tree): string
}

preg_match_all('/\n\d NOTE (.+(?:\n\d CONT.*)*)/', $gedcom, $matches);
$notes = $matches[1] ?? [];
$notes = $matches[1];

// Have we already created a media object with the same title/filename?
$xref = DB::table('media_file')
Expand Down
24 changes: 24 additions & 0 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,12 @@
'count' => 1,
'path' => __DIR__ . '/app/Http/RequestHandlers/PendingChangesRejectChange.php',
];
$ignoreErrors[] = [
// identifier: offsetAccess.notFound
'message' => '#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: string\\}\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Http/RequestHandlers/PhpInformation.php',
];
$ignoreErrors[] = [
// identifier: argument.type
'message' => '#^Parameter \\#2 \\$subject of function preg_match expects string, string\\|false given\\.$#',
Expand Down Expand Up @@ -4173,6 +4179,12 @@
'count' => 1,
'path' => __DIR__ . '/app/Report/ReportParserGenerate.php',
];
$ignoreErrors[] = [
// identifier: offsetAccess.notFound
'message' => '#^Offset int\\<0, max\\> does not exist on array\\{\\}\\.$#',
'count' => 2,
'path' => __DIR__ . '/app/Report/ReportParserGenerate.php',
];
$ignoreErrors[] = [
// identifier: argument.type
'message' => '#^Parameter \\#1 \\$array of function end expects array\\|object, array\\<int, string\\>\\|false given\\.$#',
Expand Down Expand Up @@ -4341,6 +4353,12 @@
'count' => 1,
'path' => __DIR__ . '/app/Report/ReportParserSetup.php',
];
$ignoreErrors[] = [
// identifier: offsetAccess.notFound
'message' => '#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-falsy\\-string\\}\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Report/ReportParserSetup.php',
];
$ignoreErrors[] = [
// identifier: offsetAssign.valueType
'message' => '#^array\\<string\\>\\|string does not accept array\\<string\\>\\.$#',
Expand Down Expand Up @@ -5169,6 +5187,12 @@
'count' => 1,
'path' => __DIR__ . '/app/Services/PendingChangesService.php',
];
$ignoreErrors[] = [
// identifier: offsetAccess.notFound
'message' => '#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-falsy\\-string\\}\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Services/PendingChangesService.php',
];
$ignoreErrors[] = [
// identifier: method.notFound
'message' => '#^Call to an undefined method Fisharebest\\\\Webtrees\\\\Family\\|Fisharebest\\\\Webtrees\\\\Individual\\:\\:childFamilies\\(\\)\\.$#',
Expand Down

0 comments on commit f077613

Please sign in to comment.