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

Breadcrumb

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

function ArrayDumper::dumpValues

Parameters

array<int|string, string> $keys:

array<string, mixed> $data:

Return value

array<string, mixed>

1 call to ArrayDumper::dumpValues()
ArrayDumper::dump in vendor/composer/composer/src/Composer/Package/Dumper/ArrayDumper.php

File

vendor/composer/composer/src/Composer/Package/Dumper/ArrayDumper.php, line 155

Class

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

Namespace

Composer\Package\Dumper

Code

private function dumpValues(PackageInterface $package, array $keys, array $data) : array {
    foreach ($keys as $method => $key) {
        if (is_numeric($method)) {
            $method = $key;
        }
        $getter = 'get' . ucfirst($method);
        $value = $package->{$getter}();
        if (null !== $value && !(\is_array($value) && 0 === \count($value))) {
            $data[$key] = $value;
        }
    }
    return $data;
}

API Navigation

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