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

Commitb825c94

Browse files
[Debug] Remove deprecated ExceptionHandler::createResponse
1 parentdda085e commitb825c94

File tree

2 files changed

+17
-49
lines changed

2 files changed

+17
-49
lines changed

‎UPGRADE-3.0.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,3 +1259,18 @@ UPGRADE FROM 2.x to 3.0
12591259
### HttpFoundation
12601260

12611261
* `Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface` no longer implements the `IteratorAggregate` interface. Use the `all()` method instead of iterating over the flash bag.
1262+
1263+
### Debug
1264+
1265+
* `DebugClassLoader::__construct()` now accepts only a `callable` argument.
1266+
* `DebugClassLoader::getClassLoader()` now always returns `callable`.
1267+
* `DebugClassLoader::findFile()` has been removed.
1268+
* `ErrorHandler::TYPE_DEPRECATION` has been removed.
1269+
* `ErrorHandler::setLevel()` has been removed, use throwAt() instead.
1270+
* `ErrorHandler::setDisplayErrors()` has been removed, use throwAt() instead.
1271+
* `ErrorHandler::setLogger()` has been removed, use setLoggers() or setDefaultLogger() instead.
1272+
* `ErrorHandler::handle()` has been removed, use handleError() instead.
1273+
* `ErrorHandler::handleFatal()` has been removed, use handleFatalError() instead.
1274+
* `ExceptionHandler::createException()` has been removed.
1275+
* `ExceptionHandler::utf8Htmlize()` has been removed.
1276+
* `Exception/DummyException` has been removed.

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

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function setFileLinkFormat($format)
115115
publicfunctionhandle(\Exception$exception)
116116
{
117117
if (null ===$this->handler ||$exceptioninstanceof OutOfMemoryException) {
118-
$this->failSafeHandle($exception);
118+
$this->sendPhpResponse($exception);
119119

120120
return;
121121
}
@@ -129,7 +129,7 @@ public function handle(\Exception $exception)
129129
});
130130

131131

132-
$this->failSafeHandle($exception);
132+
$this->sendPhpResponse($exception);
133133
while (null ===$this->caughtBuffer &&ob_end_flush()) {
134134
// Empty loop, everything is in the condition
135135
}
@@ -162,33 +162,6 @@ public function handle(\Exception $exception)
162162
}
163163
}
164164

165-
/**
166-
* Sends a response for the given Exception.
167-
*
168-
* If you have the Symfony HttpFoundation component installed,
169-
* this method will use it to create and send the response. If not,
170-
* it will fallback to plain PHP functions.
171-
*
172-
* @param \Exception $exception An \Exception instance
173-
*/
174-
privatefunctionfailSafeHandle(\Exception$exception)
175-
{
176-
if (class_exists('Symfony\Component\HttpFoundation\Response',false)
177-
&&__CLASS__ !==get_class($this)
178-
&& ($reflector =new \ReflectionMethod($this,'createResponse'))
179-
&&__CLASS__ !==$reflector->class
180-
) {
181-
$response =$this->createResponse($exception);
182-
$response->sendHeaders();
183-
$response->sendContent();
184-
@trigger_error(sprintf("The %s::createResponse method is deprecated since 2.8 and won't be called anymore when handling an exception in 3.0.",$reflector->class),E_USER_DEPRECATED);
185-
186-
return;
187-
}
188-
189-
$this->sendPhpResponse($exception);
190-
}
191-
192165
/**
193166
* Sends the error associated with the given Exception as a plain PHP response.
194167
*
@@ -214,26 +187,6 @@ public function sendPhpResponse($exception)
214187
echo$this->decorate($this->getContent($exception),$this->getStylesheet($exception));
215188
}
216189

217-
/**
218-
* Creates the error Response associated with the given Exception.
219-
*
220-
* @param \Exception|FlattenException $exception An \Exception instance
221-
*
222-
* @return Response A Response instance
223-
*
224-
* @deprecated since 2.8, to be removed in 3.0.
225-
*/
226-
publicfunctioncreateResponse($exception)
227-
{
228-
@trigger_error('The'.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.',E_USER_DEPRECATED);
229-
230-
if (!$exceptioninstanceof FlattenException) {
231-
$exception = FlattenException::create($exception);
232-
}
233-
234-
return Response::create($this->decorate($this->getContent($exception),$this->getStylesheet($exception)),$exception->getStatusCode(),$exception->getHeaders())->setCharset($this->charset);
235-
}
236-
237190
/**
238191
* Gets the HTML content associated with the given exception.
239192
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp