Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ArrayLoader.php

function ArrayLoader::load

@inheritDoc

Overrides LoaderInterface::load

2 calls to ArrayLoader::load()
RootPackageLoader::load in vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php
@inheritDoc
RootPackageLoader::load in vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php
@inheritDoc
1 method overrides ArrayLoader::load()
RootPackageLoader::load in vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php, line 49

Class

ArrayLoader
@author Konstantin Kudryashiv <ever.zet@gmail.com> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Package\Loader

Code

public function load(array $config, string $class = 'Composer\\Package\\CompletePackage') : BasePackage {
    if ($class !== 'Composer\\Package\\CompletePackage' && $class !== 'Composer\\Package\\RootPackage') {
        trigger_error('The $class arg is deprecated, please reach out to Composer maintainers ASAP if you still need this.', E_USER_DEPRECATED);
    }
    $package = $this->createObject($config, $class);
    foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
        if (!isset($config[$type]) || !is_array($config[$type])) {
            continue;
        }
        $method = 'set' . ucfirst($opts['method']);
        $package->{$method}($this->parseLinks($package->getName(), $package->getPrettyVersion(), $opts['method'], $config[$type]));
    }
    $package = $this->configureObject($package, $config);
    return $package;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal