Преглед на файлове

Upgrade .php_cs configuration file for php-cs-fixer 2.x

Daniele Alessandri преди 7 години
родител
ревизия
722b513cea
променени са 2 файла, в които са добавени 33 реда и са изтрити 34 реда
  1. 0 34
      .php_cs
  2. 33 0
      .php_cs.dist

+ 0 - 34
.php_cs

@@ -1,34 +0,0 @@
-<?php
-
-$PREDIS_HEADER = <<<EOS
-This file is part of the Predis package.
-
-(c) Daniele Alessandri <suppakilla@gmail.com>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-EOS;
-
-Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($PREDIS_HEADER);
-
-return Symfony\CS\Config\Config::create()
-    ->setUsingCache(true)
-    ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
-    ->fixers(array(
-        // Symfony
-        '-unalign_equals',
-        '-unalign_double_arrow',
-
-        // Contribs
-        'header_comment',
-        'ordered_use',
-        'phpdoc_order',
-        'long_array_syntax',
-    ))
-    ->finder(
-        Symfony\CS\Finder\DefaultFinder::create()
-            ->in(__DIR__.'/bin')
-            ->in(__DIR__.'/src')
-            ->in(__DIR__.'/tests')
-            ->in(__DIR__.'/examples')
-    );

+ 33 - 0
.php_cs.dist

@@ -0,0 +1,33 @@
+<?php
+
+$PREDIS_HEADER = <<<EOS
+This file is part of the Predis package.
+
+(c) Daniele Alessandri <suppakilla@gmail.com>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+EOS;
+
+return PhpCsFixer\Config::create()
+    ->setUsingCache(true)
+    ->setRules(array(
+        '@Symfony' => true,
+        'header_comment' => array(
+            'header' => $PREDIS_HEADER,
+        ),
+        'ordered_imports' => true,
+        'phpdoc_order' => true,
+        'binary_operator_spaces' => array(
+            'align_double_arrow' => false,
+            'align_equals' => false,
+        ),
+        'array_syntax' => array('syntax' => 'long'),
+    ))
+    ->setFinder(
+        PhpCsFixer\Finder::create()
+            ->in(__DIR__.'/bin')
+            ->in(__DIR__.'/src')
+            ->in(__DIR__.'/tests')
+            ->in(__DIR__.'/examples')
+    );