Commit 4d185faf authored by catch's avatar catch
Browse files

Issue #2674408 by alexpott, dawehner: Fix Drupal.Classes.UnusedUseStatement standard in core

parent 2971d9c0
......@@ -15,7 +15,6 @@
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Render\Markup;
use Drupal\Core\Render\Renderer;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
......@@ -578,7 +577,7 @@ function drupal_process_states(&$elements) {
// element available, setting #attributes does not make sense, but a wrapper
// is available, so setting #wrapper_attributes makes it work.
$key = ($elements['#type'] == 'item') ? '#wrapper_attributes' : '#attributes';
$elements[$key]['data-drupal-states'] = JSON::encode($elements['#states']);
$elements[$key]['data-drupal-states'] = Json::encode($elements['#states']);
}
/**
......@@ -1271,7 +1270,7 @@ function drupal_get_updaters() {
if (!isset($updaters)) {
$updaters = \Drupal::moduleHandler()->invokeAll('updater_info');
\Drupal::moduleHandler()->alter('updater_info', $updaters);
uasort($updaters, array('Drupal\Component\Utility\SortArray', 'sortByWeightElement'));
uasort($updaters, array(SortArray::class, 'sortByWeightElement'));
}
return $updaters;
}
......@@ -1291,7 +1290,7 @@ function drupal_get_filetransfer_info() {
if (!isset($info)) {
$info = \Drupal::moduleHandler()->invokeAll('filetransfer_info');
\Drupal::moduleHandler()->alter('filetransfer_info', $info);
uasort($info, array('Drupal\Component\Utility\SortArray', 'sortByWeightElement'));
uasort($info, array(SortArray::class, 'sortByWeightElement'));
}
return $info;
}
......@@ -8,7 +8,6 @@
namespace Drupal\Core;
use Drupal\Component\FileCache\FileCacheFactory;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Config\BootstrapConfigStorageFactory;
......
......@@ -5,7 +5,6 @@
* Hooks and documentation related to entities.
*/
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface;
......
......@@ -8,7 +8,6 @@
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\Core\Routing\RedirectDestinationInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Response;
......
......@@ -515,7 +515,7 @@ public function getOptionsProvider($property_name, FieldableEntityInterface $ent
// If the field item class implements the interface, create an orphaned
// runtime item object, so that it can be used as the options provider
// without modifying the entity being worked on.
if (is_subclass_of($this->getFieldItemClass(), '\Drupal\Core\TypedData\OptionsProviderInterface')) {
if (is_subclass_of($this->getFieldItemClass(), OptionsProviderInterface::class)) {
$items = $entity->get($this->getName());
return \Drupal::service('plugin.manager.field.field_type')->createFieldItem($items, 0);
}
......
......@@ -7,8 +7,6 @@
namespace Drupal\Core\Render\Element;
use Drupal\Core\Render\Element;
/**
* Provides a render element for a group of form elements.
*
......
......@@ -7,8 +7,6 @@
namespace Drupal\Core\Render\Element;
use Drupal\Core\Render\Element;
/**
* Provides a render element for a form.
*
......
......@@ -7,8 +7,6 @@
namespace Drupal\Core\Render\Element;
use Drupal\Core\Render\Element;
/**
* Provides a render element for a pager.
*
......
......@@ -8,7 +8,6 @@
namespace Drupal\Core\Render\Element;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
/**
* Provides a form element for input of multiple-line text.
......
......@@ -7,7 +7,6 @@
namespace Drupal\Core\Routing;
use Drupal\Core\Database\Query\Query;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\State\StateInterface;
use Symfony\Component\Routing\RouteCollection;
......
......@@ -7,8 +7,6 @@
namespace Drupal\Core\TypedData;
use Drupal\user;
/**
* Interface for typed data objects.
*
......
......@@ -13,7 +13,6 @@
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityViewBuilder;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -12,7 +12,6 @@
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\UrlGeneratorTrait;
use Drupal\Core\TypedData\DataDefinition;
use Drupal\Core\Field\FieldItemBase;
......
......@@ -13,7 +13,6 @@
use Drupal\Core\Field\FieldTypePluginManagerInterface;
use Drupal\Core\State\StateInterface;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\MigrateException;
use Drupal\migrate\Plugin\migrate\destination\EntityContentBase;
use Drupal\migrate\Row;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -11,7 +11,6 @@
use Drupal\comment\CommentInterface;
use Drupal\system\Tests\Entity\EntityUnitTestBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\Session;
use Drupal\comment\Entity\Comment;
use Drupal\entity_test\Entity\EntityTest;
......@@ -44,7 +43,7 @@ protected function setUp() {
$request = Request::create('/');
$request->setSession($session);
/** @var RequestStack $stack */
/** @var \Symfony\Component\HttpFoundation\RequestStack $stack */
$stack = $this->container->get('request_stack');
$stack->pop();
$stack->push($request);
......
......@@ -7,7 +7,6 @@
namespace Drupal\config\Tests;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\config_override_test\Cache\PirateDayCacheContext;
use Drupal\simpletest\KernelTestBase;
......@@ -68,7 +67,7 @@ public function testConfigEntityOverride() {
// Load the User login block and check that its cacheability metadata is
// overridden correctly. This verifies that the metadata is correctly
// applied to config entities.
/** @var EntityManagerInterface $entity_manager */
/** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */
$entity_manager = $this->container->get('entity.manager');
$block = $entity_manager->getStorage('block')->load('call_to_action');
......
......@@ -14,7 +14,6 @@
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\field\FieldConfigInterface;
/**
* Implements hook_help().
......
......@@ -10,7 +10,6 @@
use Drupal\Component\Serialization\Json;
use Drupal\field\Entity\FieldConfig;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\NodeType;
use Drupal\simpletest\WebTestBase;
use Drupal\field\Entity\FieldStorageConfig;
......@@ -31,7 +30,7 @@ class ContentTranslationContextualLinksTest extends WebTestBase {
/**
* The content type being tested.
*
* @var NodeType
* @var \Drupal\node\Entity\NodeType
*/
protected $contentType;
......
......@@ -12,7 +12,6 @@
use Drupal\Core\Cache\CacheableResponseInterface;
use Drupal\Core\PageCache\RequestPolicyInterface;
use Drupal\Core\PageCache\ResponsePolicyInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Render\RenderCacheInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
......
......@@ -7,7 +7,6 @@
namespace Drupal\editor\Tests;
use Drupal\Core\Entity\Entity;
use Drupal\editor\Entity\Editor;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
......
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