From c36a97b62e49e608a00d717068ee78fba02fd89a Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Sun, 6 Mar 2022 22:28:58 -0500 Subject: [PATCH] Added PHP_Codesniffer to project to keep the code styles in check --- composer.json | 6 +++++ composer.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++++++-- phpcs.xml | 20 +++++++++++++++++ pigeon.php | 2 +- 4 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 phpcs.xml diff --git a/composer.json b/composer.json index 7fc3c7f..e17425c 100644 --- a/composer.json +++ b/composer.json @@ -14,5 +14,11 @@ "hassankhan/config": "^3.0", "madcoda/php-youtube-api": "^1.2", "team-reflex/discord-php": "^7.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.6" + }, + "scripts": { + "phpcs": "phpcs" } } diff --git a/composer.lock b/composer.lock index f521cab..8a8d822 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0e481dbc149344c9772f4f2b425d7739", + "content-hash": "8ba316fe7bd06a7e80b406cbe3263164", "packages": [ { "name": "discord-php/http", @@ -2804,7 +2804,64 @@ "time": "2016-01-13T22:50:58+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-12-12T21:44:58+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..81a9d8a --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,20 @@ + + + + +PHPCS configuration file. + + +pigeon.php + + + + + + + + + + + + diff --git a/pigeon.php b/pigeon.php index f200738..f925b72 100644 --- a/pigeon.php +++ b/pigeon.php @@ -1,6 +1,6 @@