Browse Source

Update docs: do not use deprecated create method

SpacePossum 4 years ago
parent
commit
b57bd251e3
3 changed files with 12 additions and 12 deletions
  1. 2 1
      .php_cs.dist
  2. 6 5
      doc/config.rst
  3. 4 6
      doc/usage.rst

+ 2 - 1
.php_cs.dist

@@ -19,7 +19,8 @@ $finder = PhpCsFixer\Finder::create()
     ])
 ;
 
-$config = PhpCsFixer\Config::create()
+$config = new PhpCsFixer\Config();
+$config
     ->setRiskyAllowed(true)
     ->setRules([
         '@PHP56Migration' => true,

+ 6 - 5
doc/config.rst

@@ -24,8 +24,8 @@ The example below will add two rules to the default list of PSR2 set rules:
         ->in(__DIR__)
     ;
 
-    return PhpCsFixer\Config::create()
-        ->setRules([
+    $config = new PhpCsFixer\Config();
+    return $config->setRules([
             '@PSR2' => true,
             'strict_param' => true,
             'array_syntax' => ['syntax' => 'short'],
@@ -51,8 +51,8 @@ The following example shows how to use all ``Symfony`` rules but the ``full_open
         ->exclude('somedir')
     ;
 
-    return PhpCsFixer\Config::create()
-        ->setRules([
+    $config = new PhpCsFixer\Config();
+    return $config->setRules([
             '@Symfony' => true,
             'full_opening_tag' => false,
         ])
@@ -66,7 +66,8 @@ configure them in your config file.
 
     <?php
 
-    return PhpCsFixer\Config::create()
+    $config = new PhpCsFixer\Config();
+    return $config
         ->setIndent("\t")
         ->setLineEnding("\r\n")
     ;

+ 4 - 6
doc/usage.rst

@@ -151,9 +151,8 @@ Cache can be disabled via ``--using-cache`` option or config file:
 
     <?php
 
-    return PhpCsFixer\Config::create()
-        ->setUsingCache(false)
-    ;
+    $config = new PhpCsFixer\Config();
+    return $config->setUsingCache(false);
 
 Cache file can be specified via ``--cache-file`` option or config file:
 
@@ -161,9 +160,8 @@ Cache file can be specified via ``--cache-file`` option or config file:
 
     <?php
 
-    return PhpCsFixer\Config::create()
-        ->setCacheFile(__DIR__.'/.php_cs.cache')
-    ;
+    $config = new PhpCsFixer\Config();
+    return $config->setCacheFile(__DIR__.'/.php_cs.cache');
 
 Using PHP CS Fixer on CI
 ------------------------