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