Commit a83b06a4 authored by catch's avatar catch

Issue #2923015 by cburschka, amateescu, tstoeckler, alexpott, hchonov,...

Issue #2923015 by cburschka, amateescu, tstoeckler, alexpott, hchonov, mondrake, pfrenssen: [PHP 7.2] Incompatible method declarations
parent 03fd77c8
...@@ -250,7 +250,7 @@ public function id() { ...@@ -250,7 +250,7 @@ public function id() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function preSave(EntityStorageInterface $storage, $update = TRUE) { public function preSave(EntityStorageInterface $storage) {
// Ensure that a region is set on each component. // Ensure that a region is set on each component.
foreach ($this->getComponents() as $name => $component) { foreach ($this->getComponents() as $name => $component) {
$this->handleHiddenType($name, $component); $this->handleHiddenType($name, $component);
...@@ -263,7 +263,7 @@ public function preSave(EntityStorageInterface $storage, $update = TRUE) { ...@@ -263,7 +263,7 @@ public function preSave(EntityStorageInterface $storage, $update = TRUE) {
ksort($this->content); ksort($this->content);
ksort($this->hidden); ksort($this->hidden);
parent::preSave($storage, $update); parent::preSave($storage);
} }
/** /**
......
...@@ -95,18 +95,6 @@ public function filterEmptyItems() { ...@@ -95,18 +95,6 @@ public function filterEmptyItems() {
return $this; return $this;
} }
/**
* {@inheritdoc}
* @todo Revisit the need when all entity types are converted to NG entities.
*/
public function getValue($include_computed = FALSE) {
$values = [];
foreach ($this->list as $delta => $item) {
$values[$delta] = $item->getValue($include_computed);
}
return $values;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Provides a local task that shows the amount of unapproved comments. * Provides a local task that shows the amount of unapproved comments.
...@@ -53,7 +54,7 @@ public static function create(ContainerInterface $container, array $configuratio ...@@ -53,7 +54,7 @@ public static function create(ContainerInterface $container, array $configuratio
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return $this->t('Unapproved comments (@count)', ['@count' => $this->commentStorage->getUnapprovedCount()]); return $this->t('Unapproved comments (@count)', ['@count' => $this->commentStorage->getUnapprovedCount()]);
} }
......
...@@ -63,8 +63,8 @@ abstract class CommentTestBase extends ViewTestBase { ...@@ -63,8 +63,8 @@ abstract class CommentTestBase extends ViewTestBase {
*/ */
protected $comment; protected $comment;
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
ViewTestData::createTestViews(get_class($this), ['comment_test_views']); ViewTestData::createTestViews(get_class($this), ['comment_test_views']);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Core\Menu\ContextualLinkDefault; use Drupal\Core\Menu\ContextualLinkDefault;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a contextual link plugin with a dynamic title. * Defines a contextual link plugin with a dynamic title.
...@@ -22,7 +23,7 @@ class ConfigTranslationContextualLink extends ContextualLinkDefault { ...@@ -22,7 +23,7 @@ class ConfigTranslationContextualLink extends ContextualLinkDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
// Use the custom 'config_translation_plugin_id' plugin definition key to // Use the custom 'config_translation_plugin_id' plugin definition key to
// retrieve the title. We need to retrieve a runtime title (as opposed to // retrieve the title. We need to retrieve a runtime title (as opposed to
// storing the title on the plugin definition for the link) because it // storing the title on the plugin definition for the link) because it
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Core\Menu\LocalTaskDefault; use Drupal\Core\Menu\LocalTaskDefault;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a local task plugin with a dynamic title. * Defines a local task plugin with a dynamic title.
...@@ -22,7 +23,7 @@ class ConfigTranslationLocalTask extends LocalTaskDefault { ...@@ -22,7 +23,7 @@ class ConfigTranslationLocalTask extends LocalTaskDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
// Take custom 'config_translation_plugin_id' plugin definition key to // Take custom 'config_translation_plugin_id' plugin definition key to
// retrieve title. We need to retrieve a runtime title (as opposed to // retrieve title. We need to retrieve a runtime title (as opposed to
// storing the title on the plugin definition for the link) because // storing the title on the plugin definition for the link) because
......
...@@ -37,7 +37,7 @@ public function __construct(DataDefinitionInterface $definition, $name = NULL, T ...@@ -37,7 +37,7 @@ public function __construct(DataDefinitionInterface $definition, $name = NULL, T
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getValue($langcode = NULL) { public function getValue() {
if ($this->date !== NULL) { if ($this->date !== NULL) {
return $this->date; return $this->date;
} }
......
...@@ -43,8 +43,8 @@ abstract class DateTimeHandlerTestBase extends HandlerTestBase { ...@@ -43,8 +43,8 @@ abstract class DateTimeHandlerTestBase extends HandlerTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
// Add a date field to page nodes. // Add a date field to page nodes.
$node_type = NodeType::create([ $node_type = NodeType::create([
......
...@@ -42,8 +42,8 @@ abstract class FieldTestBase extends ViewTestBase { ...@@ -42,8 +42,8 @@ abstract class FieldTestBase extends ViewTestBase {
*/ */
public $fields; public $fields;
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
// Ensure the page node type exists. // Ensure the page node type exists.
NodeType::create([ NodeType::create([
......
...@@ -38,8 +38,8 @@ class FieldUITest extends FieldTestBase { ...@@ -38,8 +38,8 @@ class FieldUITest extends FieldTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
$this->account = $this->drupalCreateUser(['administer views']); $this->account = $this->drupalCreateUser(['administer views']);
$this->drupalLogin($this->account); $this->drupalLogin($this->account);
......
...@@ -41,8 +41,8 @@ class HandlerFieldFieldTest extends FieldTestBase { ...@@ -41,8 +41,8 @@ class HandlerFieldFieldTest extends FieldTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
// Setup basic fields. // Setup basic fields.
$this->setUpFieldStorages(3); $this->setUpFieldStorages(3);
......
...@@ -30,8 +30,8 @@ class RelationshipUserFileDataTest extends ViewTestBase { ...@@ -30,8 +30,8 @@ class RelationshipUserFileDataTest extends ViewTestBase {
*/ */
public static $testViews = ['test_file_user_file_data']; public static $testViews = ['test_file_user_file_data'];
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
// Create the user profile field and instance. // Create the user profile field and instance.
FieldStorageConfig::create([ FieldStorageConfig::create([
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\taxonomy\Form\OverviewTerms; use Drupal\taxonomy\Form\OverviewTerms;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\taxonomy\VocabularyInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
...@@ -47,7 +48,7 @@ public function getFormId() { ...@@ -47,7 +48,7 @@ public function getFormId() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function buildForm(array $form, FormStateInterface $form_state) { public function buildForm(array $form, FormStateInterface $form_state, VocabularyInterface $taxonomy_vocabulary = NULL) {
$forum_config = $this->config('forum.settings'); $forum_config = $this->config('forum.settings');
$vid = $forum_config->get('vocabulary'); $vid = $forum_config->get('vocabulary');
$vocabulary = $this->entityManager->getStorage('taxonomy_vocabulary')->load($vid); $vocabulary = $this->entityManager->getStorage('taxonomy_vocabulary')->load($vid);
......
...@@ -30,8 +30,8 @@ class RelationshipUserImageDataTest extends ViewTestBase { ...@@ -30,8 +30,8 @@ class RelationshipUserImageDataTest extends ViewTestBase {
*/ */
public static $testViews = ['test_image_user_image_data']; public static $testViews = ['test_image_user_image_data'];
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
// Create the user profile field and instance. // Create the user profile field and instance.
FieldStorageConfig::create([ FieldStorageConfig::create([
......
...@@ -35,11 +35,13 @@ public function getFormId() { ...@@ -35,11 +35,13 @@ public function getFormId() {
* The region of the block. * The region of the block.
* @param string $uuid * @param string $uuid
* The UUID of the block being updated. * The UUID of the block being updated.
* @param array $configuration
* (optional) The array of configuration for the block.
* *
* @return array * @return array
* The form array. * The form array.
*/ */
public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $entity = NULL, $delta = NULL, $region = NULL, $uuid = NULL) { public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $entity = NULL, $delta = NULL, $region = NULL, $uuid = NULL, array $configuration = []) {
/** @var \Drupal\layout_builder\SectionStorageInterface $field_list */ /** @var \Drupal\layout_builder\SectionStorageInterface $field_list */
$field_list = $entity->layout_builder__layout; $field_list = $entity->layout_builder__layout;
$plugin = $field_list->getSection($delta)->getComponent($uuid)->getPlugin(); $plugin = $field_list->getSection($delta)->getComponent($uuid)->getPlugin();
......
...@@ -38,8 +38,8 @@ class LinkViewsTokensTest extends ViewTestBase { ...@@ -38,8 +38,8 @@ class LinkViewsTokensTest extends ViewTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
ViewTestData::createTestViews(get_class($this), ['link_test_views']); ViewTestData::createTestViews(get_class($this), ['link_test_views']);
// Create Basic page node type. // Create Basic page node type.
......
...@@ -108,7 +108,7 @@ public function getIds() { ...@@ -108,7 +108,7 @@ public function getIds() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function count() { public function count($refresh = FALSE) {
return count($this->dataRows); return count($this->dataRows);
} }
......
...@@ -58,7 +58,7 @@ public function getIds() { ...@@ -58,7 +58,7 @@ public function getIds() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function count() { public function count($refresh = FALSE) {
return 1; return 1;
} }
......
...@@ -42,8 +42,8 @@ class IntegrationTest extends ViewTestBase { ...@@ -42,8 +42,8 @@ class IntegrationTest extends ViewTestBase {
*/ */
public static $testViews = ['test_statistics_integration']; public static $testViews = ['test_statistics_integration'];
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
ViewTestData::createTestViews(get_class($this), ['statistics_test_views']); ViewTestData::createTestViews(get_class($this), ['statistics_test_views']);
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\menu_test\Plugin\Menu\ContextualLink; namespace Drupal\menu_test\Plugin\Menu\ContextualLink;
use Drupal\Core\Menu\ContextualLinkDefault; use Drupal\Core\Menu\ContextualLinkDefault;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a contextual link plugin with a dynamic title from user input. * Defines a contextual link plugin with a dynamic title from user input.
...@@ -12,7 +13,7 @@ class TestContextualLink extends ContextualLinkDefault { ...@@ -12,7 +13,7 @@ class TestContextualLink extends ContextualLinkDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return "<script>alert('Welcome to the jungle!')</script>"; return "<script>alert('Welcome to the jungle!')</script>";
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\menu_test\Plugin\Menu\LocalAction; namespace Drupal\menu_test\Plugin\Menu\LocalAction;
use Drupal\Core\Menu\LocalActionDefault; use Drupal\Core\Menu\LocalActionDefault;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a test local action plugin class. * Defines a test local action plugin class.
...@@ -12,7 +13,7 @@ class TestLocalAction extends LocalActionDefault { ...@@ -12,7 +13,7 @@ class TestLocalAction extends LocalActionDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return 'Title override'; return 'Title override';
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Drupal\Core\Menu\LocalActionDefault; use Drupal\Core\Menu\LocalActionDefault;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a local action plugin with a dynamic title. * Defines a local action plugin with a dynamic title.
...@@ -15,7 +16,7 @@ class TestLocalAction4 extends LocalActionDefault { ...@@ -15,7 +16,7 @@ class TestLocalAction4 extends LocalActionDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return $this->t('My @arg action', ['@arg' => 'dynamic-title']); return $this->t('My @arg action', ['@arg' => 'dynamic-title']);
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\menu_test\Plugin\Menu\LocalAction; namespace Drupal\menu_test\Plugin\Menu\LocalAction;
use Drupal\Core\Menu\LocalActionDefault; use Drupal\Core\Menu\LocalActionDefault;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a local action plugin with a dynamic title from user input. * Defines a local action plugin with a dynamic title from user input.
...@@ -12,7 +13,7 @@ class TestLocalAction5 extends LocalActionDefault { ...@@ -12,7 +13,7 @@ class TestLocalAction5 extends LocalActionDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return "<script>alert('Welcome to the jungle!')</script>"; return "<script>alert('Welcome to the jungle!')</script>";
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
use Drupal\Core\Menu\LocalActionDefault; use Drupal\Core\Menu\LocalActionDefault;
use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\Routing\RouteProviderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Defines a test local action plugin class. * Defines a test local action plugin class.
...@@ -20,7 +21,7 @@ class TestLocalActionWithConfig extends LocalActionDefault { ...@@ -20,7 +21,7 @@ class TestLocalActionWithConfig extends LocalActionDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return $this->config->get('title'); return $this->config->get('title');
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Drupal\Core\Menu\LocalTaskDefault; use Drupal\Core\Menu\LocalTaskDefault;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\HttpFoundation\Request;
class TestTasksSettingsSub1 extends LocalTaskDefault { class TestTasksSettingsSub1 extends LocalTaskDefault {
...@@ -12,7 +13,7 @@ class TestTasksSettingsSub1 extends LocalTaskDefault { ...@@ -12,7 +13,7 @@ class TestTasksSettingsSub1 extends LocalTaskDefault {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getTitle() { public function getTitle(Request $request = NULL) {
return $this->t('Dynamic title for @class', ['@class' => 'TestTasksSettingsSub1']); return $this->t('Dynamic title for @class', ['@class' => 'TestTasksSettingsSub1']);
} }
......
...@@ -41,8 +41,8 @@ abstract class TrackerTestBase extends ViewTestBase { ...@@ -41,8 +41,8 @@ abstract class TrackerTestBase extends ViewTestBase {
*/ */
protected $comment; protected $comment;
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
ViewTestData::createTestViews(get_class($this), ['tracker_test_views']); ViewTestData::createTestViews(get_class($this), ['tracker_test_views']);
......
...@@ -35,8 +35,8 @@ class FieldApiDataTest extends FieldTestBase { ...@@ -35,8 +35,8 @@ class FieldApiDataTest extends FieldTestBase {
*/ */
protected $translationNodes; protected $translationNodes;
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(FALSE); parent::setUp($import_test_views);
$field_names = $this->setUpFieldStorages(4); $field_names = $this->setUpFieldStorages(4);
......
...@@ -26,8 +26,8 @@ class DisplayFeedTest extends PluginTestBase { ...@@ -26,8 +26,8 @@ class DisplayFeedTest extends PluginTestBase {
*/ */
public static $modules = ['block', 'node', 'views']; public static $modules = ['block', 'node', 'views'];
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
$this->enableViewsTestModule(); $this->enableViewsTestModule();
......
...@@ -27,8 +27,8 @@ class StyleOpmlTest extends PluginTestBase { ...@@ -27,8 +27,8 @@ class StyleOpmlTest extends PluginTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
$this->enableViewsTestModule(); $this->enableViewsTestModule();
......
...@@ -19,8 +19,8 @@ class ViewAjaxTest extends ViewTestBase { ...@@ -19,8 +19,8 @@ class ViewAjaxTest extends ViewTestBase {
*/ */
public static $testViews = ['test_ajax_view', 'test_view']; public static $testViews = ['test_ajax_view', 'test_view'];
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
$this->enableViewsTestModule(); $this->enableViewsTestModule();
} }
......
...@@ -21,8 +21,8 @@ abstract class WizardTestBase extends ViewTestBase { ...@@ -21,8 +21,8 @@ abstract class WizardTestBase extends ViewTestBase {
*/ */
public static $modules = ['node', 'views_ui', 'block', 'rest']; public static $modules = ['node', 'views_ui', 'block', 'rest'];
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
// Create and log in a user with administer views permission. // Create and log in a user with administer views permission.
$views_admin = $this->drupalCreateUser(['administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view all revisions']); $views_admin = $this->drupalCreateUser(['administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view all revisions']);
......
...@@ -36,8 +36,8 @@ abstract class UITestBase extends ViewTestBase { ...@@ -36,8 +36,8 @@ abstract class UITestBase extends ViewTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp($import_test_views = TRUE) {
parent::setUp(); parent::setUp($import_test_views);
$this->enableViewsTestModule(); $this->enableViewsTestModule();
......
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