src/ThemeManager/ThemeCollection.php
public function separateInvalidItems(&$items)
    {
        foreach ($items as $key => $theme) {
            if ($theme instanceof Theme && $theme->hasError()) {
                $this->invalidThemes[] = $theme;
                unset($items[$key]);
            }
        }
        array_values(array_filter($items));

        return $this;
    }
public function separateInvalidItems(&$items)
    {
        foreach ($items as $key => $theme) {
            if ($theme instanceof Theme && $theme->hasError()) {
                $this->invalidThemes[] = $theme;
                unset($items[$key]);
            }
        }
        array_values(array_filter($items));

        return $this;
    }
@param $items

@return $this