You are here

protected function ComposerPackage::requestPackage in Markdown 8.2

Retrieves the package JSON data.

Return value

array The package JSON data.

1 call to ComposerPackage::requestPackage()
ComposerPackage::getVersionUrl in src/Annotation/ComposerPackage.php
Retrieves the version as a URL.

File

src/Annotation/ComposerPackage.php, line 137

Class

ComposerPackage
Annotation for providing an installable library via Composer.

Namespace

Drupal\markdown\Annotation

Code

protected function requestPackage() {

  // When requesting package information, use the normal API URL which
  // includes a lot more metadata about the package. This, unfortunately,
  // cached and only refreshed once every 12 hours.
  $json = $this
    ->requestJson(sprintf('https://packagist.org/packages/%s.json', $this
    ->getId()));
  return !empty($json['package']) ? $json['package'] : [];
}