1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

Use shared style repo

This commit is contained in:
Aaron Piotrowski 2019-02-25 23:09:26 -06:00
parent 4e3251cba9
commit 19bcf9b33d
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
3 changed files with 15 additions and 40 deletions

View File

@ -1,40 +1,13 @@
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
"@PSR1" => true,
"@PSR2" => true,
"braces" => [
"allow_single_line_closure" => true,
],
"array_syntax" => ["syntax" => "short"],
"cast_spaces" => true,
"combine_consecutive_unsets" => true,
"function_to_constant" => true,
"native_function_invocation" => true,
"no_multiline_whitespace_before_semicolons" => true,
"no_unused_imports" => true,
"no_useless_else" => true,
"no_useless_return" => true,
"no_whitespace_before_comma_in_array" => true,
"no_whitespace_in_blank_line" => true,
"non_printable_character" => true,
"normalize_index_brace" => true,
"ordered_imports" => true,
"php_unit_construct" => true,
"php_unit_dedicate_assert" => true,
"php_unit_fqcn_annotation" => true,
"phpdoc_summary" => true,
"phpdoc_types" => true,
"psr4" => true,
"return_type_declaration" => ["space_before" => "none"],
"short_scalar_cast" => true,
"single_blank_line_before_namespace" => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . "/examples")
->in(__DIR__ . "/lib")
->in(__DIR__ . "/test")
);
$config = new Amp\CodeStyle\Config();
$config->getFinder()
->in(__DIR__ . '/examples')
->in(__DIR__ . '/lib')
->in(__DIR__ . '/test');
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
$config->setCacheFile($cacheDir . '/.php_cs.cache');
return $config;

View File

@ -54,4 +54,6 @@ after_script:
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
- $HOME/.local

View File

@ -37,8 +37,8 @@
},
"require-dev": {
"amphp/phpunit-util": "^1",
"amphp/php-cs-fixer-config": "dev-master",
"react/promise": "^2",
"friendsofphp/php-cs-fixer": "^2.3",
"phpunit/phpunit": "^6.0.9",
"phpstan/phpstan": "^0.8.5"
},