BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHP_CodeSniffer\Config Class Reference
Collaboration diagram for PHP_CodeSniffer\Config:

Public Member Functions

 __get ($name)
 
 __set ($name, $value)
 
 __isset ($name)
 
 __unset ($name)
 
 getSettings ()
 
 setSettings ($settings)
 
 __construct (array $cliArgs=array(), $dieOnUnknownArg=true)
 
 setCommandLineValues ($args)
 
 restoreDefaults ()
 
 processShortArgument ($arg, $pos)
 
 processLongArgument ($arg, $pos)
 
 processUnknownArgument ($arg, $pos)
 
 processFilePath ($path)
 
 printUsage ()
 
 printShortUsage ($return=false)
 
 printPHPCSUsage ()
 
 printPHPCBFUsage ()
 
 printConfigData ($data)
 

Static Public Member Functions

static getConfigData ($key)
 
static getExecutablePath ($name)
 
static setConfigData ($key, $value, $temp=false)
 
static getAllConfigData ()
 

Public Attributes

const VERSION = '3.1.1'
 
const STABILITY = 'stable'
 
 $dieOnUnknownArg
 

Constructor & Destructor Documentation

PHP_CodeSniffer\Config::__construct ( array  $cliArgs = array(),
  $dieOnUnknownArg = true 
)

Creates a Config object and populates it with command line values.

Parameters
array$cliArgsAn array of values gathered from CLI args.
bool$dieOnUnknownArgWhether or not to kill the process when an unknown command line arg is found.
Returns
void

Member Function Documentation

PHP_CodeSniffer\Config::__get (   $name)

Get the value of an inaccessible property.

Parameters
string$nameThe name of the property.
Returns
mixed
Exceptions
RuntimeExceptionIf the setting name is invalid.
PHP_CodeSniffer\Config::__isset (   $name)

Check if the value of an inaccessible property is set.

Parameters
string$nameThe name of the property.
Returns
bool
PHP_CodeSniffer\Config::__set (   $name,
  $value 
)

Set the value of an inaccessible property.

Parameters
string$nameThe name of the property.
mixed$valueThe value of the property.
Returns
void
Exceptions
RuntimeExceptionIf the setting name is invalid.
PHP_CodeSniffer\Config::__unset (   $name)

Unset the value of an inaccessible property.

Parameters
string$nameThe name of the property.
Returns
void
static PHP_CodeSniffer\Config::getAllConfigData ( )
static

Get all config data.

Returns
array<string, string>
See Also
getConfigData()
static PHP_CodeSniffer\Config::getConfigData (   $key)
static

Get a single config value.

Parameters
string$keyThe name of the config value.
Returns
string|null
See Also
setConfigData()
getAllConfigData()
static PHP_CodeSniffer\Config::getExecutablePath (   $name)
static

Get the path to an executable utility.

Parameters
string$nameThe name of the executable utility.
Returns
string|null
See Also
getConfigData()
PHP_CodeSniffer\Config::getSettings ( )

Get the array of all config settings.

Returns
array<string, mixed>
PHP_CodeSniffer\Config::printConfigData (   $data)

Prints out the gathered config data.

Parameters
array$dataThe config data to print.
Returns
void
PHP_CodeSniffer\Config::printPHPCBFUsage ( )

Prints out the usage information for PHPCBF.

Returns
void
PHP_CodeSniffer\Config::printPHPCSUsage ( )

Prints out the usage information for PHPCS.

Returns
void
PHP_CodeSniffer\Config::printShortUsage (   $return = false)

Prints out the short usage information for this script.

Parameters
bool$returnIf TRUE, the usage string is returned instead of output to screen.
Returns
string|void
PHP_CodeSniffer\Config::printUsage ( )

Prints out the usage information for this script.

Returns
void
PHP_CodeSniffer\Config::processFilePath (   $path)

Processes a file path and add it to the file list.

Parameters
string$pathThe path to the file to add.
Returns
void
PHP_CodeSniffer\Config::processLongArgument (   $arg,
  $pos 
)

Processes a long (–example) command line argument.

Parameters
string$argThe command line argument.
int$posThe position of the argument on the command line.
Returns
void
PHP_CodeSniffer\Config::processShortArgument (   $arg,
  $pos 
)

Processes a short (-e) command line argument.

Parameters
string$argThe command line argument.
int$posThe position of the argument on the command line.
Returns
void
PHP_CodeSniffer\Config::processUnknownArgument (   $arg,
  $pos 
)

Processes an unknown command line argument.

Assumes all unknown arguments are files and folders to check.

Parameters
string$argThe command line argument.
int$posThe position of the argument on the command line.
Returns
void
PHP_CodeSniffer\Config::restoreDefaults ( )

Restore default values for all possible command line arguments.

Returns
array
PHP_CodeSniffer\Config::setCommandLineValues (   $args)

Set the command line values.

Parameters
array$argsAn array of command line arguments to set.
Returns
void
static PHP_CodeSniffer\Config::setConfigData (   $key,
  $value,
  $temp = false 
)
static

Set a single config value.

Parameters
string$keyThe name of the config value.
string | null$valueThe value to set. If null, the config entry is deleted, reverting it to the default value.
boolean$tempSet this config data temporarily for this script run. This will not write the config data to the config file.
Returns
bool
See Also
getConfigData()
Exceptions
RuntimeExceptionIf the config file can not be written.
PHP_CodeSniffer\Config::setSettings (   $settings)

Set the array of all config settings.

Parameters
array<string,mixed>$settings The array of config settings.
Returns
void

The documentation for this class was generated from the following file: