From d577510355813b49f07f0e701911e64851e118a4 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 30 Apr 2020 00:07:01 +0100 Subject: [PATCH] Add phpcs References #4 --- .gitignore | 5 +++ composer.json | 1 + composer.lock | 119 ++++++++++++++++++++++++++++++++++++++++++++++++- phpcs.xml.dist | 19 ++++++++ symfony.lock | 15 +++++++ tests/.gitkeep | 0 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 phpcs.xml.dist create mode 100644 tests/.gitkeep diff --git a/.gitignore b/.gitignore index a67f91e..18e24c2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,8 @@ /var/ /vendor/ ###< symfony/framework-bundle ### + +###> squizlabs/php_codesniffer ### +/.phpcs-cache +/phpcs.xml +###< squizlabs/php_codesniffer ### diff --git a/composer.json b/composer.json index 780cae1..c2fa596 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "symfony/yaml": "5.0.*" }, "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", "symfony/maker-bundle": "^1.15" }, "config": { diff --git a/composer.lock b/composer.lock index f5997aa..8e38e08 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": "f4b5fb227f3c56e949f202aaa1cf8000", + "content-hash": "49a1e46ab9ff4cb058c8468e450f35b7", "packages": [ { "name": "doctrine/inflector", @@ -2722,6 +2722,72 @@ } ], "packages-dev": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.6.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/8001af8eb107fbfcedc31a8b51e20b07d85b457a", + "reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.3|^7", + "squizlabs/php_codesniffer": "^2|^3" + }, + "require-dev": { + "composer/composer": "*", + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2020-01-29T20:22:20+00:00" + }, { "name": "nikic/php-parser", "version": "v4.4.0", @@ -2774,6 +2840,57 @@ ], "time": "2020-04-10T16:34:50+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.5.5", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "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" + ], + "time": "2020-04-17T01:09:41+00:00" + }, { "name": "symfony/maker-bundle", "version": "v1.15.1", diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..89195e2 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,19 @@ + + + + + + + + + + + + bin/ + config/ + public/ + src/ + tests/ + + diff --git a/symfony.lock b/symfony.lock index eaa58e1..eac2155 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,7 @@ { + "dealerdirect/phpcodesniffer-composer-installer": { + "version": "v0.6.2" + }, "doctrine/inflector": { "version": "1.3.1" }, @@ -32,6 +35,18 @@ "psr/simple-cache": { "version": "1.0.1" }, + "squizlabs/php_codesniffer": { + "version": "3.0", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "master", + "version": "3.0", + "ref": "0dc9cceda799fd3a08b96987e176a261028a3709" + }, + "files": [ + "phpcs.xml.dist" + ] + }, "symfony/cache": { "version": "v5.0.8" }, diff --git a/tests/.gitkeep b/tests/.gitkeep new file mode 100644 index 0000000..e69de29