From 6c14b522c768a1570798a8f5f86c7fa7d30bac04 Mon Sep 17 00:00:00 2001 From: sebastian kessler Date: Wed, 19 Jul 2023 17:24:58 +0200 Subject: [PATCH] Removed "binary" executable as this adds maintenance overhead (dependency to composer internals) while not giving enough benefits to justify the effort keeping this feature. --- README.md | 15 ++++----------- bin/php-code-validator | 18 ------------------ 2 files changed, 4 insertions(+), 29 deletions(-) delete mode 100755 bin/php-code-validator diff --git a/README.md b/README.md index 87ea657..15d3e93 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FLYERALARM PHP Coding Guideline Validator -This repository contains the ruleset for the PHP code we develop at [FLYERALARM](https://flyeralarm.com). +This repository contains the ruleset for the PHP code we develop at [FLYERALARM](https://flyeralarm.com). It mostly consists of PSR-12 with some custom additions. The rules are enforced with the help of squizlabs/PHP_CodeSniffer The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, @@ -63,13 +63,6 @@ test: vendor/bin/phpcs -w -p -s --standard=vendor/flyeralarm/php-code-validator/ruleset.xml src/ tests/ ``` -or in shorter version by using code validator binary which already use flyeralarm as default standard: -```make -test: - vendor/bin/php-code-validator src/ tests/ -``` - - ### Add project specific rules The recommended way to define custom rules for the own project is to provide a ```phpcs.xml``` in the root of your @@ -85,9 +78,9 @@ This ```phpcs.xml``` can then reference the FLYERALARM PHP coding standard. - + - + ``` @@ -113,7 +106,7 @@ make test ## Use within PHPStorm -1) Ensure the path to PHP Code Sniffer is configured - [open configuration manual](https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm#PHPCodeSnifferinPhpStorm-1.1.SpecifyingthepathtoPHPCodeSniffer) +1) Ensure the path to PHP Code Sniffer is configured - [open configuration manual](https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm#PHPCodeSnifferinPhpStorm-1.1.SpecifyingthepathtoPHPCodeSniffer) 2) Open settings: \ Mac: `PhpStorm` > `Preferences` > `Editor` > `Inspections` > `PHP` \ Windows & Linux: `File` > `Settings` > `Editor` > `Inspections` > `PHP` \ diff --git a/bin/php-code-validator b/bin/php-code-validator deleted file mode 100755 index 6ee724d..0000000 --- a/bin/php-code-validator +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env sh - -if [[ -z "$COMPOSER_RUNTIME_BIN_DIR" ]]; then - BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -else - BIN_DIR="$COMPOSER_RUNTIME_BIN_DIR" -fi - -# used within project -if [ -f ${BIN_DIR}/phpcs ]; then - SCRIPT_DIR=${BIN_DIR}/../flyeralarm/php-code-validator - COMPOSER_BIN=${BIN_DIR} -else # standalone - SCRIPT_DIR=${BIN_DIR}/.. - COMPOSER_BIN=${BIN_DIR}/../vendor/bin -fi - -php ${COMPOSER_BIN}/phpcs -w -p -s --standard=${SCRIPT_DIR}/ruleset.xml "$@"