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

Breadcrumb

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

function Config::setCommandLineValues

Set the command line values.

Parameters

array $args An array of command line arguments to set.:

Return value

void

1 call to Config::setCommandLineValues()
Config::__construct in vendor/squizlabs/php_codesniffer/src/Config.php
Creates a Config object and populates it with command line values.

File

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

Class

Config
Stores the configuration used to run PHPCS and PHPCBF.

Namespace

PHP_CodeSniffer

Code

public function setCommandLineValues($args) {
    $this->cliArgs = $args;
    $numArgs = count($args);
    for ($i = 0; $i < $numArgs; $i++) {
        $arg = $this->cliArgs[$i];
        if ($arg === '') {
            continue;
        }
        if ($arg[0] === '-') {
            if ($arg === '-') {
                // Asking to read from STDIN.
                $this->stdin = true;
                self::$overriddenDefaults['stdin'] = true;
                continue;
            }
            if ($arg === '--') {
                // Empty argument, ignore it.
                continue;
            }
            if ($arg[1] === '-') {
                $this->processLongArgument(substr($arg, 2), $i);
            }
            else {
                $switches = str_split($arg);
                foreach ($switches as $switch) {
                    if ($switch === '-') {
                        continue;
                    }
                    $this->processShortArgument($switch, $i);
                }
            }
        }
        else {
            $this->processUnknownArgument($arg, $i);
        }
        
        //end if
    }
    
    //end for
}

API Navigation

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