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

Appearance settings

Commit bea1537

Browse filesBrowse files
committed
minor #10186 Made some HHVM-related fixes (fabpot)
This PR was merged into the 2.5-dev branch. Discussion ---------- Made some HHVM-related fixes | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 1240758 [Routing] fixed CS e223395 [Debug] fixed case differences between PHP and HHVM (classes are case-insensitive anyway in PHP) 23acc24 [Debug] made order of suggestions predictable in error messages
2 parents 4c9e307 + 1240758 commit bea1537
Copy full SHA for bea1537

File tree

Expand file treeCollapse file tree

6 files changed

+12
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+12
-8
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
+1Lines 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)).'?';
Collapse file

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
+1Lines 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

Collapse file

‎src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ public function testFatalErrorHandlers($error, $class, $translatedMessage)
254254
$m->invoke($handler, $exceptionHandler, $error);
255255

256256
$this->assertInstanceof($class, $exceptionHandler->e);
257-
$this->assertSame($translatedMessage, $exceptionHandler->e->getMessage());
257+
// class names are case insensitive and PHP/HHVM do not return the same
258+
$this->assertSame(strtolower($translatedMessage), strtolower($exceptionHandler->e->getMessage()));
258259
$this->assertSame($error['type'], $exceptionHandler->e->getSeverity());
259260
$this->assertSame($error['file'], $exceptionHandler->e->getFile());
260261
$this->assertSame($error['line'], $exceptionHandler->e->getLine());
Collapse file

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function testUndefinedFunction($error, $translatedMessage)
2525
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
2626

2727
$this->assertInstanceof('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception);
28-
$this->assertSame($translatedMessage, $exception->getMessage());
28+
// class names are case insensitive and PHP/HHVM do not return the same
29+
$this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage()));
2930
$this->assertSame($error['type'], $exception->getSeverity());
3031
$this->assertSame($error['file'], $exception->getFile());
3132
$this->assertSame($error['line'], $exception->getLine());
Collapse file

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
+1-1Lines 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
}
Collapse file

‎src/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testDumpWithRoutes()
6060
$this->routeCollection->add('Test2', new Route('/testing2'));
6161

6262
file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump());
63-
include ($this->testTmpFilepath);
63+
include $this->testTmpFilepath;
6464

6565
$projectUrlGenerator = new \ProjectUrlGenerator(new RequestContext('/app.php'));
6666

@@ -81,7 +81,7 @@ public function testDumpWithRoutes()
8181
public function testDumpWithoutRoutes()
8282
{
8383
file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'WithoutRoutesUrlGenerator')));
84-
include ($this->testTmpFilepath);
84+
include $this->testTmpFilepath;
8585

8686
$projectUrlGenerator = new \WithoutRoutesUrlGenerator(new RequestContext('/app.php'));
8787

@@ -96,7 +96,7 @@ public function testGenerateNonExistingRoute()
9696
$this->routeCollection->add('Test', new Route('/test'));
9797

9898
file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'NonExistingRoutesUrlGenerator')));
99-
include ($this->testTmpFilepath);
99+
include $this->testTmpFilepath;
100100

101101
$projectUrlGenerator = new \NonExistingRoutesUrlGenerator(new RequestContext());
102102
$url = $projectUrlGenerator->generate('NonExisting', array());
@@ -107,7 +107,7 @@ public function testDumpForRouteWithDefaults()
107107
$this->routeCollection->add('Test', new Route('/testing/{foo}', array('foo' => 'bar')));
108108

109109
file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'DefaultRoutesUrlGenerator')));
110-
include ($this->testTmpFilepath);
110+
include $this->testTmpFilepath;
111111

112112
$projectUrlGenerator = new \DefaultRoutesUrlGenerator(new RequestContext());
113113
$url = $projectUrlGenerator->generate('Test', array());
@@ -121,7 +121,7 @@ public function testDumpWithSchemeRequirement()
121121
$this->routeCollection->add('Test2', new Route('/testing_bc', array(), array('_scheme' => 'https'))); // BC
122122

123123
file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'SchemeUrlGenerator')));
124-
include ($this->testTmpFilepath);
124+
include $this->testTmpFilepath;
125125

126126
$projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php'));
127127

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.