From 3cb21628596ef58552e0fe8f336e09ca331ba636 Mon Sep 17 00:00:00 2001 From: Juliette <663378+jrfnl@users.noreply.github.com> Date: Mon, 26 Oct 2020 17:25:46 +0100 Subject: [PATCH] Improve PHPCS config (#2182) * PHPCS: rename config file ... to `phpcs.xml.dist` to allow devs to locally overload the file by using a `.phpcs.xml` or `phpcs.xml` file, to, for instance, test out some new rules. Includes: * Adding the local overload files to `.gitignore`. * Adding the standard config file to `.gitattributes`. * PHPCS: scan missing file The `get_oauth_token.php` file in the project root seems to have been overlooked when configuring the PHPCS ruleset. Fixed now by adding it to the file to be scanned. Includes minor fixes to make the file comply with the configured standard. * CS: fix two files Two minor CS fixes. * PHPCS: miscellaneous changes * Don't fix the PHPCS/external standards version restraints. * Add the PHPCS cache file to `.gitignore`. * Removing the no longer existent `.php_cs` file from `.gitattributes`. Co-authored-by: jrfnl --- .gitattributes | 2 +- .gitignore | 3 +++ composer.json | 4 ++-- get_oauth_token.php | 8 +++++--- language/phpmailer.lang-hi.php | 2 +- language/phpmailer.lang-hy.php | 2 +- phpcs.xml => phpcs.xml.dist | 1 + 7 files changed, 14 insertions(+), 8 deletions(-) rename phpcs.xml => phpcs.xml.dist (97%) diff --git a/.gitattributes b/.gitattributes index 32598106..cb436596 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,12 +4,12 @@ /.github export-ignore /.gitignore export-ignore /.phan export-ignore -/.php_cs export-ignore /.scrutinizer.yml export-ignore /.travis.yml export-ignore /changelog.md export-ignore /docs export-ignore /examples export-ignore +/phpcs.xml.dist export-ignore /phpdoc.dist.xml export-ignore /test export-ignore /travis.phpunit.xml.dist export-ignore diff --git a/.gitignore b/.gitignore index 4719a995..792a46b9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ build/ vendor/ *.pem composer.lock +.phpcs.xml +phpcs.xml +.phpcs-cache diff --git a/composer.json b/composer.json index 58e2b5e7..d3b209cf 100644 --- a/composer.json +++ b/composer.json @@ -34,10 +34,10 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", - "phpcompatibility/php-compatibility": "9.3.5", + "phpcompatibility/php-compatibility": "^9.3.5", "phpunit/phpunit": "^4.8 || ^5.7", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "3.5.6" + "squizlabs/php_codesniffer": "^3.5.6" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset", diff --git a/get_oauth_token.php b/get_oauth_token.php index 8335883a..560d3645 100644 --- a/get_oauth_token.php +++ b/get_oauth_token.php @@ -1,4 +1,5 @@ + ?> Select Provider:
Google
@@ -52,8 +54,8 @@ if (!isset($_GET['code']) && !isset($_GET['provider'])) { Microsoft/Outlook/Hotmail/Live/Office365
- */ - + $PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; $PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; diff --git a/language/phpmailer.lang-hy.php b/language/phpmailer.lang-hy.php index 73429385..bb05d2d9 100644 --- a/language/phpmailer.lang-hy.php +++ b/language/phpmailer.lang-hy.php @@ -5,7 +5,7 @@ * @package PHPMailer * @author Hrayr Grigoryan */ - + $PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; $PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; diff --git a/phpcs.xml b/phpcs.xml.dist similarity index 97% rename from phpcs.xml rename to phpcs.xml.dist index bc31abf6..370b9212 100644 --- a/phpcs.xml +++ b/phpcs.xml.dist @@ -12,6 +12,7 @@ + get_oauth_token.php src test examples