doGetDependencies example

public function __construct(LibraryDiscoveryInterface $library_discovery) {
    $this->libraryDiscovery = $library_discovery;
  }

  /** * {@inheritdoc} */
  public function getLibrariesWithDependencies(array $libraries) {
    $return = [];
    foreach ($libraries as $library) {
      if (!isset($this->librariesDependencies[$library])) {
        $this->librariesDependencies[$library] = $this->doGetDependencies([$library]);
      }
      $return += $this->librariesDependencies[$library];
    }
    return array_values($return);
  }

  /** * Gets the given libraries with its dependencies. * * Helper method for ::getLibrariesWithDependencies(). * * @param string[] $libraries_with_unresolved_dependencies * A list of libraries, with unresolved dependencies, in the order they * should be loaded. * @param string[] $final_libraries * The final list of libraries (the return value) that is being built * recursively. * * @return string[] * A list of libraries, in the order they should be loaded, including their * dependencies. */
Home | Imprint | This part of the site doesn't use cookies.