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

Breadcrumb

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

function HomeCommand::handlePackage

1 call to HomeCommand::handlePackage()
HomeCommand::execute in vendor/composer/composer/src/Composer/Command/HomeCommand.php
Executes the current command.

File

vendor/composer/composer/src/Composer/Command/HomeCommand.php, line 99

Class

HomeCommand
@author Robert Schönthal <seroscho@googlemail.com>

Namespace

Composer\Command

Code

private function handlePackage(CompletePackageInterface $package, bool $showHomepage, bool $showOnly) : bool {
    $support = $package->getSupport();
    $url = $support['source'] ?? $package->getSourceUrl();
    if (!$url || $showHomepage) {
        $url = $package->getHomepage();
    }
    if (!$url || !filter_var($url, FILTER_VALIDATE_URL)) {
        return false;
    }
    if ($showOnly) {
        $this->getIO()
            ->write(sprintf('<info>%s</info>', $url));
    }
    else {
        $this->openBrowser($url);
    }
    return true;
}

API Navigation

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