protected function HelperTrait::composeStyles in Style Switcher 8.2
Same name and namespace in other branches
- 3.0.x tests/src/Functional/HelperTrait.php \Drupal\Tests\styleswitcher\Functional\HelperTrait::composeStyles()
Helps compose the Styles array.
Parameters
array $label_paths: Array with "label => path" associations.
string $type: (optional) Style type: "custom" or "theme".
Return value
array[] Styles list as in the config.
File
- tests/
src/ Functional/ HelperTrait.php, line 60
Class
- HelperTrait
- Provides helper methods for the Style Switcher testing.
Namespace
Drupal\Tests\styleswitcher\FunctionalCode
protected function composeStyles(array $label_paths, string $type = 'custom') : array {
$styles = [];
foreach ($label_paths as $label => $path) {
$name = $type . '/' . strtolower($label);
$styles[$name] = [
'name' => $name,
'label' => $label,
'path' => $path,
];
}
return $styles;
}