From 0ed16b0f9b6ebbbb467592c1e2aca9a0c7e5fd59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 26 Nov 2019 23:37:08 +0100 Subject: [PATCH] Use localheinz/composer-normalize to verify composer.json is normalized --- .travis.yml | 2 +- composer.json | 31 +++++++++++++++++++------------ dev-tools/analyse.sh | 6 ++++++ dev-tools/composer.json | 3 ++- 4 files changed, 28 insertions(+), 14 deletions(-) create mode 100755 dev-tools/analyse.sh diff --git a/.travis.yml b/.travis.yml index 7e3123ff..cc53f501 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ install: script: - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover - - if [ $ANALYSIS == 1 ]; then PHP_CS_FIXER_FUTURE_MODE=1 ./dev-tools/vendor/bin/php-cs-fixer fix --ansi --diff --dry-run --verbose || travis_terminate 1; fi + - if [ $ANALYSIS == 1 ]; then ./dev-tools/analyse.sh || travis_terminate 1; fi after_script: - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi;' diff --git a/composer.json b/composer.json index a23b21ad..b26ef48c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,10 @@ "name": "cocur/slugify", "type": "library", "description": "Converts a string into a slug.", - "keywords": ["slug", "slugify"], + "keywords": [ + "slug", + "slugify" + ], "license": "MIT", "authors": [ { @@ -19,32 +22,36 @@ "php": ">=5.5.9", "ext-mbstring": "*" }, + "conflict": { + "twig/twig": ">=1,<1.38.1 || >=2,<2.12.1" + }, "require-dev": { "laravel/framework": "~5.1", "latte/latte": "~2.2", "league/container": "^2.2.0", - "mikey179/vfsStream": "~1.6", + "mikey179/vfsstream": "~1.6", "mockery/mockery": "^0.9.11 || ^1.3", "nette/di": "~2.2", - "phpunit/phpunit": "~4.8.36|~5.2", + "phpunit/phpunit": "~4.8.36 || ~5.2", "pimple/pimple": "~1.1", "plumphp/plum": "~0.1", "silex/silex": "~1.3", - "symfony/config": "~2.4|~3.0|~4.0", - "symfony/dependency-injection": "~2.4|~3.0|~4.0", - "symfony/http-kernel": "~2.4|~3.0|~4.0", - "twig/twig": "^1.38.1|^2.12.1|~3.0", + "symfony/config": "~2.4 || ~3.0 || ~4.0", + "symfony/dependency-injection": "~2.4 || ~3.0 || ~4.0", + "symfony/http-kernel": "~2.4 || ~3.0 || ~4.0", + "twig/twig": "^1.38.1 || ^2.12.1 || ~3.0", "zendframework/zend-modulemanager": "~2.2", "zendframework/zend-servicemanager": "~2.2", "zendframework/zend-view": "~2.2" }, - "conflict": { - "twig/twig": ">=1,<1.38.1|>=2,<2.12.1" - }, "autoload": { - "psr-4": {"Cocur\\Slugify\\": "src"} + "psr-4": { + "Cocur\\Slugify\\": "src" + } }, "autoload-dev": { - "psr-4": {"Cocur\\Slugify\\Tests\\": "tests"} + "psr-4": { + "Cocur\\Slugify\\Tests\\": "tests" + } } } diff --git a/dev-tools/analyse.sh b/dev-tools/analyse.sh new file mode 100755 index 00000000..cf7e9b4a --- /dev/null +++ b/dev-tools/analyse.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -eu + +composer normalize --working-dir=./dev-tools ./../composer.json --dry-run +PHP_CS_FIXER_FUTURE_MODE=1 ./dev-tools/vendor/bin/php-cs-fixer fix --ansi --diff --dry-run --verbose diff --git a/dev-tools/composer.json b/dev-tools/composer.json index 6d9218d1..2f933ac8 100644 --- a/dev-tools/composer.json +++ b/dev-tools/composer.json @@ -1,5 +1,6 @@ { "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16" + "friendsofphp/php-cs-fixer": "^2.16", + "localheinz/composer-normalize": "^1.3" } }