You are here

private function SlickSkinManager::buildSkins in Slick Carousel 8.2

Collects defined skins as registered via hook_MODULE_NAME_skins_info().

This deprecated is adopted from BlazyManager to allow its removal anytime.

@todo deprecate and remove at slick:3.x+.

See also

https://www.drupal.org/node/2233261

https://www.drupal.org/node/3105670

1 call to SlickSkinManager::buildSkins()
SlickSkinManager::getSkins in src/SlickSkinManager.php
Returns slick skins registered via SlickSkin plugin and or defaults.

File

src/SlickSkinManager.php, line 451

Class

SlickSkinManager
Provides Slick skin manager.

Namespace

Drupal\slick

Code

private function buildSkins(array $methods = []) {
  $skin_class = '\\Drupal\\slick\\SlickSkin';
  $classes = $this->moduleHandler
    ->invokeAll('slick_skins_info');
  $classes = array_merge([
    $skin_class,
  ], $classes);
  $items = $skins = [];
  foreach ($classes as $class) {
    if (class_exists($class)) {
      $reflection = new \ReflectionClass($class);
      if ($reflection
        ->implementsInterface($skin_class . 'Interface')) {
        $skin = new $class();
        foreach ($methods as $method) {
          $items[$method] = method_exists($skin, $method) ? $skin
            ->{$method}() : [];
        }
      }
    }
    $skins = NestedArray::mergeDeep($skins, $items);
  }
  return $skins;
}