core/modules/rest/src/RequestHandler.php | 41 +------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php index 4b7020c..4f57aa7 100644 --- a/core/modules/rest/src/RequestHandler.php +++ b/core/modules/rest/src/RequestHandler.php @@ -122,13 +122,7 @@ public function handle(RouteMatchInterface $route_match, Request $request) { // Determine the request parameters that should be passed to the resource // plugin. $argument_resolver = $this->createArgumentResolver($route_match, $unserialized, $request); - try { - $arguments = $argument_resolver->getArguments([$resource, $method]); - } - catch (\RuntimeException $exception) { - @trigger_error('Passing in arguments the legacy way is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Provide the right parameter names in the method, similar to controllers. See https://www.drupal.org/node/2894819', E_USER_DEPRECATED); - $arguments = $this->getLegacyParameters($route_match, $unserialized, $request); - } + $arguments = $argument_resolver->getArguments([$resource, $method]); // Invoke the operation on the resource plugin. $response = call_user_func_array([$resource, $method], $arguments); @@ -204,37 +198,4 @@ protected function createArgumentResolver(RouteMatchInterface $route_match, $uns return new ArgumentsResolver($raw_route_arguments, $upcasted_route_arguments, $wildcard_arguments); } - /** - * Provides the parameter usable without an argument resolver. - * - * This creates an list of parameters in a statically defined order. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match - * @param mixed $unserialized - * The unserialized data. - * @param \Symfony\Component\HttpFoundation\Request $request - * The request. - * - * @deprecated in Drupal 8.4.0, will be removed before Drupal 9.0.0. Use the - * argument resolver method instead, see ::createArgumentResolver(). - * - * @see https://www.drupal.org/node/2894819 - * - * @return array - * An array of parameters. - */ - protected function getLegacyParameters(RouteMatchInterface $route_match, $unserialized, Request $request) { - $route_parameters = $route_match->getParameters(); - $parameters = []; - // Filter out all internal parameters starting with "_". - foreach ($route_parameters as $key => $parameter) { - if ($key{0} !== '_') { - $parameters[] = $parameter; - } - } - - return array_merge($parameters, [$unserialized, $request]); - } - }