code: 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;
      }
docs: @param $items
  
  @return $this