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 76dc317

Browse filesBrowse files
committed
Removed ContextErrorException
1 parent 1c1a86f commit 76dc317
Copy full SHA for 76dc317

File tree

5 files changed

+4
-81
lines changed
Filter options

5 files changed

+4
-81
lines changed

‎src/Symfony/Component/Debug/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* removed the symfony_debug extension
8+
* removed `ContextErrorException`
89

910
3.4.0
1011
-----

‎src/Symfony/Component/Debug/ErrorHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/ErrorHandler.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Psr\Log\LogLevel;
1515
use Psr\Log\LoggerInterface;
16-
use Symfony\Component\Debug\Exception\ContextErrorException;
1716
use Symfony\Component\Debug\Exception\FatalErrorException;
1817
use Symfony\Component\Debug\Exception\FatalThrowableError;
1918
use Symfony\Component\Debug\Exception\OutOfMemoryException;
@@ -415,11 +414,7 @@ public function handleError($type, $message, $file, $line)
415414
return;
416415
}
417416
} else {
418-
if ($scope) {
419-
$errorAsException = new ContextErrorException($logMessage, 0, $type, $file, $line, $context);
420-
} else {
421-
$errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line);
422-
}
417+
$errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line);
423418

424419
// Clean the trace by removing function arguments and the first frames added by the error handler itself.
425420
if ($throw || $this->tracedErrors & $type) {

‎src/Symfony/Component/Debug/Exception/ContextErrorException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Exception/ContextErrorException.php
-40Lines changed: 0 additions & 40 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php
-32Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,38 +59,6 @@ public function testIdempotence()
5959
$this->fail('DebugClassLoader did not register');
6060
}
6161

62-
public function testStacking()
63-
{
64-
// the ContextErrorException must not be loaded to test the workaround
65-
// for https://bugs.php.net/65322.
66-
if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) {
67-
$this->markTestSkipped('The ContextErrorException class is already loaded.');
68-
}
69-
70-
ErrorHandler::register();
71-
72-
try {
73-
// Trigger autoloading + E_STRICT at compile time
74-
// which in turn triggers $errorHandler->handle()
75-
// that again triggers autoloading for ContextErrorException.
76-
// Error stacking works around the bug above and everything is fine.
77-
78-
eval('
79-
namespace '.__NAMESPACE__.';
80-
class ChildTestingStacking extends TestingStacking { function foo($bar) {} }
81-
');
82-
$this->fail('ContextErrorException expected');
83-
} catch (\ErrorException $exception) {
84-
// if an exception is thrown, the test passed
85-
$this->assertStringStartsWith(__FILE__, $exception->getFile());
86-
$this->assertRegExp('/^Warning: Declaration/', $exception->getMessage());
87-
$this->assertEquals(E_WARNING, $exception->getSeverity());
88-
} finally {
89-
restore_error_handler();
90-
restore_exception_handler();
91-
}
92-
}
93-
9462
/**
9563
* @expectedException \RuntimeException
9664
*/

‎src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Session\Storage;
1313

14-
use Symfony\Component\Debug\Exception\ContextErrorException;
1514
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
1615
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
1716
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
@@ -213,13 +212,13 @@ public function save()
213212
{
214213
// Register custom error handler to catch a possible failure warning during session write
215214
set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) {
216-
throw new ContextErrorException($errstr, $errno, E_WARNING, $errfile, $errline, $errcontext);
215+
throw new \ErrorException($errstr, $errno, E_WARNING, $errfile, $errline, $errcontext);
217216
}, E_WARNING);
218217

219218
try {
220219
session_write_close();
221220
restore_error_handler();
222-
} catch (ContextErrorException $e) {
221+
} catch (\ErrorException $e) {
223222
// The default PHP error message is not very helpful, as it does not give any information on the current save handler.
224223
// Therefore, we catch this error and trigger a warning with a better error message
225224
$handler = $this->getSaveHandler();

0 commit comments

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