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

Breadcrumb

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

function CheckPlatformReqsCommand::printTable

Parameters

mixed[] $results:

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

File

vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php, line 175

Class

CheckPlatformReqsCommand

Namespace

Composer\Command

Code

protected function printTable(OutputInterface $output, array $results, string $format) : void {
    $rows = [];
    foreach ($results as $result) {
        
        /**
         * @var Link|null $link
         */
        [
            $platformPackage,
            $version,
            $link,
            $status,
            $provider,
        ] = $result;
        if ('json' === $format) {
            $rows[] = [
                "name" => $platformPackage,
                "version" => $version,
                "status" => strip_tags($status),
                "failed_requirement" => $link instanceof Link ? [
                    'source' => $link->getSource(),
                    'type' => $link->getDescription(),
                    'target' => $link->getTarget(),
                    'constraint' => $link->getPrettyConstraint(),
                ] : null,
                "provider" => $provider === '' ? null : strip_tags($provider),
            ];
        }
        else {
            $rows[] = [
                $platformPackage,
                $version,
                $link,
                $link ? sprintf('%s %s %s (%s)', $link->getSource(), $link->getDescription(), $link->getTarget(), $link->getPrettyConstraint()) : '',
                rtrim($status . ' ' . $provider),
            ];
        }
    }
    if ('json' === $format) {
        $this->getIO()
            ->write(JsonFile::encode($rows));
    }
    else {
        $this->renderTable($rows, $output);
    }
}

API Navigation

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