Commit 7f528634 authored by xjm's avatar xjm Committed by tim.plunkett

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

parent 17120fc5
......@@ -11,8 +11,6 @@
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Database\Database;
use DateTimeZone;
use DateTime;
abstract class HandlerBase extends PluginBase {
......@@ -714,8 +712,8 @@ public function getSQLDateField() {
$db_type = Database::getConnection()->databaseType();
$offset = $this->getTimezone();
if (isset($offset) && !is_numeric($offset)) {
$dtz = new DateTimeZone($offset);
$dt = new DateTime('now', $dtz);
$dtz = new \DateTimeZone($offset);
$dt = new \DateTime('now', $dtz);
$offset_seconds = $dtz->getOffset($dt);
}
......
......@@ -7,11 +7,9 @@
namespace Drupal\views\Plugin\views\wizard;
use Exception;
/**
* A custom exception class for our errors.
*/
class WizardException extends Exception {
class WizardException extends \Exception {
}
......@@ -12,7 +12,6 @@
*
* @see Drupal\views\Plugin\views\field\FieldPluginBase
*/
use DOMDocument;
class FieldTest extends HandlerTestBase {
......@@ -170,7 +169,7 @@ protected function assertNotSubString($haystack, $needle, $message = '', $group
* An array containing simplexml objects.
*/
protected function parseContent($content) {
$htmlDom = new DOMDocument();
$htmlDom = new \DOMDocument();
@$htmlDom->loadHTML('<?xml encoding="UTF-8">' . $content);
$elements = simplexml_import_dom($htmlDom);
......
......@@ -7,8 +7,6 @@
namespace Drupal\views\Tests\Plugin;
use DOMDocument;
/**
* Tests some general style plugin related functionality.
*/
......@@ -31,7 +29,7 @@ protected function setUp() {
* Stores a view output in the elements.
*/
function storeViewPreview($output) {
$htmlDom = new DOMDocument();
$htmlDom = new \DOMDocument();
@$htmlDom->loadHTML($output);
if ($htmlDom) {
// It's much easier to work with simplexml than DOM, luckily enough
......
......@@ -7,8 +7,6 @@
namespace Drupal\views\Tests;
use ReflectionClass;
/**
* Checks general plugin data and instances for all plugin types.
*/
......@@ -93,7 +91,7 @@ public function testPluginInstances() {
foreach ($plugins as $definition) {
// Get a reflection class for this plugin.
// 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')) {
// 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
......
......@@ -10,7 +10,6 @@
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
use Drupal\views\Plugin\views\row\RowPluginBase;
use stdClass;
/**
* Plugin which performs a node_view on the resulting object
......@@ -165,7 +164,7 @@ function render($row) {
$item_text .= drupal_render($build);
}
$item = new stdClass();
$item = new \stdClass();
$item->description = $item_text;
$item->title = $node->label();
$item->link = $node->link;
......
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