Issue #2455415 by rteijeiro, hussainweb, rpayanm, baisong: Rename Views plugin classes to support PHP 7

8.0.x
Alex Pott 2015-03-22 11:20:34 +00:00
parent 4a7ab3e408
commit e5d6c142ff
30 changed files with 54 additions and 54 deletions

View File

@ -8,7 +8,7 @@
namespace Drupal\aggregator\Plugin\views\argument; namespace Drupal\aggregator\Plugin\views\argument;
use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("aggregator_fid") * @ViewsArgument("aggregator_fid")
*/ */
class Fid extends Numeric { class Fid extends NumericArgument {
/** /**
* The entity manager service. * The entity manager service.

View File

@ -8,7 +8,7 @@
namespace Drupal\aggregator\Plugin\views\argument; namespace Drupal\aggregator\Plugin\views\argument;
use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("aggregator_iid") * @ViewsArgument("aggregator_iid")
*/ */
class Iid extends Numeric { class Iid extends NumericArgument {
/** /**
* The entity manager service. * The entity manager service.

View File

@ -10,7 +10,7 @@ namespace Drupal\comment\Plugin\views\field;
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\comment\CommentInterface; use Drupal\comment\CommentInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\field\Numeric; use Drupal\views\Plugin\views\field\NumericField;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ResultRow; use Drupal\views\ResultRow;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
@ -23,7 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsField("node_new_comments") * @ViewsField("node_new_comments")
*/ */
class NodeNewComments extends Numeric { class NodeNewComments extends NumericField {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@ -9,7 +9,7 @@ namespace Drupal\file\Plugin\views\argument;
use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("file_fid") * @ViewsArgument("file_fid")
*/ */
class Fid extends Numeric implements ContainerFactoryPluginInterface { class Fid extends NumericArgument implements ContainerFactoryPluginInterface {
/** /**
* The entity manager service * The entity manager service

View File

@ -9,7 +9,7 @@ namespace Drupal\node\Plugin\views\argument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\node\NodeStorageInterface; use Drupal\node\NodeStorageInterface;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("node_nid") * @ViewsArgument("node_nid")
*/ */
class Nid extends Numeric { class Nid extends NumericArgument {
/** /**
* The node storage. * The node storage.

View File

@ -9,7 +9,7 @@ namespace Drupal\node\Plugin\views\argument;
use Drupal\Component\Utility\String as UtilityString; use Drupal\Component\Utility\String as UtilityString;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\views\Plugin\views\argument\String; use Drupal\views\Plugin\views\argument\StringArgument;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("node_type") * @ViewsArgument("node_type")
*/ */
class Type extends String { class Type extends StringArgument {
/** /**
* NodeType storage controller. * NodeType storage controller.

View File

@ -9,7 +9,7 @@ namespace Drupal\node\Plugin\views\argument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\node\NodeStorageInterface; use Drupal\node\NodeStorageInterface;
@ -18,7 +18,7 @@ use Drupal\node\NodeStorageInterface;
* *
* @ViewsArgument("node_vid") * @ViewsArgument("node_vid")
*/ */
class Vid extends Numeric { class Vid extends NumericArgument {
/** /**
* Database Service Object. * Database Service Object.

View File

@ -13,7 +13,7 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\views\FieldAPIHandlerTrait; use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
/** /**
* Argument handler for list field to show the human readable name in the * Argument handler for list field to show the human readable name in the
@ -23,7 +23,7 @@ use Drupal\views\Plugin\views\argument\Numeric;
* *
* @ViewsArgument("number_list_field") * @ViewsArgument("number_list_field")
*/ */
class NumberListField extends Numeric { class NumberListField extends NumericArgument {
use AllowedTagsXssTrait; use AllowedTagsXssTrait;
use FieldAPIHandlerTrait; use FieldAPIHandlerTrait;

View File

@ -12,7 +12,7 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\views\FieldAPIHandlerTrait; use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\String; use Drupal\views\Plugin\views\argument\StringArgument;
use Drupal\Component\Utility\String as StringUtility; use Drupal\Component\Utility\String as StringUtility;
/** /**
@ -22,7 +22,7 @@ use Drupal\Component\Utility\String as StringUtility;
* *
* @ViewsArgument("string_list_field") * @ViewsArgument("string_list_field")
*/ */
class StringListField extends String { class StringListField extends StringArgument {
use AllowedTagsXssTrait; use AllowedTagsXssTrait;
use FieldAPIHandlerTrait; use FieldAPIHandlerTrait;

View File

@ -7,7 +7,7 @@
namespace Drupal\search\Plugin\views\field; namespace Drupal\search\Plugin\views\field;
use Drupal\views\Plugin\views\field\Numeric; use Drupal\views\Plugin\views\field\NumericField;
use Drupal\views\ResultRow; use Drupal\views\ResultRow;
/** /**
@ -17,7 +17,7 @@ use Drupal\views\ResultRow;
* *
* @ViewsField("search_score") * @ViewsField("search_score")
*/ */
class Score extends Numeric { class Score extends NumericField {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@ -9,7 +9,7 @@ namespace Drupal\taxonomy\Plugin\views\argument;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("taxonomy") * @ViewsArgument("taxonomy")
*/ */
class Taxonomy extends Numeric implements ContainerFactoryPluginInterface { class Taxonomy extends NumericArgument implements ContainerFactoryPluginInterface {
/** /**
* @var EntityStorageInterface * @var EntityStorageInterface

View File

@ -7,7 +7,7 @@
namespace Drupal\taxonomy\Plugin\views\argument; namespace Drupal\taxonomy\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\taxonomy\VocabularyStorageInterface; use Drupal\taxonomy\VocabularyStorageInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("vocabulary_vid") * @ViewsArgument("vocabulary_vid")
*/ */
class VocabularyVid extends Numeric { class VocabularyVid extends NumericArgument {
/** /**
* The vocabulary storage. * The vocabulary storage.

View File

@ -9,7 +9,7 @@ namespace Drupal\user\Plugin\views\argument;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* *
* @ViewsArgument("user_uid") * @ViewsArgument("user_uid")
*/ */
class Uid extends Numeric { class Uid extends NumericArgument {
/** /**
* The user storage. * The user storage.

View File

@ -12,7 +12,7 @@ use Drupal\Core\Field\AllowedTagsXssTrait;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\Numeric; use Drupal\views\Plugin\views\argument\NumericArgument;
/** /**
* Argument handler for list field to show the human readable name in the * Argument handler for list field to show the human readable name in the
@ -22,7 +22,7 @@ use Drupal\views\Plugin\views\argument\Numeric;
* *
* @ViewsArgument("field_list") * @ViewsArgument("field_list")
*/ */
class FieldList extends Numeric { class FieldList extends NumericArgument {
use AllowedTagsXssTrait; use AllowedTagsXssTrait;

View File

@ -12,7 +12,7 @@ use Drupal\Core\Field\AllowedTagsXssTrait;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\String; use Drupal\views\Plugin\views\argument\StringArgument;
/** /**
* Argument handler for list field to show the human readable name in the * Argument handler for list field to show the human readable name in the
@ -22,7 +22,7 @@ use Drupal\views\Plugin\views\argument\String;
* *
* @ViewsArgument("field_list_string") * @ViewsArgument("field_list_string")
*/ */
class ListString extends String { class ListString extends StringArgument {
use AllowedTagsXssTrait; use AllowedTagsXssTrait;
@ -34,7 +34,7 @@ class ListString extends String {
var $allowed_values = NULL; var $allowed_values = NULL;
/** /**
* Overrides \Drupal\views\Plugin\views\argument\String::init(). * Overrides \Drupal\views\Plugin\views\argument\StringArgument::init().
*/ */
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options); parent::init($view, $display, $options);

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\argument\Null. * Contains \Drupal\views\Plugin\views\argument\NullArgument.
*/ */
namespace Drupal\views\Plugin\views\argument; namespace Drupal\views\Plugin\views\argument;
@ -16,7 +16,7 @@ use Drupal\Core\Form\FormStateInterface;
* *
* @ViewsArgument("null") * @ViewsArgument("null")
*/ */
class Null extends ArgumentPluginBase { class NullArgument extends ArgumentPluginBase {
protected function defineOptions() { protected function defineOptions() {
$options = parent::defineOptions(); $options = parent::defineOptions();

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\argument\Numeric. * Contains \Drupal\views\Plugin\views\argument\NumericArgument.
*/ */
namespace Drupal\views\Plugin\views\argument; namespace Drupal\views\Plugin\views\argument;
@ -17,7 +17,7 @@ use Drupal\Core\Form\FormStateInterface;
* *
* @ViewsArgument("numeric") * @ViewsArgument("numeric")
*/ */
class Numeric extends ArgumentPluginBase { class NumericArgument extends ArgumentPluginBase {
/** /**
* The operator used for the query: or|and. * The operator used for the query: or|and.

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\argument\String. * Contains \Drupal\views\Plugin\views\argument\StringArgument.
*/ */
namespace Drupal\views\Plugin\views\argument; namespace Drupal\views\Plugin\views\argument;
@ -20,7 +20,7 @@ use Drupal\views\ManyToOneHelper;
* *
* @ViewsArgument("string") * @ViewsArgument("string")
*/ */
class String extends ArgumentPluginBase { class StringArgument extends ArgumentPluginBase {
/** /**
* Overrides \Drupal\views\Plugin\views\argument\ArgumentPluginBase::init(). * Overrides \Drupal\views\Plugin\views\argument\ArgumentPluginBase::init().

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\argument_validator\Numeric. * Contains \Drupal\views\Plugin\views\argument_validator\NumericArgumentValidator.
*/ */
namespace Drupal\views\Plugin\views\argument_validator; namespace Drupal\views\Plugin\views\argument_validator;
@ -17,7 +17,7 @@ namespace Drupal\views\Plugin\views\argument_validator;
* title = @Translation("Numeric") * title = @Translation("Numeric")
* ) * )
*/ */
class Numeric extends ArgumentValidatorPluginBase { class NumericArgumentValidator extends ArgumentValidatorPluginBase {
public function validateArgument($argument) { public function validateArgument($argument) {
return is_numeric($argument); return is_numeric($argument);

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\field\Numeric. * Contains \Drupal\views\Plugin\views\field\NumericField.
*/ */
namespace Drupal\views\Plugin\views\field; namespace Drupal\views\Plugin\views\field;
@ -21,7 +21,7 @@ use Drupal\views\ResultRow;
* *
* @ViewsField("numeric") * @ViewsField("numeric")
*/ */
class Numeric extends FieldPluginBase { class NumericField extends FieldPluginBase {
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@ -16,7 +16,7 @@ use Drupal\Core\Form\FormStateInterface;
* *
* @ViewsFilter("combine") * @ViewsFilter("combine")
*/ */
class Combine extends String { class Combine extends StringFilter {
/** /**
* @var views_plugin_query_default * @var views_plugin_query_default

View File

@ -16,7 +16,7 @@ use Drupal\Core\Form\FormStateInterface;
* *
* @ViewsFilter("date") * @ViewsFilter("date")
*/ */
class Date extends Numeric { class Date extends NumericFilter {
protected function defineOptions() { protected function defineOptions() {
$options = parent::defineOptions(); $options = parent::defineOptions();

View File

@ -14,7 +14,7 @@ namespace Drupal\views\Plugin\views\filter;
* *
* @ViewsFilter("groupby_numeric") * @ViewsFilter("groupby_numeric")
*/ */
class GroupByNumeric extends Numeric { class GroupByNumeric extends NumericFilter {
public function query() { public function query() {
$this->ensureMyTable(); $this->ensureMyTable();

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\filter\Numeric. * Contains \Drupal\views\Plugin\views\filter\NumericFilter.
*/ */
namespace Drupal\views\Plugin\views\filter; namespace Drupal\views\Plugin\views\filter;
@ -18,7 +18,7 @@ use Drupal\Core\Form\FormStateInterface;
* *
* @ViewsFilter("numeric") * @ViewsFilter("numeric")
*/ */
class Numeric extends FilterPluginBase { class NumericFilter extends FilterPluginBase {
protected $alwaysMultiple = TRUE; protected $alwaysMultiple = TRUE;

View File

@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\views\Plugin\views\filter\String. * Contains \Drupal\views\Plugin\views\filter\StringFilter.
*/ */
namespace Drupal\views\Plugin\views\filter; namespace Drupal\views\Plugin\views\filter;
@ -19,7 +19,7 @@ use Drupal\Core\Form\FormStateInterface;
* *
* @ViewsFilter("string") * @ViewsFilter("string")
*/ */
class String extends FilterPluginBase { class StringFilter extends FilterPluginBase {
// exposed filter options // exposed filter options
protected $alwaysMultiple = TRUE; protected $alwaysMultiple = TRUE;

View File

@ -11,7 +11,7 @@ use Drupal\views\Tests\ViewUnitTestBase;
use Drupal\views\Views; use Drupal\views\Views;
/** /**
* Tests the core Drupal\views\Plugin\views\argument\Null handler. * Tests the core Drupal\views\Plugin\views\argument\NullArgument handler.
* *
* @group views * @group views
*/ */

View File

@ -10,7 +10,7 @@ namespace Drupal\views\Tests\Handler;
use Drupal\views\Views; use Drupal\views\Views;
/** /**
* Tests the core Drupal\views\Plugin\views\argument\String handler. * Tests the core Drupal\views\Plugin\views\argument\StringArgument handler.
* *
* @group views * @group views
*/ */

View File

@ -11,7 +11,7 @@ use Drupal\views\Tests\ViewUnitTestBase;
use Drupal\views\Views; use Drupal\views\Views;
/** /**
* Tests the core Drupal\views\Plugin\views\filter\String handler. * Tests the core Drupal\views\Plugin\views\filter\StringFilter handler.
* *
* @group views * @group views
*/ */

View File

@ -8,7 +8,7 @@
namespace Drupal\views_test_data\Plugin\views\style; namespace Drupal\views_test_data\Plugin\views\style;
use Drupal\views\Plugin\views\style\Mapping; use Drupal\views\Plugin\views\style\Mapping;
use Drupal\views\Plugin\views\field\Numeric; use Drupal\views\Plugin\views\field\NumericField;
/** /**
* Provides a test plugin for the mapping style. * Provides a test plugin for the mapping style.
@ -59,7 +59,7 @@ class MappingTest extends Mapping {
*/ */
protected function filterNumericFields(&$fields) { protected function filterNumericFields(&$fields) {
foreach ($this->view->field as $id => $field) { foreach ($this->view->field as $id => $field) {
if (!($field instanceof Numeric)) { if (!($field instanceof NumericField)) {
unset($fields[$id]); unset($fields[$id]);
} }
} }

View File

@ -13,7 +13,7 @@ use Drupal\config\Tests\SchemaCheckTestTrait;
* Tests the numeric filter UI. * Tests the numeric filter UI.
* *
* @group views_ui * @group views_ui
* @see \Drupal\views\Plugin\views\filter\Numeric * @see \Drupal\views\Plugin\views\filter\NumericFilter
*/ */
class FilterNumericWebTest extends UITestBase { class FilterNumericWebTest extends UITestBase {
use SchemaCheckTestTrait; use SchemaCheckTestTrait;