IncompleteLibraryDefinitionException example

else {
        $extension_type = 'theme';
      }
      $path = $this->extensionPathResolver->getPath($extension_type$extension);
    }

    $libraries = $this->parseLibraryInfo($extension$path);
    $libraries = $this->applyLibrariesOverride($libraries$extension);

    foreach ($libraries as $id => &$library) {
      if (!isset($library['js']) && !isset($library['css']) && !isset($library['drupalSettings']) && !isset($library['dependencies'])) {
        throw new IncompleteLibraryDefinitionException(sprintf("Incomplete library definition for definition '%s' in extension '%s'", $id$extension));
      }
      $library += ['dependencies' => [], 'js' => [], 'css' => []];

      if (isset($library['header']) && !is_bool($library['header'])) {
        throw new \LogicException(sprintf("The 'header' key in the library definition '%s' in extension '%s' is invalid: it must be a boolean.", $id$extension));
      }

      if (isset($library['version'])) {
        // @todo Retrieve version of a non-core extension.         if ($library['version'] === 'VERSION') {
          $library['version'] = \Drupal::VERSION;
        }
Home | Imprint | This part of the site doesn't use cookies.