From 53b1cc06c39f633d191f518a59215252ec1acab0 Mon Sep 17 00:00:00 2001 From: Greg Sherwood Date: Fri, 31 Jan 2020 15:51:09 +1100 Subject: [PATCH] Change default standard from PEAR to PSR12 Co-authored-by: jrfnl --- CodeSniffer.conf.dist | 2 +- README.md | 6 +++--- src/Config.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CodeSniffer.conf.dist b/CodeSniffer.conf.dist index f95058faa7..ed6b7b964c 100644 --- a/CodeSniffer.conf.dist +++ b/CodeSniffer.conf.dist @@ -1,6 +1,6 @@ 'PSR2', + 'default_standard' => 'PSR12', 'report_format' => 'summary', 'show_warnings' => '0', 'show_progress' => '1', diff --git a/README.md b/README.md index ec500d8575..c59e1ae22e 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ php bin/phpcbf -h ## Getting Started -The default coding standard used by PHP_CodeSniffer is the PEAR coding standard. To check a file against the PEAR coding standard, simply specify the file's location: +The default coding standard used by PHP_CodeSniffer is the PSR12 coding standard. To check a file against the PSR12 coding standard, simply specify the file's location: ```bash phpcs /path/to/code/myfile.php ``` @@ -106,9 +106,9 @@ Or if you wish to check an entire directory you can specify the directory locati ```bash phpcs /path/to/code-directory ``` -If you wish to check your code against the PSR-12 coding standard, use the `--standard` command line argument: +If you wish to check your code against the PEAR coding standard, use the `--standard` command line argument: ```bash -phpcs --standard=PSR12 /path/to/code-directory +phpcs --standard=PEAR /path/to/code-directory ``` If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command. diff --git a/src/Config.php b/src/Config.php index 3ae1f78a9b..68e125b5d1 100644 --- a/src/Config.php +++ b/src/Config.php @@ -530,7 +530,7 @@ public function setCommandLineValues($args) public function restoreDefaults() { $this->files = []; - $this->standards = ['PEAR']; + $this->standards = ['PSR12']; $this->verbosity = 0; $this->interactive = false; $this->cache = false;