apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Config

Source Location: /PHP_CodeSniffer-3.1.1/src/Config.php

Class Overview


Stores the configuration used to run PHPCS and PHPCBF.


Author(s):

Copyright:

  • 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 18]
Stores the configuration used to run PHPCS and PHPCBF.

Parses the command line to determine user supplied values and provides functions to access data stored in config files.



[ Top ]


Class Variables

$dieOnUnknownArg =

[line 147]

Whether or not to kill the process when an unknown command line arg is found.

If FALSE, arguments that are not command line options or file/directory paths will be ignored and execution will continue. These values will be stored in $this->unknown.

  • Access: public

Type:   boolean


[ Top ]



Method Detail

__construct (Constructor)   [line 319]

void __construct( [array $cliArgs = array()], [bool $dieOnUnknownArg = true])

Creates a Config object and populates it with command line values.
  • Access: public

Parameters:

array   $cliArgs   —  An array of values gathered from CLI args.
bool   $dieOnUnknownArg   —  Whether or not to kill the process when an unknown command line arg is found.

[ Top ]

getAllConfigData   [line 1599]

array

Get all config data.
  • Return: string>
  • See: getConfigData()
  • Access: public

[ Top ]

getConfigData   [line 1457]

string|null getConfigData( string $key)

Get a single config value.
  • See: setConfigData()
  • See: getAllConfigData()
  • Access: public

Parameters:

string   $key   —  The name of the config value.

[ Top ]

getExecutablePath   [line 1482]

string|null getExecutablePath( string $name)

Get the path to an executable utility.
  • See: getConfigData()
  • Access: public

Parameters:

string   $name   —  The name of the executable utility.

[ Top ]

getSettings   [line 289]

array

Get the array of all config settings.
  • Return: mixed>
  • Access: public

[ Top ]

printConfigData   [line 1646]

void printConfigData( array $data)

Prints out the gathered config data.
  • Access: public

Parameters:

array   $data   —  The config data to print.

[ Top ]

printPHPCBFUsage   [line 1401]

void printPHPCBFUsage( )

Prints out the usage information for PHPCBF.
  • Access: public

[ Top ]

printPHPCSUsage   [line 1328]

void printPHPCSUsage( )

Prints out the usage information for PHPCS.
  • Access: public

[ Top ]

printShortUsage   [line 1304]

string|void printShortUsage( [bool $return = false])

Prints out the short usage information for this script.
  • Access: public

Parameters:

bool   $return   —  If TRUE, the usage string is returned instead of output to screen.

[ Top ]

printUsage   [line 1281]

void printUsage( )

Prints out the usage information for this script.
  • Access: public

[ Top ]

processFilePath   [line 1250]

void processFilePath( string $path)

Processes a file path and add it to the file list.
  • Access: public

Parameters:

string   $path   —  The path to the file to add.

[ Top ]

processLongArgument   [line 679]

void processLongArgument( string $arg, int $pos)

Processes a long (--example) command line argument.
  • Access: public

Parameters:

string   $arg   —  The command line argument.
int   $pos   —  The position of the argument on the command line.

[ Top ]

processShortArgument   [line 575]

void processShortArgument( string $arg, int $pos)

Processes a short (-e) command line argument.
  • Access: public

Parameters:

string   $arg   —  The command line argument.
int   $pos   —  The position of the argument on the command line.

[ Top ]

processUnknownArgument   [line 1225]

void processUnknownArgument( string $arg, int $pos)

Processes an unknown command line argument.

Assumes all unknown arguments are files and folders to check.

  • Access: public

Parameters:

string   $arg   —  The command line argument.
int   $pos   —  The position of the argument on the command line.

[ Top ]

restoreDefaults   [line 445]

array restoreDefaults( )

Restore default values for all possible command line arguments.
  • Access: public

[ Top ]

setCommandLineValues   [line 396]

void setCommandLineValues( array $args)

Set the command line values.
  • Access: public

Parameters:

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

[ Top ]

setConfigData   [line 1525]

bool setConfigData( string $key, string|null $value, [boolean $temp = false])

Set a single config value.
  • See: getConfigData()
  • Throws: RuntimeException If the config file can not be written.
  • Access: public

Parameters:

string   $key   —  The name of the config value.
string|null   $value   —  The value to set. If null, the config entry is deleted, reverting it to the default value.
boolean   $temp   —  Set this config data temporarily for this script run. This will not write the config data to the config file.

[ Top ]

setSettings   [line 303]

void setSettings( array

Set the array of all config settings.
  • Access: public

Parameters:

array $settings   —  mixed> $settings The array of config settings.

[ Top ]

__get   [line 193]

mixed __get( string $name)

Get the value of an inaccessible property.
  • Throws: RuntimeException If the setting name is invalid.
  • Access: public

Parameters:

string   $name   —  The name of the property.

[ Top ]

__isset   [line 263]

bool __isset( string $name)

Check if the value of an inaccessible property is set.
  • Access: public

Parameters:

string   $name   —  The name of the property.

[ Top ]

__set   [line 213]

void __set( string $name, mixed $value)

Set the value of an inaccessible property.
  • Throws: RuntimeException If the setting name is invalid.
  • Access: public

Parameters:

string   $name   —  The name of the property.
mixed   $value   —  The value of the property.

[ Top ]

__unset   [line 277]

void __unset( string $name)

Unset the value of an inaccessible property.
  • Access: public

Parameters:

string   $name   —  The name of the property.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:27:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.