Browse Source

Libraries for code lint and some additional settings was added to composer.json

tags/1.3.1
Paul Rock 6 years ago
parent
commit
30426de590
  1. 33
      .php_cs
  2. 25
      composer.json

33
.php_cs

@ -0,0 +1,33 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'src')
->append(['.php_cs']);
$rules = [
'@Symfony' => true,
'phpdoc_no_empty_return' => false,
'phpdoc_summary' => false,
'no_superfluous_phpdoc_tags' => false,
'phpdoc_separation' => false,
'phpdoc_trim' => false,
'phpdoc_align' => false,
'array_syntax' => ['syntax' => 'short'],
'yoda_style' => true,
'binary_operator_spaces' => false,
'concat_space' => ['spacing' => 'one'],
'not_operator_with_space' => false,
'phpdoc_no_package' => false,
'single_trait_insert_per_statement' => false,
'ordered_imports' => false,
'no_extra_blank_lines' => false,
'blank_line_before_statement' => false,
];
$rules['increment_style'] = ['style' => 'post'];
return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRules($rules)
->setFinder($finder);

25
composer.json

@ -46,19 +46,32 @@
"divineomega/php-ssh-connection": "^2.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"limedeck/phpunit-detailed-printer": "^5.0",
"orchestra/testbench": "^4.0|^5.0",
"phpstan/phpstan": "^0.12.32",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^8.0",
"rector/rector": "^0.7.41",
"roave/security-advisories": "dev-master",
"thecodingmachine/phpstan-strict-rules": "^0.12.0",
"squizlabs/php_codesniffer": "^3.5",
"larapack/dd": "^1.1"
},
"config": {
"sort-packages": true,
"preferred-install": "dist"
},
"scripts": {
"test": "phpunit --coverage-clover clover.xml",
"check": [
"@cs-check"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf"
"lint": "rector process src && php-cs-fixer fix -v",
"test:lint": "php-cs-fixer fix -v --dry-run",
"test:rector": "rector process src --dry-run",
"test:types": "phpstan analyse --ansi --memory-limit=0",
"test:unit": "phpunit --coverage-clover clover.xml",
"test": [
"@test:lint",
"@test:types",
"@test:unit"
]
}
}
Loading…
Cancel
Save