diff --git a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php index f8a23f2c4e..9d227f99d5 100644 --- a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php +++ b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php @@ -49,6 +49,8 @@ public function render(array $css_assets) { foreach ($css_assets as $css_asset) { $element = $link_element_defaults; + // @todo the emptiness check below is needed to get tests pass on + // PHP 7.4. Needs better solution. if (empty($css_asset)) { throw new \Exception('Invalid CSS asset type.'); } diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php index 1ffad3063c..97722549be 100644 --- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php +++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php @@ -117,7 +117,7 @@ public function buildByExtension($extension) { $library['version'] = \Drupal::VERSION; } // Remove 'v' prefix from external library versions. - elseif (((string) $library['version'])[0] === 'v') { + elseif (is_string($library['version']) && $library['version'][0] === 'v') { $library['version'] = substr($library['version'], 1); } } diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index 528c979e6c..d63a05e8da 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -243,6 +243,8 @@ public function getFormOptions(array $database) { ]; global $install_state; + // @todo the use of the coalesce operator below is needed to get + // migrate_drupal_ui tests pass on PHP 7.4. $profile = $install_state['parameters']['profile'] ?? NULL; $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_'; $form['advanced_options']['prefix'] = [ diff --git a/core/lib/Drupal/Core/Field/FieldTypePluginManager.php b/core/lib/Drupal/Core/Field/FieldTypePluginManager.php index 40817d28b5..058a28febd 100644 --- a/core/lib/Drupal/Core/Field/FieldTypePluginManager.php +++ b/core/lib/Drupal/Core/Field/FieldTypePluginManager.php @@ -168,6 +168,9 @@ public function getPreconfiguredOptions($field_type) { */ public function getPluginClass($type) { $plugin_definition = $this->getDefinition($type, FALSE); + // @todo the use of the coalesce operator below is needed to get + // Drupal\KernelTests\Core\Field\FieldMissingTypeTest tests pass on + // PHP 7.4. return $plugin_definition['class'] ?? NULL; } diff --git a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php index 74340884d2..85131ab8fa 100644 --- a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php +++ b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php @@ -181,6 +181,8 @@ public function prepareRow(Row $row) { } $field_data = unserialize($row->getSourceProperty('field_data')); + // @todo the use of the coalesce operator below is needed to get + // migrate tests pass on PHP 7.4. $row->setSourceProperty('field_settings', $field_data['settings']); return parent::prepareRow($row); diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 6260856bef..7bfce52add 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -385,6 +385,8 @@ function locale_translate_batch_finished($success, array $results) { // file), simply do nothing. if ($results && isset($results['stats'])) { foreach ($results['stats'] as $filepath => $report) { + // @todo is_array check below is needed to get locale tests pass on + // PHP 7.4. if (is_array($report)) { $additions += $report['additions']; $updates += $report['updates']; diff --git a/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php index 844fb858b5..d1807acad1 100644 --- a/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php +++ b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php @@ -70,6 +70,8 @@ public function prepareRow(Row $row) { $query->condition('lt.language', $language); $query->addField('lt', 'translation'); $results = $query->execute()->fetchAssoc(); + // @todo the use of the coalesce operator below is needed to get + // migrate tests pass on PHP 7.4. $row->setSourceProperty($other_property . '_translated', $results['translation']); parent::prepareRow($row);