Commit d1c44dd0 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3104307 by Berdir, longwave, Gábor Hojtsy, Wim Leers, alexpott,...

Issue #3104307 by Berdir, longwave, Gábor Hojtsy, Wim Leers, alexpott, andypost: Remove  BC layers in various Drupal\Core components
parent 151825ef
Loading
Loading
Loading
Loading
+1 −1
Changes for core/lib/Drupal/Core/Asset/AssetDumper.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class AssetDumper implements AssetDumperInterface {
   * @param \Drupal\Core\File\FileSystemInterface $file_system
   *   The file handler.
   */
  public function __construct(FileSystemInterface $file_system = NULL) {
  public function __construct(FileSystemInterface $file_system) {
    $this->fileSystem = $file_system;
  }

−28

File deleted.

−15
Changes for core/lib/Drupal/Core/Cache/BackendChain.php: 0 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -29,21 +29,6 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
   */
  protected $backends = [];

  /**
   * Constructs a new backend chain service instance.
   *
   * @param string|null $bin
   *   (deprecated) The cache bin for which the object is created. The $bin
   *   parameter is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
   *
   * @see https://www.drupal.org/node/3061125
   */
  public function __construct($bin = NULL) {
    if ($bin) {
      @trigger_error('The $bin parameter is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Omit the first parameter. See https://www.drupal.org/node/3061125', E_USER_DEPRECATED);
    }
  }

  /**
   * Appends a cache backend to the cache chain.
   *
−26
Changes for core/lib/Drupal/Core/Cache/Cache.php: 0 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -88,32 +88,6 @@ public static function mergeMaxAges($a = Cache::PERMANENT, $b = Cache::PERMANENT
    return min($a, $b);
  }

  /**
   * Validates an array of cache tags.
   *
   * Can be called before using cache tags in operations, to ensure validity.
   *
   * @param string[] $tags
   *   An array of cache tags.
   *
   * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
   *   assert(\Drupal\Component\Assertion\Inspector::assertAllStrings($tags))
   *   instead.
   *
   * @throws \LogicException
   */
  public static function validateTags(array $tags) {
    @trigger_error(__NAMESPACE__ . '\Cache::validateTags() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use assert(\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)) instead.', E_USER_DEPRECATED);
    if (empty($tags)) {
      return;
    }
    foreach ($tags as $value) {
      if (!is_string($value)) {
        throw new \LogicException('Cache tags must be strings, ' . gettype($value) . ' given.');
      }
    }
  }

  /**
   * Build an array of cache tags from a given prefix and an array of suffixes.
   *
−46
Changes for core/lib/Drupal/Core/Controller/ControllerResolver.php: 0 added lines, 46 removed lines.
Original line number Diff line number Diff line
@@ -3,9 +3,6 @@
namespace Drupal\Core\Controller;

use Drupal\Core\DependencyInjection\ClassResolverInterface;
use Drupal\Core\Routing\RouteMatch;
use Drupal\Core\Routing\RouteMatchInterface;
use Psr\Http\Message\ServerRequestInterface;
use Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ControllerResolver as BaseControllerResolver;
@@ -122,47 +119,4 @@ protected function createController($controller) {
    return [$controller, $method];
  }

  /**
   * {@inheritdoc}
   */
  protected function doGetArguments(Request $request, $controller, array $parameters) {
    // Note this duplicates the deprecation message of
    // Symfony\Component\HttpKernel\Controller\ControllerResolver::getArguments()
    // to ensure it is removed in Drupal 9.
    @trigger_error(sprintf('%s is deprecated as of 8.6.0 and will be removed in 9.0. Inject the "http_kernel.controller.argument_resolver" service instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
    $attributes = $request->attributes->all();
    $arguments = [];
    foreach ($parameters as $param) {
      if (array_key_exists($param->name, $attributes)) {
        $arguments[] = $attributes[$param->name];
      }
      elseif ($param->getClass() && $param->getClass()->isInstance($request)) {
        $arguments[] = $request;
      }
      elseif ($param->getClass() && $param->getClass()->name === ServerRequestInterface::class) {
        $arguments[] = $this->httpMessageFactory->createRequest($request);
      }
      elseif ($param->getClass() && ($param->getClass()->name == RouteMatchInterface::class || is_subclass_of($param->getClass()->name, RouteMatchInterface::class))) {
        $arguments[] = RouteMatch::createFromRequest($request);
      }
      elseif ($param->isDefaultValueAvailable()) {
        $arguments[] = $param->getDefaultValue();
      }
      else {
        if (is_array($controller)) {
          $repr = sprintf('%s::%s()', get_class($controller[0]), $controller[1]);
        }
        elseif (is_object($controller)) {
          $repr = get_class($controller);
        }
        else {
          $repr = $controller;
        }

        throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->name));
      }
    }
    return $arguments;
  }

}
Loading