Skip to content
Snippets Groups Projects
Commit 7f528634 authored by Jess's avatar Jess Committed by Tim Plunkett
Browse files

Issue #1614186 follow-up by xjm: Use \ rather than 'use' statements for native PHP classes.

parent 17120fc5
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
use Drupal\views\Plugin\views\PluginBase; use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use DateTimeZone;
use DateTime;
abstract class HandlerBase extends PluginBase { abstract class HandlerBase extends PluginBase {
...@@ -714,8 +712,8 @@ public function getSQLDateField() { ...@@ -714,8 +712,8 @@ public function getSQLDateField() {
$db_type = Database::getConnection()->databaseType(); $db_type = Database::getConnection()->databaseType();
$offset = $this->getTimezone(); $offset = $this->getTimezone();
if (isset($offset) && !is_numeric($offset)) { if (isset($offset) && !is_numeric($offset)) {
$dtz = new DateTimeZone($offset); $dtz = new \DateTimeZone($offset);
$dt = new DateTime('now', $dtz); $dt = new \DateTime('now', $dtz);
$offset_seconds = $dtz->getOffset($dt); $offset_seconds = $dtz->getOffset($dt);
} }
......
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
namespace Drupal\views\Plugin\views\wizard; namespace Drupal\views\Plugin\views\wizard;
use Exception;
/** /**
* A custom exception class for our errors. * A custom exception class for our errors.
*/ */
class WizardException extends Exception { class WizardException extends \Exception {
} }
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
* *
* @see Drupal\views\Plugin\views\field\FieldPluginBase * @see Drupal\views\Plugin\views\field\FieldPluginBase
*/ */
use DOMDocument;
class FieldTest extends HandlerTestBase { class FieldTest extends HandlerTestBase {
...@@ -170,7 +169,7 @@ protected function assertNotSubString($haystack, $needle, $message = '', $group ...@@ -170,7 +169,7 @@ protected function assertNotSubString($haystack, $needle, $message = '', $group
* An array containing simplexml objects. * An array containing simplexml objects.
*/ */
protected function parseContent($content) { protected function parseContent($content) {
$htmlDom = new DOMDocument(); $htmlDom = new \DOMDocument();
@$htmlDom->loadHTML('<?xml encoding="UTF-8">' . $content); @$htmlDom->loadHTML('<?xml encoding="UTF-8">' . $content);
$elements = simplexml_import_dom($htmlDom); $elements = simplexml_import_dom($htmlDom);
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
namespace Drupal\views\Tests\Plugin; namespace Drupal\views\Tests\Plugin;
use DOMDocument;
/** /**
* Tests some general style plugin related functionality. * Tests some general style plugin related functionality.
*/ */
...@@ -31,7 +29,7 @@ protected function setUp() { ...@@ -31,7 +29,7 @@ protected function setUp() {
* Stores a view output in the elements. * Stores a view output in the elements.
*/ */
function storeViewPreview($output) { function storeViewPreview($output) {
$htmlDom = new DOMDocument(); $htmlDom = new \DOMDocument();
@$htmlDom->loadHTML($output); @$htmlDom->loadHTML($output);
if ($htmlDom) { if ($htmlDom) {
// It's much easier to work with simplexml than DOM, luckily enough // It's much easier to work with simplexml than DOM, luckily enough
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
namespace Drupal\views\Tests; namespace Drupal\views\Tests;
use ReflectionClass;
/** /**
* Checks general plugin data and instances for all plugin types. * Checks general plugin data and instances for all plugin types.
*/ */
...@@ -93,7 +91,7 @@ public function testPluginInstances() { ...@@ -93,7 +91,7 @@ public function testPluginInstances() {
foreach ($plugins as $definition) { foreach ($plugins as $definition) {
// Get a reflection class for this plugin. // Get a reflection class for this plugin.
// We only want to test true plugins, i.e. They extend PluginBase. // We only want to test true plugins, i.e. They extend PluginBase.
$reflection = new ReflectionClass($definition['class']); $reflection = new \ReflectionClass($definition['class']);
if ($reflection->isSubclassOf('Drupal\views\Plugin\views\PluginBase')) { if ($reflection->isSubclassOf('Drupal\views\Plugin\views\PluginBase')) {
// Create a plugin instance and check what it is. This is not just // Create a plugin instance and check what it is. This is not just
// good to check they can be created but for throwing any notices for // good to check they can be created but for throwing any notices for
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
use Drupal\Core\Annotation\Plugin; use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation; use Drupal\Core\Annotation\Translation;
use Drupal\views\Plugin\views\row\RowPluginBase; use Drupal\views\Plugin\views\row\RowPluginBase;
use stdClass;
/** /**
* Plugin which performs a node_view on the resulting object * Plugin which performs a node_view on the resulting object
...@@ -165,7 +164,7 @@ function render($row) { ...@@ -165,7 +164,7 @@ function render($row) {
$item_text .= drupal_render($build); $item_text .= drupal_render($build);
} }
$item = new stdClass(); $item = new \stdClass();
$item->description = $item_text; $item->description = $item_text;
$item->title = $node->label(); $item->title = $node->label();
$item->link = $node->link; $item->link = $node->link;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment