diff --git a/core/lib/Drupal/Core/Asset/AssetResolver.php b/core/lib/Drupal/Core/Asset/AssetResolver.php index 89408c9..b526d88 100644 --- a/core/lib/Drupal/Core/Asset/AssetResolver.php +++ b/core/lib/Drupal/Core/Asset/AssetResolver.php @@ -138,7 +138,7 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) { uasort($css, 'static::sort'); // Allow themes to remove CSS files by CSS files full path and file name. - // @todo Remove in Drupal 9.0.x + // @todo Remove in Drupal 9.0.x. if ($stylesheet_remove = $theme_info->getStyleSheetsRemove()) { foreach ($css as $key => $options) { if (isset($stylesheet_remove[$key])) { diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php index 61804e2..b861ec6 100644 --- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php +++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Asset; -use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Asset\Exception\IncompleteLibraryDefinitionException; use Drupal\Core\Asset\Exception\InvalidLibraryFileException; use Drupal\Core\Asset\Exception\LibraryDefinitionMissingLicenseException; @@ -353,7 +352,7 @@ protected function applyLibrariesOverride($libraries, $extension) { $libraries[$name]['override'] = FALSE; } } - else if (strpos($asset, "$extension/$name/") !== FALSE) { + elseif (strpos($asset, "$extension/$name/") !== FALSE) { // Active theme defines an override for an asset within this library. // Throw an exception if the asset is not properly specified. if (substr_count($asset, '/') < 3) { @@ -364,7 +363,7 @@ protected function applyLibrariesOverride($libraries, $extension) { // drupalSettings may not be overridden. throw new \LogicException(sprintf('drupalSettings may not be overridden in libraries-override. Trying to override %s. Use hook_library_info_alter() instead.', $asset)); } - else if ($sub_key === 'css') { + elseif ($sub_key === 'css') { // SMACSS category should be incorporated into the asset name. list($category, $value) = explode('/', $value, 2); $parents = [$sub_key, $category, $value]; diff --git a/core/lib/Drupal/Core/Theme/ThemeInitialization.php b/core/lib/Drupal/Core/Theme/ThemeInitialization.php index 52af336..84f3929 100644 --- a/core/lib/Drupal/Core/Theme/ThemeInitialization.php +++ b/core/lib/Drupal/Core/Theme/ThemeInitialization.php @@ -161,7 +161,7 @@ public function getActiveTheme(Extension $theme, array $base_themes = []) { $values['path'] = $theme_path; $values['name'] = $theme->getName(); - // @todo Remove in Drupal 9.0.x + // @todo Remove in Drupal 9.0.x. $values['stylesheets_remove'] = $this->prepareStylesheetsRemove($theme, $base_themes); // Prepare libraries overrides from this theme and ancestor themes. @@ -242,7 +242,7 @@ protected function getExtensions() { * @return string * CSS file where placeholders are replaced. * - * @todo Remove in Drupal 9.0.x + * @todo Remove in Drupal 9.0.x. */ protected function resolveStyleSheetPlaceholders($css_file) { $token_candidate = explode('/', $css_file)[0]; @@ -270,7 +270,7 @@ protected function resolveStyleSheetPlaceholders($css_file) { * @return string[] * The list of stylesheets-remove specified in the *.info.yml file. * - * @todo Remove in Drupal 9.0.x + * @todo Remove in Drupal 9.0.x. */ protected function prepareStylesheetsRemove(Extension $theme, $base_themes) { // Prepare stylesheets from this theme as well as all ancestor themes. @@ -312,7 +312,7 @@ protected function prepareStylesheetsRemove(Extension $theme, $base_themes) { * The library or library asset replacing the source. * * @return string - * A fully resolved theme asset path relative to the drupal directory. + * A fully resolved theme asset path relative to the Drupal directory. */ protected function resolveThemeAssetPath(Extension $theme, $source, $destination) { // Full library definitions don't need to be resolved. diff --git a/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php b/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php index 49bf172..e29508c 100644 --- a/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php +++ b/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php @@ -7,9 +7,6 @@ namespace Drupal\system\Tests\Asset; -use Drupal\Component\Utility\SafeMarkup; -use Drupal\Core\Extension\Extension; -use Drupal\Core\Theme\ActiveTheme; use Drupal\simpletest\KernelTestBase; /** @@ -201,19 +198,19 @@ public function testBaseThemeLibrariesOverrideInSubTheme() { } /** - * Asserts that the given asset is in library. + * Asserts that the given asset is in the specified library. * * @param mixed $library_item - * The library where given asset should be. + * The library where the given asset should be found. * @param string $library_name * Name of the library. * @param string $asset * The asset file with the path for the file. * @param string $message - * (optional) A message to display with the assertion. + * (optional) A message to display with the assertion. * * @return bool - * TRUE if the specified asset is found in the library. + * TRUE if the specified asset is found in the library. */ protected function assertAssetInLibrary($library_item, $library_name, $asset, $message = NULL) { if (!isset($message)) { @@ -228,10 +225,10 @@ protected function assertAssetInLibrary($library_item, $library_name, $asset, $m } /** - * Asserts that the given asset is not in library. + * Asserts that the given asset is not in the specified library. * * @param mixed $library_item - * The library where given asset should not be. + * The library where the given asset should not be found. * @param string $library_name * Name of the library. * @param string $asset @@ -240,7 +237,7 @@ protected function assertAssetInLibrary($library_item, $library_name, $asset, $m * (optional) A message to display with the assertion. * * @return bool - * TRUE if the specified asset is not found in the library. + * TRUE if the specified asset is not found in the library. */ protected function assertNoAssetInLibrary($library_item, $library_name, $asset, $message = NULL) { if (!isset($message)) { diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php index 56a9e96..ffb2998 100644 --- a/core/modules/system/src/Tests/Theme/ThemeTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeTest.php @@ -167,8 +167,7 @@ function testCSSOverride() { $config->set('css.preprocess', 0); $config->save(); $this->drupalGet('theme-test/suggestion'); - $this->assertNoText('system.module.css', "The theme's .info.yml file is able to remove a module CSS file from being added to the page using libraries-override."); - $this->assertNoText('system.theme.css', "The theme's .info.yml file is able to remove a module CSS file from being added to the pagei using stylesheets-remove."); + $this->assertNoText('system.module.css', "The theme's .info.yml file is able to remove a module CSS file from being added to the page."); // Also test with aggregation enabled, simply ensuring no PHP errors are // triggered during drupal_build_css_cache() when a source file doesn't diff --git a/core/modules/system/tests/themes/test_theme/css/collapse.css b/core/modules/system/tests/themes/test_theme/css/collapse.css index c781141..23f38b3 100644 --- a/core/modules/system/tests/themes/test_theme/css/collapse.css +++ b/core/modules/system/tests/themes/test_theme/css/collapse.css @@ -1,4 +1,4 @@ /** * @file - * Test CSS asset file for test_theme.theme + * Test CSS asset file for test_theme.theme. */ diff --git a/core/modules/system/tests/themes/test_theme/js/collapse.js b/core/modules/system/tests/themes/test_theme/js/collapse.js index bfb509c..4d66841 100644 --- a/core/modules/system/tests/themes/test_theme/js/collapse.js +++ b/core/modules/system/tests/themes/test_theme/js/collapse.js @@ -1,4 +1,4 @@ /** * @file - * Test JS asset file for test_theme.theme + * Test JS asset file for test_theme.theme. */ diff --git a/core/modules/system/tests/themes/test_theme/test_theme.info.yml b/core/modules/system/tests/themes/test_theme/test_theme.info.yml index c9a52ae..40a52a9 100644 --- a/core/modules/system/tests/themes/test_theme/test_theme.info.yml +++ b/core/modules/system/tests/themes/test_theme/test_theme.info.yml @@ -15,7 +15,7 @@ version: VERSION base theme: classy core: 8.x stylesheets-remove: - - '@system/css/system.theme.css' + - '@system/css/system.module.css' libraries: - test_theme/global-styling libraries-override: