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

Breadcrumb

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

function Config::getAllConfigData

Get all config data.

Return value

array<string, string>

Throws

\PHP_CodeSniffer\Exceptions\DeepExitException If the config file could not be read.

See also

getConfigData()

4 calls to Config::getAllConfigData()
Cache::load in vendor/squizlabs/php_codesniffer/src/Util/Cache.php
Loads existing cache data for the run, if any.
Config::getConfigData in vendor/squizlabs/php_codesniffer/src/Config.php
Get a single config value.
Config::processLongArgument in vendor/squizlabs/php_codesniffer/src/Config.php
Processes a long (--example) command-line argument.
Config::setConfigData in vendor/squizlabs/php_codesniffer/src/Config.php
Set a single config value.

File

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

Class

Config
Stores the configuration used to run PHPCS and PHPCBF.

Namespace

PHP_CodeSniffer

Code

public static function getAllConfigData() {
    if (self::$configData !== null) {
        return self::$configData;
    }
    $path = '';
    if (is_callable('\\Phar::running') === true) {
        $path = Phar::running(false);
    }
    if ($path !== '') {
        $configFile = dirname($path) . DIRECTORY_SEPARATOR . 'CodeSniffer.conf';
    }
    else {
        $configFile = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'CodeSniffer.conf';
        if (is_file($configFile) === false && strpos('@data_dir@', '@data_dir') === false) {
            $configFile = '@data_dir@/PHP_CodeSniffer/CodeSniffer.conf';
        }
    }
    if (is_file($configFile) === false) {
        self::$configData = [];
        return [];
    }
    if (Common::isReadable($configFile) === false) {
        $error = 'ERROR: Config file ' . $configFile . ' is not readable' . PHP_EOL . PHP_EOL;
        throw new DeepExitException($error, 3);
    }
    include $configFile;
    self::$configDataFile = $configFile;
    self::$configData = $phpCodeSnifferConfig;
    return self::$configData;
}

API Navigation

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