You are here

public function BlazyManager::cleanUpBreakpoints in Blazy 8

Cleans up empty breakpoints.

Parameters

array $settings: The settings being modified.

2 calls to BlazyManager::cleanUpBreakpoints()
BlazyFormatterManager::buildSettings in src/BlazyFormatterManager.php
Returns the field formatter settings inherited by child elements.
BlazyManager::isBlazy in src/BlazyManager.php
Checks for Blazy formatter such as from within a Views style plugin.

File

src/BlazyManager.php, line 22

Class

BlazyManager
Implements a public facing blazy manager.

Namespace

Drupal\blazy

Code

public function cleanUpBreakpoints(array &$settings = []) {
  if (!empty($settings['breakpoints'])) {
    $breakpoints = array_filter(array_map('array_filter', $settings['breakpoints']));
    $settings['breakpoints'] = NestedArray::filter($breakpoints, function ($breakpoint) {
      return !(is_array($breakpoint) && (empty($breakpoint['width']) || empty($breakpoint['image_style'])));
    });
  }
}