comparison vendor/squizlabs/php_codesniffer/src/Config.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
21 /** 21 /**
22 * The current version. 22 * The current version.
23 * 23 *
24 * @var string 24 * @var string
25 */ 25 */
26 const VERSION = '3.4.0'; 26 const VERSION = '3.4.2';
27 27
28 /** 28 /**
29 * Package stability; either stable, beta or alpha. 29 * Package stability; either stable, beta or alpha.
30 * 30 *
31 * @var string 31 * @var string
186 * Get the value of an inaccessible property. 186 * Get the value of an inaccessible property.
187 * 187 *
188 * @param string $name The name of the property. 188 * @param string $name The name of the property.
189 * 189 *
190 * @return mixed 190 * @return mixed
191 * @throws RuntimeException If the setting name is invalid. 191 * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid.
192 */ 192 */
193 public function __get($name) 193 public function __get($name)
194 { 194 {
195 if (array_key_exists($name, $this->settings) === false) { 195 if (array_key_exists($name, $this->settings) === false) {
196 throw new RuntimeException("ERROR: unable to get value of property \"$name\""); 196 throw new RuntimeException("ERROR: unable to get value of property \"$name\"");
206 * 206 *
207 * @param string $name The name of the property. 207 * @param string $name The name of the property.
208 * @param mixed $value The value of the property. 208 * @param mixed $value The value of the property.
209 * 209 *
210 * @return void 210 * @return void
211 * @throws RuntimeException If the setting name is invalid. 211 * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid.
212 */ 212 */
213 public function __set($name, $value) 213 public function __set($name, $value)
214 { 214 {
215 if (array_key_exists($name, $this->settings) === false) { 215 if (array_key_exists($name, $this->settings) === false) {
216 throw new RuntimeException("Can't __set() $name; setting doesn't exist"); 216 throw new RuntimeException("Can't __set() $name; setting doesn't exist");
1364 echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL; 1364 echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL;
1365 echo ' [--runtime-set key value] [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL; 1365 echo ' [--runtime-set key value] [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL;
1366 echo ' [--standard=<standard>] [--sniffs=<sniffs>] [--exclude=<sniffs>]'.PHP_EOL; 1366 echo ' [--standard=<standard>] [--sniffs=<sniffs>] [--exclude=<sniffs>]'.PHP_EOL;
1367 echo ' [--encoding=<encoding>] [--parallel=<processes>] [--generator=<generator>]'.PHP_EOL; 1367 echo ' [--encoding=<encoding>] [--parallel=<processes>] [--generator=<generator>]'.PHP_EOL;
1368 echo ' [--extensions=<extensions>] [--ignore=<patterns>] [--ignore-annotations]'.PHP_EOL; 1368 echo ' [--extensions=<extensions>] [--ignore=<patterns>] [--ignore-annotations]'.PHP_EOL;
1369 echo ' [--stdin-path=<stdinPath>] [--file-list=<fileList>] <file> - ...'.PHP_EOL; 1369 echo ' [--stdin-path=<stdinPath>] [--file-list=<fileList>] [--filter=<filter>] <file> - ...'.PHP_EOL;
1370 echo PHP_EOL; 1370 echo PHP_EOL;
1371 echo ' - Check STDIN instead of local files and directories'.PHP_EOL; 1371 echo ' - Check STDIN instead of local files and directories'.PHP_EOL;
1372 echo ' -n Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL; 1372 echo ' -n Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL;
1373 echo ' -w Print both warnings and errors (this is the default)'.PHP_EOL; 1373 echo ' -w Print both warnings and errors (this is the default)'.PHP_EOL;
1374 echo ' -l Local directory only, no recursion'.PHP_EOL; 1374 echo ' -l Local directory only, no recursion'.PHP_EOL;
1394 echo ' --ignore-annotations Ignore all phpcs: annotations in code comments'.PHP_EOL; 1394 echo ' --ignore-annotations Ignore all phpcs: annotations in code comments'.PHP_EOL;
1395 echo PHP_EOL; 1395 echo PHP_EOL;
1396 echo ' <cacheFile> Use a specific file for caching (uses a temporary file by default)'.PHP_EOL; 1396 echo ' <cacheFile> Use a specific file for caching (uses a temporary file by default)'.PHP_EOL;
1397 echo ' <basepath> A path to strip from the front of file paths inside reports'.PHP_EOL; 1397 echo ' <basepath> A path to strip from the front of file paths inside reports'.PHP_EOL;
1398 echo ' <bootstrap> A comma separated list of files to run before processing begins'.PHP_EOL; 1398 echo ' <bootstrap> A comma separated list of files to run before processing begins'.PHP_EOL;
1399 echo ' <file> One or more files and/or directories to check'.PHP_EOL;
1400 echo ' <fileList> A file containing a list of files and/or directories to check (one per line)'.PHP_EOL;
1401 echo ' <encoding> The encoding of the files being checked (default is utf-8)'.PHP_EOL; 1399 echo ' <encoding> The encoding of the files being checked (default is utf-8)'.PHP_EOL;
1402 echo ' <extensions> A comma separated list of file extensions to check'.PHP_EOL; 1400 echo ' <extensions> A comma separated list of file extensions to check'.PHP_EOL;
1403 echo ' The type of the file can be specified using: ext/type'.PHP_EOL; 1401 echo ' The type of the file can be specified using: ext/type'.PHP_EOL;
1404 echo ' e.g., module/php,es/js'.PHP_EOL; 1402 echo ' e.g., module/php,es/js'.PHP_EOL;
1403 echo ' <file> One or more files and/or directories to check'.PHP_EOL;
1404 echo ' <fileList> A file containing a list of files and/or directories to check (one per line)'.PHP_EOL;
1405 echo ' <filter> Use the "gitmodified" filter, or specify the path to a custom filter class'.PHP_EOL;
1405 echo ' <generator> Uses either the "HTML", "Markdown" or "Text" generator'.PHP_EOL; 1406 echo ' <generator> Uses either the "HTML", "Markdown" or "Text" generator'.PHP_EOL;
1406 echo ' (forces documentation generation instead of checking)'.PHP_EOL; 1407 echo ' (forces documentation generation instead of checking)'.PHP_EOL;
1407 echo ' <patterns> A comma separated list of patterns to ignore files and directories'.PHP_EOL; 1408 echo ' <patterns> A comma separated list of patterns to ignore files and directories'.PHP_EOL;
1408 echo ' <processes> How many files should be checked simultaneously (default is 1)'.PHP_EOL; 1409 echo ' <processes> How many files should be checked simultaneously (default is 1)'.PHP_EOL;
1409 echo ' <report> Print either the "full", "xml", "checkstyle", "csv"'.PHP_EOL; 1410 echo ' <report> Print either the "full", "xml", "checkstyle", "csv"'.PHP_EOL;
1410 echo ' "json", "junit", "emacs", "source", "summary", "diff"'.PHP_EOL; 1411 echo ' "json", "junit", "emacs", "source", "summary", "diff"'.PHP_EOL;
1411 echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report'.PHP_EOL; 1412 echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report,'.PHP_EOL;
1413 echo ' or specify the path to a custom report class'.PHP_EOL;
1412 echo ' (the "full" report is printed by default)'.PHP_EOL; 1414 echo ' (the "full" report is printed by default)'.PHP_EOL;
1413 echo ' <reportFile> Write the report to the specified file path'.PHP_EOL; 1415 echo ' <reportFile> Write the report to the specified file path'.PHP_EOL;
1414 echo ' <reportWidth> How many columns wide screen reports should be printed'.PHP_EOL; 1416 echo ' <reportWidth> How many columns wide screen reports should be printed'.PHP_EOL;
1415 echo ' or set to "auto" to use current screen width, where supported'.PHP_EOL; 1417 echo ' or set to "auto" to use current screen width, where supported'.PHP_EOL;
1416 echo ' <severity> The minimum severity required to display an error or warning'.PHP_EOL; 1418 echo ' <severity> The minimum severity required to display an error or warning'.PHP_EOL;
1433 echo 'Usage: phpcbf [-nwli] [-d key[=value]] [--ignore-annotations] [--bootstrap=<bootstrap>]'.PHP_EOL; 1435 echo 'Usage: phpcbf [-nwli] [-d key[=value]] [--ignore-annotations] [--bootstrap=<bootstrap>]'.PHP_EOL;
1434 echo ' [--standard=<standard>] [--sniffs=<sniffs>] [--exclude=<sniffs>] [--suffix=<suffix>]'.PHP_EOL; 1436 echo ' [--standard=<standard>] [--sniffs=<sniffs>] [--exclude=<sniffs>] [--suffix=<suffix>]'.PHP_EOL;
1435 echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL; 1437 echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL;
1436 echo ' [--tab-width=<tabWidth>] [--encoding=<encoding>] [--parallel=<processes>]'.PHP_EOL; 1438 echo ' [--tab-width=<tabWidth>] [--encoding=<encoding>] [--parallel=<processes>]'.PHP_EOL;
1437 echo ' [--basepath=<basepath>] [--extensions=<extensions>] [--ignore=<patterns>]'.PHP_EOL; 1439 echo ' [--basepath=<basepath>] [--extensions=<extensions>] [--ignore=<patterns>]'.PHP_EOL;
1438 echo ' [--stdin-path=<stdinPath>] [--file-list=<fileList>] <file> - ...'.PHP_EOL; 1440 echo ' [--stdin-path=<stdinPath>] [--file-list=<fileList>] [--filter=<filter>] <file> - ...'.PHP_EOL;
1439 echo PHP_EOL; 1441 echo PHP_EOL;
1440 echo ' - Fix STDIN instead of local files and directories'.PHP_EOL; 1442 echo ' - Fix STDIN instead of local files and directories'.PHP_EOL;
1441 echo ' -n Do not fix warnings (shortcut for --warning-severity=0)'.PHP_EOL; 1443 echo ' -n Do not fix warnings (shortcut for --warning-severity=0)'.PHP_EOL;
1442 echo ' -w Fix both warnings and errors (on by default)'.PHP_EOL; 1444 echo ' -w Fix both warnings and errors (on by default)'.PHP_EOL;
1443 echo ' -l Local directory only, no recursion'.PHP_EOL; 1445 echo ' -l Local directory only, no recursion'.PHP_EOL;
1453 echo ' --version Print version information'.PHP_EOL; 1455 echo ' --version Print version information'.PHP_EOL;
1454 echo ' --ignore-annotations Ignore all phpcs: annotations in code comments'.PHP_EOL; 1456 echo ' --ignore-annotations Ignore all phpcs: annotations in code comments'.PHP_EOL;
1455 echo PHP_EOL; 1457 echo PHP_EOL;
1456 echo ' <basepath> A path to strip from the front of file paths inside reports'.PHP_EOL; 1458 echo ' <basepath> A path to strip from the front of file paths inside reports'.PHP_EOL;
1457 echo ' <bootstrap> A comma separated list of files to run before processing begins'.PHP_EOL; 1459 echo ' <bootstrap> A comma separated list of files to run before processing begins'.PHP_EOL;
1458 echo ' <file> One or more files and/or directories to fix'.PHP_EOL;
1459 echo ' <fileList> A file containing a list of files and/or directories to fix (one per line)'.PHP_EOL;
1460 echo ' <encoding> The encoding of the files being fixed (default is utf-8)'.PHP_EOL; 1460 echo ' <encoding> The encoding of the files being fixed (default is utf-8)'.PHP_EOL;
1461 echo ' <extensions> A comma separated list of file extensions to fix'.PHP_EOL; 1461 echo ' <extensions> A comma separated list of file extensions to fix'.PHP_EOL;
1462 echo ' The type of the file can be specified using: ext/type'.PHP_EOL; 1462 echo ' The type of the file can be specified using: ext/type'.PHP_EOL;
1463 echo ' e.g., module/php,es/js'.PHP_EOL; 1463 echo ' e.g., module/php,es/js'.PHP_EOL;
1464 echo ' <file> One or more files and/or directories to fix'.PHP_EOL;
1465 echo ' <fileList> A file containing a list of files and/or directories to fix (one per line)'.PHP_EOL;
1466 echo ' <filter> Use the "gitmodified" filter, or specify the path to a custom filter class'.PHP_EOL;
1464 echo ' <patterns> A comma separated list of patterns to ignore files and directories'.PHP_EOL; 1467 echo ' <patterns> A comma separated list of patterns to ignore files and directories'.PHP_EOL;
1465 echo ' <processes> How many files should be fixed simultaneously (default is 1)'.PHP_EOL; 1468 echo ' <processes> How many files should be fixed simultaneously (default is 1)'.PHP_EOL;
1466 echo ' <severity> The minimum severity required to fix an error or warning'.PHP_EOL; 1469 echo ' <severity> The minimum severity required to fix an error or warning'.PHP_EOL;
1467 echo ' <sniffs> A comma separated list of sniff codes to include or exclude from fixing'.PHP_EOL; 1470 echo ' <sniffs> A comma separated list of sniff codes to include or exclude from fixing'.PHP_EOL;
1468 echo ' (all sniffs must be part of the specified standard)'.PHP_EOL; 1471 echo ' (all sniffs must be part of the specified standard)'.PHP_EOL;
1553 * script run. This will not write the config 1556 * script run. This will not write the config
1554 * data to the config file. 1557 * data to the config file.
1555 * 1558 *
1556 * @return bool 1559 * @return bool
1557 * @see getConfigData() 1560 * @see getConfigData()
1558 * @throws RuntimeException If the config file can not be written. 1561 * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the config file can not be written.
1559 */ 1562 */
1560 public static function setConfigData($key, $value, $temp=false) 1563 public static function setConfigData($key, $value, $temp=false)
1561 { 1564 {
1562 if (isset(self::$overriddenDefaults['runtime-set']) === true 1565 if (isset(self::$overriddenDefaults['runtime-set']) === true
1563 && isset(self::$overriddenDefaults['runtime-set'][$key]) === true 1566 && isset(self::$overriddenDefaults['runtime-set'][$key]) === true