comparison core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children af1871eacc83
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
127 // Prepare (flatten) the SMACSS-categorized definitions. 127 // Prepare (flatten) the SMACSS-categorized definitions.
128 // @todo After Asset(ic) changes, retain the definitions as-is and 128 // @todo After Asset(ic) changes, retain the definitions as-is and
129 // properly resolve dependencies for all (css) libraries per category, 129 // properly resolve dependencies for all (css) libraries per category,
130 // and only once prior to rendering out an HTML page. 130 // and only once prior to rendering out an HTML page.
131 if ($type == 'css' && !empty($library[$type])) { 131 if ($type == 'css' && !empty($library[$type])) {
132 assert('\Drupal\Core\Asset\LibraryDiscoveryParser::validateCssLibrary($library[$type]) < 2', 'CSS files should be specified as key/value pairs, where the values are configuration options. See https://www.drupal.org/node/2274843.'); 132 assert(static::validateCssLibrary($library[$type]) < 2, 'CSS files should be specified as key/value pairs, where the values are configuration options. See https://www.drupal.org/node/2274843.');
133 assert('\Drupal\Core\Asset\LibraryDiscoveryParser::validateCssLibrary($library[$type]) === 0', 'CSS must be nested under a category. See https://www.drupal.org/node/2274843.'); 133 assert(static::validateCssLibrary($library[$type]) === 0, 'CSS must be nested under a category. See https://www.drupal.org/node/2274843.');
134 foreach ($library[$type] as $category => $files) { 134 foreach ($library[$type] as $category => $files) {
135 $category_weight = 'CSS_' . strtoupper($category); 135 $category_weight = 'CSS_' . strtoupper($category);
136 assert('defined($category_weight)', 'Invalid CSS category: ' . $category . '. See https://www.drupal.org/node/2274843.'); 136 assert(defined($category_weight), 'Invalid CSS category: ' . $category . '. See https://www.drupal.org/node/2274843.');
137 foreach ($files as $source => $options) { 137 foreach ($files as $source => $options) {
138 if (!isset($options['weight'])) { 138 if (!isset($options['weight'])) {
139 $options['weight'] = 0; 139 $options['weight'] = 0;
140 } 140 }
141 // Apply the corresponding weight defined by CSS_* constants. 141 // Apply the corresponding weight defined by CSS_* constants.