Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 2d23166

Browse files
authored
Merge pull request #5 from PrisisForks/feature/remove-not-needed-code
fix : removing mistake with old php bug fix
2 parents 4259c4d + e273ac6 commit 2d23166

File tree

4 files changed

+3
-44
lines changed

4 files changed

+3
-44
lines changed

.build/phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ parameters:
1515
count: 1
1616
path: ../src/FrameCollection.php
1717

18-
-
19-
message: "#^Parameter \\#1 \\$frame of method Narrowspark\\\\ExceptionInspector\\\\Inspector\\:\\:isValidNextFrame\\(\\) expects array\\('file' \\=\\> string\\|null, 'line' \\=\\> int\\|null, 'class' \\=\\> string, 'args' \\=\\> array, 'function' \\=\\> string\\|null\\), array\\<string, mixed\\> given\\.$#"
20-
count: 1
21-
path: ../src/Inspector.php
22-
2318
-
2419
message: "#^Parameter \\#1 \\$frames of class Narrowspark\\\\ExceptionInspector\\\\FrameCollection constructor expects array\\<int, array\\<string, array\\<string, mixed\\>\\|int\\|string\\|null\\>\\>, array\\<int, array\\<string, array\\<string\\>\\|int\\|string\\>\\> given\\.$#"
2520
count: 1

.github/workflows/mutation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424

2525
env:
2626
key: "mutation-v1" # change key (version) to clear cache
27-
min-covered-msi: 70
28-
min-msi: 60
27+
min-covered-msi: 75
28+
min-msi: 63
2929
extensions: "mbstring"
3030
ini-values: "date.timezone=Europe/Berlin, opcache.enable_cli=1, pcov.directory=api"
3131
tools: "composer, composer-prefetcher, cs2pr"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
],
6565
"cs": "composer --working-dir=./.build cs -- -v",
6666
"cs:check": "composer --working-dir=./.build cs:check -- -v",
67-
"infection": "composer --working-dir=./.build infection -- --min-covered-msi=70 --min-msi=60",
67+
"infection": "composer --working-dir=./.build infection -- --min-covered-msi=75 --min-msi=63",
6868
"phpstan": "composer --working-dir=./.build phpstan -- --memory-limit=-1",
6969
"phpstan:baseline": "composer --working-dir=./.build phpstan:baseline -- --memory-limit=-1",
7070
"psalm": "composer --working-dir=./.build psalm",

src/Inspector.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,6 @@ public function getFrames(): FrameCollection
7272
if ($this->frames === null) {
7373
$frames = $this->getTrace($this->exception);
7474

75-
// Fill empty line/file info for call_user_func_array usages (PHP Bug #44428)
76-
foreach ($frames as $k => $frame) {
77-
if ($frame['file'] !== '') {
78-
// Default values when file and line are missing
79-
$file = '[internal]';
80-
$line = 0;
81-
82-
$nextFrame = $frames[$k + 1] ?? [];
83-
84-
if ($this->isValidNextFrame($nextFrame)) {
85-
$file = $nextFrame['file'];
86-
$line = $nextFrame['line'];
87-
}
88-
89-
$frames[$k]['file'] = $file;
90-
$frames[$k]['line'] = $line;
91-
}
92-
}
93-
9475
// Find latest non-error handling frame index ($i) used to remove error handling frames
9576
$i = 0;
9677

@@ -316,23 +297,6 @@ private function getFrameFromException(Throwable $exception): array
316297
];
317298
}
318299

319-
/**
320-
* Determine if the frame can be used to fill in previous frame's missing info
321-
* happens for call_user_func and call_user_func_array usages (PHP Bug #44428).
322-
*
323-
* @psalm-param array{file: ?string, line: ?int, class: string, args: array<array-key, mixed>, function: ?string} $frame
324-
*
325-
* @param array<string, array|int|string> $frame
326-
*/
327-
private function isValidNextFrame(array $frame): bool
328-
{
329-
if (! isset($frame['file'], $frame['line'])) {
330-
return false;
331-
}
332-
333-
return isset($frame['function']) && stripos($frame['function'], 'call_user_func') !== false;
334-
}
335-
336300
/**
337301
* Determine if an error level is fatal (halts execution).
338302
*/

0 commit comments

Comments
 (0)