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

Breadcrumb

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

function Config::printConfigData

Prints out the gathered config data.

Parameters

array $data The config data to print.:

Return value

void

1 call to Config::printConfigData()
Config::processLongArgument in vendor/squizlabs/php_codesniffer/src/Config.php
Processes a long (--example) command-line argument.

File

vendor/squizlabs/php_codesniffer/src/Config.php, line 1637

Class

Config
Stores the configuration used to run PHPCS and PHPCBF.

Namespace

PHP_CodeSniffer

Code

public function printConfigData($data) {
    $max = 0;
    $keys = array_keys($data);
    foreach ($keys as $key) {
        $len = strlen($key);
        if (strlen($key) > $max) {
            $max = $len;
        }
    }
    if ($max === 0) {
        return;
    }
    $max += 2;
    ksort($data);
    foreach ($data as $name => $value) {
        echo str_pad($name . ': ', $max) . $value . PHP_EOL;
    }
}

API Navigation

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