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 <jrfnl@users.noreply.github.com>
This commit is contained in:
Juliette 2020-10-26 17:25:46 +01:00 committed by GitHub
parent ba88479850
commit 3cb2162859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 8 deletions

2
.gitattributes vendored
View File

@ -4,12 +4,12 @@
/.github export-ignore /.github export-ignore
/.gitignore export-ignore /.gitignore export-ignore
/.phan export-ignore /.phan export-ignore
/.php_cs export-ignore
/.scrutinizer.yml export-ignore /.scrutinizer.yml export-ignore
/.travis.yml export-ignore /.travis.yml export-ignore
/changelog.md export-ignore /changelog.md export-ignore
/docs export-ignore /docs export-ignore
/examples export-ignore /examples export-ignore
/phpcs.xml.dist export-ignore
/phpdoc.dist.xml export-ignore /phpdoc.dist.xml export-ignore
/test export-ignore /test export-ignore
/travis.phpunit.xml.dist export-ignore /travis.phpunit.xml.dist export-ignore

3
.gitignore vendored
View File

@ -6,3 +6,6 @@ build/
vendor/ vendor/
*.pem *.pem
composer.lock composer.lock
.phpcs.xml
phpcs.xml
.phpcs-cache

View File

@ -34,10 +34,10 @@
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.2", "doctrine/annotations": "^1.2",
"phpcompatibility/php-compatibility": "9.3.5", "phpcompatibility/php-compatibility": "^9.3.5",
"phpunit/phpunit": "^4.8 || ^5.7", "phpunit/phpunit": "^4.8 || ^5.7",
"roave/security-advisories": "dev-latest", "roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "3.5.6" "squizlabs/php_codesniffer": "^3.5.6"
}, },
"suggest": { "suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset", "ext-mbstring": "Needed to send email in multibyte encoding charset",

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer - PHP email creation and transport class. * PHPMailer - PHP email creation and transport class.
* PHP Version 5.5 * PHP Version 5.5
@ -16,6 +17,7 @@
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. * FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/** /**
* Get an OAuth2 token from an OAuth2 provider. * Get an OAuth2 token from an OAuth2 provider.
* * Install this script on your server so that it's accessible * * Install this script on your server so that it's accessible
@ -44,7 +46,7 @@ use Hayageek\OAuth2\Client\Provider\Yahoo;
use Stevenmaguire\OAuth2\Client\Provider\Microsoft; use Stevenmaguire\OAuth2\Client\Provider\Microsoft;
if (!isset($_GET['code']) && !isset($_GET['provider'])) { if (!isset($_GET['code']) && !isset($_GET['provider'])) {
?> ?>
<html> <html>
<body>Select Provider:<br/> <body>Select Provider:<br/>
<a href='?provider=Google'>Google</a><br/> <a href='?provider=Google'>Google</a><br/>
@ -52,8 +54,8 @@ if (!isset($_GET['code']) && !isset($_GET['provider'])) {
<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br/> <a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br/>
</body> </body>
</html> </html>
<?php <?php
exit; exit;
} }
require 'vendor/autoload.php'; require 'vendor/autoload.php';

View File

@ -5,7 +5,7 @@
* @package PHPMailer * @package PHPMailer
* @author Yash Karanke <mr.karanke@gmail.com> * @author Yash Karanke <mr.karanke@gmail.com>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; $PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; $PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';

View File

@ -5,7 +5,7 @@
* @package PHPMailer * @package PHPMailer
* @author Hrayr Grigoryan <hrayr@bits.am> * @author Hrayr Grigoryan <hrayr@bits.am>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; $PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.';
$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; $PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.';

View File

@ -12,6 +12,7 @@
<!-- Show progress --> <!-- Show progress -->
<arg value="p"/> <arg value="p"/>
<file>get_oauth_token.php</file>
<file>src</file> <file>src</file>
<file>test</file> <file>test</file>
<file>examples</file> <file>examples</file>