Skip to content

Commit

Permalink
Merge pull request #146 from kubawerlos/composer-json-slimming
Browse files Browse the repository at this point in the history
Slim composer.json
  • Loading branch information
kubawerlos committed Sep 29, 2019
2 parents 579a871 + 6664677 commit d874d25
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 27 deletions.
25 changes: 3 additions & 22 deletions composer.json
Expand Up @@ -2,10 +2,6 @@
"name": "kubawerlos/php-cs-fixer-custom-fixers", "name": "kubawerlos/php-cs-fixer-custom-fixers",
"type": "library", "type": "library",
"description": "A set of custom fixers for PHP CS Fixer", "description": "A set of custom fixers for PHP CS Fixer",
"keywords": [
"fixer",
"php-cs-fixer"
],
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
{ {
Expand All @@ -19,34 +15,19 @@
"friendsofphp/php-cs-fixer": "^2.14", "friendsofphp/php-cs-fixer": "^2.14",
"symfony/finder": "^3.0 || ^4.0" "symfony/finder": "^3.0 || ^4.0"
}, },
"require-dev": {
"ext-json": "*",
"infection/infection": "^0.13.3",
"johnkary/phpunit-speedtrap": "^3.1",
"kubawerlos/types-checker": "^1.1",
"phpunit/phpunit": "^7.4 || ^8.0",
"sebastian/diff": "^3.0",
"symfony/console": "^4.0"
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"PhpCsFixerCustomFixers\\": "src" "PhpCsFixerCustomFixers\\": "src"
} }
}, },
"autoload-dev": {
"psr-4": {
"PhpCsFixerCustomFixersDev\\": "src-dev",
"Tests\\": "tests"
}
},
"scripts": { "scripts": {
"post-update-cmd": "composer --working-dir=./dev-tools update", "post-update-cmd": "composer --working-dir=./dev-tools update",
"analyse": [ "analyse": [
"composer validate --strict", "composer validate --strict",
"composer normalize --dry-run --working-dir=./dev-tools ./../composer.json", "composer normalize --dry-run --working-dir=./dev-tools ./../composer.json",
"./dev-tools/vendor/bin/composer-require-checker check ./composer.json", "./dev-tools/vendor/bin/composer-require-checker check ./composer.json",
"./dev-tools/vendor/bin/phpcs --exclude=Generic.Files.LineLength --report-full --standard=PSR2 ./src ./src-dev ./tests", "./dev-tools/vendor/bin/phpcs --exclude=Generic.Files.LineLength --report-full --standard=PSR2 ./src ./src-dev ./tests",
"./vendor/bin/types-checker ./src ./src-dev ./tests", "./dev-tools/vendor/bin/types-checker ./src ./src-dev ./tests",
"PHP_CS_FIXER_FUTURE_MODE=1 ./vendor/bin/php-cs-fixer fix --ansi --diff --dry-run --verbose", "PHP_CS_FIXER_FUTURE_MODE=1 ./vendor/bin/php-cs-fixer fix --ansi --diff --dry-run --verbose",
"./dev-tools/vendor/bin/phpcpd ./src", "./dev-tools/vendor/bin/phpcpd ./src",
"./dev-tools/vendor/bin/phpmd ./src text ./phpmd.xml", "./dev-tools/vendor/bin/phpmd ./src text ./phpmd.xml",
Expand All @@ -60,10 +41,10 @@
"./src-dev/Readme/run > README.md" "./src-dev/Readme/run > README.md"
], ],
"infection": [ "infection": [
"./vendor/bin/infection run --ansi --threads=16" "./dev-tools/vendor/bin/infection run --ansi --threads=16"
], ],
"test": [ "test": [
"./vendor/bin/phpunit" "./dev-tools/vendor/bin/phpunit"
], ],
"verify": [ "verify": [
"@analyse", "@analyse",
Expand Down
31 changes: 29 additions & 2 deletions dev-tools/composer.json
@@ -1,13 +1,40 @@
{ {
"require-dev": { "require-dev": {
"infection/infection": "^0.13.6 || 0.14.1",
"johnkary/phpunit-speedtrap": "^3.1",
"kubawerlos/types-checker": "^1.1",
"localheinz/composer-normalize": "^1.3", "localheinz/composer-normalize": "^1.3",
"maglnet/composer-require-checker": "^2.0", "maglnet/composer-require-checker": "^2.0",
"mi-schi/phpmd-extension": "^4.3", "mi-schi/phpmd-extension": "^4.3",
"phpmd/phpmd": "^2.7", "phpmd/phpmd": "^2.7",
"phpstan/phpstan": "^0.11.16", "phpstan/phpstan": "^0.11.16",
"phpstan/phpstan-strict-rules": "^0.11.1", "phpstan/phpstan-strict-rules": "^0.11.1",
"phpunit/phpunit": "^7.4 || ^8.3",
"sebastian/diff": "^3.0",
"sebastian/phpcpd": "^4.1", "sebastian/phpcpd": "^4.1",
"squizlabs/php_codesniffer": "^3.4", "squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^3.5" "symfony/console": "^4.3",
"vimeo/psalm": "^3.5",
"wikimedia/composer-merge-plugin": "^1.4"
},
"extra": {
"merge-plugin": {
"include": [
"../composer.json"
],
"recurse": true,
"replace": false,
"ignore-duplicates": false,
"merge-dev": true,
"merge-extra": false,
"merge-extra-deep": false,
"merge-scripts": false
}
},
"autoload-dev": {
"psr-4": {
"PhpCsFixerCustomFixersDev\\": "../src-dev",
"Tests\\": "../tests"
}
} }
} }
3 changes: 3 additions & 0 deletions infection.json.dist
Expand Up @@ -12,6 +12,9 @@
"branch": "master" "branch": "master"
} }
}, },
"phpUnit": {
"customPath": "./dev-tools/vendor/bin/phpunit"
},
"mutators": { "mutators": {
"@default": true, "@default": true,
"ArrayItemRemoval": { "ArrayItemRemoval": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>


<phpunit xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' <phpunit xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='vendor/phpunit/phpunit/phpunit.xsd' xsi:noNamespaceSchemaLocation='./dev-tools/vendor/phpunit/phpunit/phpunit.xsd'
colors='true' colors='true'
forceCoversAnnotation='true' forceCoversAnnotation='true'
verbose='true' verbose='true'
Expand Down
2 changes: 1 addition & 1 deletion src-dev/Readme/ReadmeCommand.php
Expand Up @@ -105,7 +105,7 @@ private function badge(string $description, string $imageUrl, ?string $targetUrl


private function numberOfTests(): int private function numberOfTests(): int
{ {
$process = new Process([__DIR__ . '/../../vendor/bin/phpunit', '--list-tests']); $process = new Process([__DIR__ . '/../../dev-tools/vendor/bin/phpunit', '--list-tests']);
$process->run(); $process->run();


return \substr_count($process->getOutput(), PHP_EOL) - 3; // 3 is for header return \substr_count($process->getOutput(), PHP_EOL) - 3; // 3 is for header
Expand Down
2 changes: 1 addition & 1 deletion src-dev/Readme/run
@@ -1,7 +1,7 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php


require_once __DIR__ . '/../../vendor/autoload.php'; require_once __DIR__ . '/../../dev-tools/vendor/autoload.php';


$application = new Symfony\Component\Console\Application(); $application = new Symfony\Component\Console\Application();
$command = new PhpCsFixerCustomFixersDev\Readme\ReadmeCommand('readme'); $command = new PhpCsFixerCustomFixersDev\Readme\ReadmeCommand('readme');
Expand Down

0 comments on commit d874d25

Please sign in to comment.