diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php index a98ae604133ccdb545d8c472878e3dbcd7b6fcf4..a0f49905795e0811b43ce26dc622beea2cf26841 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -389,7 +389,7 @@ public static function validateAllowedValues($element, FormStateInterface $form_ /** * Extracts the allowed values array from the allowed_values element. * - * @param string|array $list + * @param array $list * The raw string or array to extract values from. * @param bool $has_data * The current field already has data inserted or not. @@ -399,16 +399,9 @@ public static function validateAllowedValues($element, FormStateInterface $form_ * * @see \Drupal\options\Plugin\Field\FieldType\ListItemBase::allowedValuesString() */ - protected static function extractAllowedValues($list, $has_data) { + protected static function extractAllowedValues(array $list, bool $has_data) { $values = []; - if (is_string($list)) { - trigger_error('Passing a string to ' . __METHOD__ . '() is deprecated in drupal:10.2.0 and will cause an error from drupal:11.0.0. Use an array instead. See https://www.drupal.org/node/3376368', E_USER_DEPRECATED); - $list = explode("\n", $list); - $list = array_map('trim', $list); - $list = array_filter($list, 'strlen'); - } - $generated_keys = $explicit_keys = FALSE; foreach ($list as $position => $text) { // Check for an explicit key. diff --git a/core/modules/search/src/SearchIndex.php b/core/modules/search/src/SearchIndex.php index 2e11edca6253b0e149a156589863985ab9786012..1a0bdbdd14772237b7d539d1cd0ac8cbe71aa238 100644 --- a/core/modules/search/src/SearchIndex.php +++ b/core/modules/search/src/SearchIndex.php @@ -13,74 +13,30 @@ */ class SearchIndex implements SearchIndexInterface { - /** - * The config factory. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface - */ - protected $configFactory; - - /** - * The database connection. - * - * @var \Drupal\Core\Database\Connection - */ - protected $connection; - - /** - * The database replica connection. - * - * @var \Drupal\Core\Database\Connection - */ - protected $replica; - - /** - * The cache tags invalidator. - * - * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface - */ - protected $cacheTagsInvalidator; - - /** - * The text processor. - * - * @var \Drupal\search\SearchTextProcessorInterface - */ - protected $textProcessor; - /** * SearchIndex constructor. * - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory * The config factory. * @param \Drupal\Core\Database\Connection $connection * The database connection. * @param \Drupal\Core\Database\Connection $replica * The database replica connection. - * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator + * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cacheTagsInvalidator * The cache tags invalidator. - * @param \Drupal\search\SearchTextProcessorInterface $text_processor + * @param \Drupal\search\SearchTextProcessorInterface $textProcessor * The text processor. - * @param \Drupal\Component\Datetime\TimeInterface|null $time + * @param \Drupal\Component\Datetime\TimeInterface $time * The time service */ public function __construct( - ConfigFactoryInterface $config_factory, - Connection $connection, - Connection $replica, - CacheTagsInvalidatorInterface $cache_tags_invalidator, - SearchTextProcessorInterface $text_processor, - protected ?TimeInterface $time = NULL, + protected ConfigFactoryInterface $configFactory, + protected Connection $connection, + protected Connection $replica, + protected CacheTagsInvalidatorInterface $cacheTagsInvalidator, + protected SearchTextProcessorInterface $textProcessor, + protected TimeInterface $time , ) { - $this->configFactory = $config_factory; - $this->connection = $connection; - $this->replica = $replica; - $this->cacheTagsInvalidator = $cache_tags_invalidator; - $this->textProcessor = $text_processor; - if (!$time) { - @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3387233', E_USER_DEPRECATED); - $this->time = \Drupal::service(TimeInterface::class); - } } /**