Browse Source

Add CI files

jmontoyaa 7 years ago
parent
commit
a1cf751b2a
3 changed files with 51 additions and 0 deletions
  1. 2 0
      .gitattributes
  2. 3 0
      .php_cs
  3. 46 0
      .php_cs.dist

+ 2 - 0
.gitattributes

@@ -5,6 +5,8 @@
 .scrutinizer.yml export-ignore
 .styleci.yml export-ignore
 .travis.yml export-ignore
+.php_cs.dist export-ignore
+.php_cs export-ignore
 codesize.xml export-ignore
 phpcs.xml export-ignore
 

+ 3 - 0
.php_cs

@@ -0,0 +1,3 @@
+<?php
+
+return require_once __DIR__.'/.php_cs.dist';

+ 46 - 0
.php_cs.dist

@@ -0,0 +1,46 @@
+<?php
+
+$header = '/* For licensing terms, see /license.txt */';
+
+$rules = [
+    '@Symfony' => true,
+    '@Symfony:risky' => true,
+    'array_syntax' => [
+        'syntax' => 'short',
+    ],
+    'header_comment' => [
+        'header' => $header,
+    ],
+    'no_extra_consecutive_blank_lines' => true,
+    'no_php4_constructor' => true,
+    'no_useless_else' => true,
+    'no_useless_return' => true,
+    'ordered_class_elements' => true,
+    'ordered_imports' => true,
+    'phpdoc_order' => true,
+    '@PHP56Migration' => true,
+    '@PHP56Migration:risky' => true,
+    '@PHPUnit57Migration:risky' => true,
+    // To be tested before insertion:
+//    'strict_comparison' => true,
+//    'strict_param' => true,
+//    'php_unit_strict' => true,
+];
+
+$finder = PhpCsFixer\Finder::create()
+    ->exclude('app')
+    ->exclude('documentation')
+    ->exclude('vendor')
+    ->exclude('tests')
+    ->exclude('web')
+    ->in(__DIR__)
+;
+
+return PhpCsFixer\Config::create()
+    ->setRules([
+        '@PSR2' => true,
+        //'strict_param' => true,
+        'array_syntax' => ['syntax' => 'short'],
+    ])
+    ->setFinder($finder)
+;