diff --git a/core/lib/Drupal/Core/Theme/ActiveTheme.php b/core/lib/Drupal/Core/Theme/ActiveTheme.php index 30e70be..6950c76 100644 --- a/core/lib/Drupal/Core/Theme/ActiveTheme.php +++ b/core/lib/Drupal/Core/Theme/ActiveTheme.php @@ -224,6 +224,7 @@ public function getRegions() { * @endcode * * @return array + * The list of libraries-override. */ public function getLibrariesOverride() { return $this->librariesOverride; diff --git a/core/lib/Drupal/Core/Theme/ThemeInitialization.php b/core/lib/Drupal/Core/Theme/ThemeInitialization.php index f3ed6ef..52af336 100644 --- a/core/lib/Drupal/Core/Theme/ThemeInitialization.php +++ b/core/lib/Drupal/Core/Theme/ThemeInitialization.php @@ -268,6 +268,7 @@ protected function resolveStyleSheetPlaceholders($css_file) { * An array of base themes. * * @return string[] + * The list of stylesheets-remove specified in the *.info.yml file. * * @todo Remove in Drupal 9.0.x */ @@ -300,6 +301,9 @@ protected function prepareStylesheetsRemove(Extension $theme, $base_themes) { /** * Ensures that a full path is returned for an overriding theme asset. * + * If the specified $source is a library, then the $destination is returned + * without change. + * * @param \Drupal\Core\Extension\Extension $theme * The theme or base theme. * @param string $source @@ -308,6 +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. */ 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 dbd0b3e..49bf172 100644 --- a/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php +++ b/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php @@ -141,7 +141,7 @@ public function testLibrariesOverrideMalformedAsset() { } /** - * Tests library assets with edge-casey paths. + * Tests library assets with other ways for specifying paths. */ public function testLibrariesOverrideOtherAssetLibraryNames() { $this->container->get('theme_handler')->install(['test_theme']); @@ -161,7 +161,7 @@ public function testLibrariesOverrideOtherAssetLibraryNames() { $library = $library_discovery->getLibraryByName('core', 'drupal.dropbutton'); $this->assertAssetInLibrary($library['css'], 'drupal.dropbutton', 'themes/my_theme/css/dropbutton.css'); - // Assert streamwrappers. + // Assert streamwrapper paths. $library = $library_discovery->getLibraryByName('core', 'drupal.vertical-tabs'); $this->assertAssetInLibrary($library['css'], 'drupal.vertical-tabs', 'public://my_css/vertical-tabs.css'); @@ -213,6 +213,7 @@ public function testBaseThemeLibrariesOverrideInSubTheme() { * (optional) A message to display with the assertion. * * @return bool + * TRUE if the specified asset is found in the library. */ protected function assertAssetInLibrary($library_item, $library_name, $asset, $message = NULL) { if (!isset($message)) { @@ -239,6 +240,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. */ protected function assertNoAssetInLibrary($library_item, $library_name, $asset, $message = NULL) { if (!isset($message)) {