You are here

public function BlazyManagerBase::cleanUpBreakpoints in Blazy 7

To be deprecated method.

@todo deprecate for BlazyBreakpoint::cleanUpBreakpoints() at blazy:7.x-2.0.

2 calls to BlazyManagerBase::cleanUpBreakpoints()
BlazyFormatter::buildSettings in src/BlazyFormatter.php
BlazyManagerBase::isBlazy in src/BlazyManagerBase.php
Checks for Blazy formatter such as from within a Views style plugin.

File

src/BlazyManagerBase.php, line 339

Class

BlazyManagerBase
Implements BlazyManagerInterface.

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'])));
    });
  }
}