Commit c388f669 authored by catch's avatar catch
Browse files

Issue #3094007 by jibran, mikelutz, alexpott, Berdir: Update the 9.0.x branch to Symfony 4.4-beta2

parent 9e1768c0
This diff is collapsed.
......@@ -33,32 +33,32 @@
"ralouphie/getallheaders": "3.0.3",
"stack/builder": "v1.0.5",
"symfony-cmf/routing": "2.1.0",
"symfony/class-loader": "v3.4.32",
"symfony/console": "4.4.x-dev",
"symfony/debug": "4.4.x-dev",
"symfony/dependency-injection": "4.4.x-dev",
"symfony/error-handler": "dev-master",
"symfony/error-renderer": "4.4.x-dev",
"symfony/event-dispatcher": "4.4.x-dev",
"symfony/class-loader": "v3.4.35",
"symfony/console": "v4.4.0-BETA2",
"symfony/debug": "v4.4.0-BETA2",
"symfony/dependency-injection": "v4.4.0-BETA2",
"symfony/error-handler": "v4.4.0-BETA2",
"symfony/event-dispatcher": "v4.4.0-BETA2",
"symfony/event-dispatcher-contracts": "v1.1.7",
"symfony/http-foundation": "4.4.x-dev",
"symfony/http-kernel": "4.4.x-dev",
"symfony/mime": "v4.3.5",
"symfony/http-foundation": "v4.4.0-BETA2",
"symfony/http-kernel": "v4.4.0-BETA2",
"symfony/mime": "v4.3.8",
"symfony/polyfill-ctype": "v1.12.0",
"symfony/polyfill-iconv": "v1.12.0",
"symfony/polyfill-intl-idn": "v1.12.0",
"symfony/polyfill-mbstring": "v1.12.0",
"symfony/polyfill-php72": "v1.12.0",
"symfony/polyfill-php73": "v1.12.0",
"symfony/process": "4.4.x-dev",
"symfony/process": "v4.4.0-BETA2",
"symfony/psr-http-message-bridge": "v1.2.0",
"symfony/routing": "4.4.x-dev",
"symfony/serializer": "4.4.x-dev",
"symfony/service-contracts": "v1.1.7",
"symfony/translation": "4.4.x-dev",
"symfony/translation-contracts": "v1.1.7",
"symfony/validator": "4.4.x-dev",
"symfony/yaml": "4.4.x-dev",
"symfony/routing": "v4.4.0-BETA2",
"symfony/serializer": "v4.4.0-BETA2",
"symfony/service-contracts": "v2.0.0",
"symfony/translation": "v4.4.0-BETA2",
"symfony/translation-contracts": "v2.0.0",
"symfony/validator": "v4.4.0-BETA2",
"symfony/var-dumper": "v5.0.0-BETA2",
"symfony/yaml": "v4.4.0-BETA2",
"twig/twig": "v2.12.1",
"typo3/phar-stream-wrapper": "v3.1.3",
"zendframework/zend-diactoros": "1.8.7",
......
......@@ -52,13 +52,13 @@
"seld/jsonlint": "1.7.1",
"seld/phar-utils": "1.0.1",
"squizlabs/php_codesniffer": "3.5.0",
"symfony/browser-kit": "4.4.x-dev",
"symfony/css-selector": "4.4.x-dev",
"symfony/dom-crawler": "4.4.x-dev",
"symfony/filesystem": "4.4.x-dev",
"symfony/finder": "4.4.x-dev",
"symfony/lock": "4.4.x-dev",
"symfony/phpunit-bridge": "4.4.x-dev",
"symfony/browser-kit": "v4.4.0-BETA2",
"symfony/css-selector": "v4.4.0-BETA2",
"symfony/dom-crawler": "v4.4.0-BETA2",
"symfony/filesystem": "v4.4.0-BETA2",
"symfony/finder": "v4.4.0-BETA2",
"symfony/lock": "v4.4.0-BETA2",
"symfony/phpunit-bridge": "v4.4.0-BETA2",
"theseer/tokenizer": "1.1.3",
"webmozart/assert": "1.5.0"
}
......
......@@ -111,11 +111,11 @@ public function onKernelRequestFilterProvider(GetResponseEvent $event) {
public function onExceptionSendChallenge(GetResponseForExceptionEvent $event) {
if (isset($this->challengeProvider) && $event->isMasterRequest()) {
$request = $event->getRequest();
$exception = $event->getException();
$exception = $event->getThrowable();
if ($exception instanceof AccessDeniedHttpException && !$this->authenticationProvider->applies($request) && (!isset($this->filter) || $this->filter->appliesToRoutedRequest($request, FALSE))) {
$challenge_exception = $this->challengeProvider->challengeException($request, $exception);
if ($challenge_exception) {
$event->setException($challenge_exception);
$event->setThrowable($challenge_exception);
}
}
}
......@@ -129,9 +129,9 @@ public function onExceptionSendChallenge(GetResponseForExceptionEvent $event) {
public function onExceptionAccessDenied(GetResponseForExceptionEvent $event) {
if (isset($this->filter) && $event->isMasterRequest()) {
$request = $event->getRequest();
$exception = $event->getException();
$exception = $event->getThrowable();
if ($exception instanceof AccessDeniedHttpException && $this->authenticationProvider->applies($request) && !$this->filter->appliesToRoutedRequest($request, TRUE)) {
$event->setException(new AccessDeniedHttpException('The used authentication method is not allowed on this route.', $exception));
$event->setThrowable(new AccessDeniedHttpException('The used authentication method is not allowed on this route.', $exception));
}
}
}
......
......@@ -87,7 +87,7 @@ protected function getHandledFormats() {
* The event to process.
*/
public function on4xx(GetResponseForExceptionEvent $event) {
if (($exception = $event->getException()) && $exception instanceof HttpExceptionInterface) {
if (($exception = $event->getThrowable()) && $exception instanceof HttpExceptionInterface) {
$this->makeSubrequest($event, '/system/4xx', $exception->getStatusCode());
}
}
......@@ -134,7 +134,7 @@ public function on404(GetResponseForExceptionEvent $event) {
*/
protected function makeSubrequest(GetResponseForExceptionEvent $event, $url, $status_code) {
$request = $event->getRequest();
$exception = $event->getException();
$exception = $event->getThrowable();
try {
// Reuse the exact same request (so keep the same URL, keep the access
......
......@@ -17,7 +17,7 @@ class EnforcedFormResponseSubscriber implements EventSubscriberInterface {
* Replaces the response in case an EnforcedResponseException was thrown.
*/
public function onKernelException(GetResponseForExceptionEvent $event) {
if ($response = EnforcedResponse::createFromException($event->getException())) {
if ($response = EnforcedResponse::createFromException($event->getThrowable())) {
// Setting the response stops the event propagation.
$event->setResponse($response);
}
......
......@@ -39,7 +39,7 @@ public function __construct(Connection $connection) {
* The event to process.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
if ($this->shouldRedirectToInstaller($exception, $this->connection)) {
// Only redirect if this is an HTML response (i.e., a user trying to view
// the site in a web browser before installing it).
......
......@@ -36,15 +36,15 @@ protected static function getPriority() {
*/
public function on4xx(GetResponseForExceptionEvent $event) {
/** @var \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface $exception */
$exception = $event->getException();
$exception = $event->getThrowable();
// If the exception is cacheable, generate a cacheable response.
if ($exception instanceof CacheableDependencyInterface) {
$response = new CacheableJsonResponse(['message' => $event->getException()->getMessage()], $exception->getStatusCode(), $exception->getHeaders());
$response = new CacheableJsonResponse(['message' => $event->getThrowable()->getMessage()], $exception->getStatusCode(), $exception->getHeaders());
$response->addCacheableDependency($exception);
}
else {
$response = new JsonResponse(['message' => $event->getException()->getMessage()], $exception->getStatusCode(), $exception->getHeaders());
$response = new JsonResponse(['message' => $event->getThrowable()->getMessage()], $exception->getStatusCode(), $exception->getHeaders());
}
$event->setResponse($response);
......
......@@ -60,7 +60,7 @@ public function on404(GetResponseForExceptionEvent $event) {
* The event to process.
*/
public function onError(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
$error = Error::decodeException($exception);
$this->logger->get('php')->log($error['severity_level'], '%type: @message in %function (line %line of %file).', $error);
......@@ -77,7 +77,7 @@ public function onError(GetResponseForExceptionEvent $event) {
* The event to process.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
$method = 'onError';
......
......@@ -34,7 +34,7 @@ protected function getHandledFormats() {
* @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event
*/
public function on500(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
$error = Error::decodeException($exception);
$headers = [];
......
......@@ -77,7 +77,7 @@ protected function getErrorLevel() {
* The event to process.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
$error = Error::decodeException($exception);
// Display the message if the current error reporting level allows this type
......
......@@ -86,7 +86,7 @@ protected static function getPriority() {
* The event to process.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
// Make the exception available for example when rendering a block.
$request = $event->getRequest();
......
......@@ -80,7 +80,7 @@ public function onView(GetResponseForControllerResultEvent $event) {
* The event to process.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
$request = $event->getRequest();
// Render a nice error message in case we have a file upload which exceeds
......@@ -116,7 +116,7 @@ public function onException(GetResponseForExceptionEvent $event) {
}
catch (\Exception $e) {
// Otherwise, replace the existing exception with the new one.
$event->setException($e);
$event->setThrowable($e);
}
}
}
......
......@@ -75,9 +75,9 @@ protected function copyRawVariables(array $defaults) {
* @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
if ($exception instanceof ParamNotConvertedException) {
$event->setException(new NotFoundHttpException($exception->getMessage(), $exception));
$event->setThrowable(new NotFoundHttpException($exception->getMessage(), $exception));
}
}
......
......@@ -44,9 +44,9 @@ public function onException(GetResponseForExceptionEvent $event) {
if (!$this->isJsonApiExceptionEvent($event)) {
return;
}
if (($exception = $event->getException()) && !$exception instanceof HttpException) {
if (($exception = $event->getThrowable()) && !$exception instanceof HttpException) {
$exception = new HttpException(500, $exception->getMessage(), $exception);
$event->setException($exception);
$event->setThrowable($exception);
}
$this->setEventResponse($event, $exception->getStatusCode());
......@@ -57,7 +57,7 @@ public function onException(GetResponseForExceptionEvent $event) {
*/
protected function setEventResponse(GetResponseForExceptionEvent $event, $status) {
/* @var \Symfony\Component\HttpKernel\Exception\HttpException $exception */
$exception = $event->getException();
$exception = $event->getThrowable();
$response = new ResourceResponse(new JsonApiDocumentTopLevel(new ErrorCollection([$exception]), new NullIncludedData(), new LinkCollection([])), $exception->getStatusCode(), $exception->getHeaders());
$response->addCacheableDependency($exception);
$event->setResponse($response);
......
......@@ -84,7 +84,7 @@ public function __construct(KeyValueFactoryInterface $key_value, LanguageManager
* The exception event.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
// If this is not a 404, we don't need to check for a redirection.
if (!($exception instanceof NotFoundHttpException)) {
......
......@@ -69,7 +69,7 @@ protected static function getPriority() {
*/
public function on4xx(GetResponseForExceptionEvent $event) {
/** @var \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface $exception */
$exception = $event->getException();
$exception = $event->getThrowable();
$request = $event->getRequest();
$format = $request->getRequestFormat();
......
......@@ -45,7 +45,7 @@ public function __construct(AccountInterface $account) {
* The event to process.
*/
public function onException(GetResponseForExceptionEvent $event) {
$exception = $event->getException();
$exception = $event->getThrowable();
if ($exception instanceof AccessDeniedHttpException) {
$route_name = RouteMatch::createFromRequest($event->getRequest())->getRouteName();
$redirect_url = NULL;
......
......@@ -147,7 +147,7 @@ public function testOnExceptionResponseBuilderException() {
->willThrowException($expected_exception);
$event = $this->assertResponseFromException($request, $exception, NULL);
$this->assertSame($expected_exception, $event->getException());
$this->assertSame($expected_exception, $event->getThrowable());
}
/**
......
......@@ -199,6 +199,7 @@ public static function getSkippedDeprecations() {
'The \Drupal\Core\Path\AliasManager class is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use \Drupal\path_alias\AliasManager. See https://drupal.org/node/3092086',
'The \Drupal\Core\Path\AliasRepository class is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use \Drupal\path_alias\AliasRepository. See https://drupal.org/node/3092086',
'The \Drupal\Core\Path\AliasWhitelist class is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use \Drupal\path_alias\AliasWhitelist. See https://drupal.org/node/3092086',
'"Symfony\Component\DomCrawler\Crawler::text()" will normalize whitespaces by default in Symfony 5.0, set the second "$normalizeWhitespace" argument to false to retrieve the non-normalized version of the text.',
];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment