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

Breadcrumb

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

function Config::restoreDefaults

Restore default values for all possible command line arguments.

Return value

void

1 call to Config::restoreDefaults()
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 512

Class

Config
Stores the configuration used to run PHPCS and PHPCBF.

Namespace

PHP_CodeSniffer

Code

public function restoreDefaults() {
    $this->files = [];
    $this->standards = [
        'PEAR',
    ];
    $this->verbosity = 0;
    $this->interactive = false;
    $this->cache = false;
    $this->cacheFile = null;
    $this->colors = false;
    $this->explain = false;
    $this->local = false;
    $this->showSources = false;
    $this->showProgress = false;
    $this->quiet = false;
    $this->annotations = true;
    $this->parallel = 1;
    $this->tabWidth = 0;
    $this->encoding = 'utf-8';
    $this->extensions = [
        'php' => 'PHP',
        'inc' => 'PHP',
        'js' => 'JS',
        'css' => 'CSS',
    ];
    $this->sniffs = [];
    $this->exclude = [];
    $this->ignored = [];
    $this->reportFile = null;
    $this->generator = null;
    $this->filter = null;
    $this->bootstrap = [];
    $this->basepath = null;
    $this->reports = [
        'full' => null,
    ];
    $this->reportWidth = 'auto';
    $this->errorSeverity = 5;
    $this->warningSeverity = 5;
    $this->recordErrors = true;
    $this->suffix = '';
    $this->stdin = false;
    $this->stdinContent = null;
    $this->stdinPath = null;
    $this->trackTime = false;
    $this->unknown = [];
    $standard = self::getConfigData('default_standard');
    if ($standard !== null) {
        $this->standards = explode(',', $standard);
    }
    $reportFormat = self::getConfigData('report_format');
    if ($reportFormat !== null) {
        $this->reports = [
            $reportFormat => null,
        ];
    }
    $tabWidth = self::getConfigData('tab_width');
    if ($tabWidth !== null) {
        $this->tabWidth = (int) $tabWidth;
    }
    $encoding = self::getConfigData('encoding');
    if ($encoding !== null) {
        $this->encoding = strtolower($encoding);
    }
    $severity = self::getConfigData('severity');
    if ($severity !== null) {
        $this->errorSeverity = (int) $severity;
        $this->warningSeverity = (int) $severity;
    }
    $severity = self::getConfigData('error_severity');
    if ($severity !== null) {
        $this->errorSeverity = (int) $severity;
    }
    $severity = self::getConfigData('warning_severity');
    if ($severity !== null) {
        $this->warningSeverity = (int) $severity;
    }
    $showWarnings = self::getConfigData('show_warnings');
    if ($showWarnings !== null) {
        $showWarnings = (bool) $showWarnings;
        if ($showWarnings === false) {
            $this->warningSeverity = 0;
        }
    }
    $reportWidth = self::getConfigData('report_width');
    if ($reportWidth !== null) {
        $this->reportWidth = $reportWidth;
    }
    $showProgress = self::getConfigData('show_progress');
    if ($showProgress !== null) {
        $this->showProgress = (bool) $showProgress;
    }
    $quiet = self::getConfigData('quiet');
    if ($quiet !== null) {
        $this->quiet = (bool) $quiet;
    }
    $colors = self::getConfigData('colors');
    if ($colors !== null) {
        $this->colors = (bool) $colors;
    }
    if (defined('PHP_CODESNIFFER_IN_TESTS') === false) {
        $cache = self::getConfigData('cache');
        if ($cache !== null) {
            $this->cache = (bool) $cache;
        }
        $parallel = self::getConfigData('parallel');
        if ($parallel !== null) {
            $this->parallel = max((int) $parallel, 1);
        }
    }
}

API Navigation

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