Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23acc24

Browse files
committed
[Debug] made order of suggestions predictable in error messages
1 parent7affb71 commit23acc24

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

‎src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function handleError(array $error, FatalErrorException $exception)
8080
}
8181

8282
if ($candidates) {
83+
sort($candidates);
8384
$message .=' Did you mean to call:'.implode(',',array_map(function ($val) {
8485
return'"'.$val.'"';
8586
},$candidates)).'?';

‎src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function handleError(array $error, FatalErrorException $exception)
4545
}
4646

4747
if ($candidates) {
48+
sort($candidates);
4849
$message .=sprintf(' Did you mean to call: "%s"?',implode('", "',$candidates));
4950
}
5051

‎src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function provideUndefinedMethodData()
5959
'file' =>'foo.php',
6060
'message' =>'Call to undefined method SplObjectStorage::offsetFet()',
6161
),
62-
'Attempted to call method "offsetFet" on class "SplObjectStorage" in foo.php line 12. Did you mean to call: "offsetSet", "offsetUnset", "offsetGet"?',
62+
'Attempted to call method "offsetFet" on class "SplObjectStorage" in foo.php line 12. Did you mean to call: "offsetGet", "offsetSet", "offsetUnset"?',
6363
),
6464
);
6565
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp