Skip to content

Commit bccc9af

Browse files
committed
minor #5344 Update docs: do not use deprecated create method (SpacePossum)
This PR was merged into the 2.16 branch. Discussion ---------- Update docs: do not use deprecated create method Commits ------- b57bd25 Update docs: do not use deprecated create method
2 parents 1e621d2 + b57bd25 commit bccc9af

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

.php_cs.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ $finder = PhpCsFixer\Finder::create()
1919
])
2020
;
2121

22-
$config = PhpCsFixer\Config::create()
22+
$config = new PhpCsFixer\Config();
23+
$config
2324
->setRiskyAllowed(true)
2425
->setRules([
2526
'@PHP56Migration' => true,

doc/config.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The example below will add two rules to the default list of PSR2 set rules:
2424
->in(__DIR__)
2525
;
2626
27-
return PhpCsFixer\Config::create()
28-
->setRules([
27+
$config = new PhpCsFixer\Config();
28+
return $config->setRules([
2929
'@PSR2' => true,
3030
'strict_param' => true,
3131
'array_syntax' => ['syntax' => 'short'],
@@ -51,8 +51,8 @@ The following example shows how to use all ``Symfony`` rules but the ``full_open
5151
->exclude('somedir')
5252
;
5353
54-
return PhpCsFixer\Config::create()
55-
->setRules([
54+
$config = new PhpCsFixer\Config();
55+
return $config->setRules([
5656
'@Symfony' => true,
5757
'full_opening_tag' => false,
5858
])
@@ -66,7 +66,8 @@ configure them in your config file.
6666
6767
<?php
6868
69-
return PhpCsFixer\Config::create()
69+
$config = new PhpCsFixer\Config();
70+
return $config
7071
->setIndent("\t")
7172
->setLineEnding("\r\n")
7273
;

doc/usage.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,17 @@ Cache can be disabled via ``--using-cache`` option or config file:
151151
152152
<?php
153153
154-
return PhpCsFixer\Config::create()
155-
->setUsingCache(false)
156-
;
154+
$config = new PhpCsFixer\Config();
155+
return $config->setUsingCache(false);
157156
158157
Cache file can be specified via ``--cache-file`` option or config file:
159158

160159
.. code-block:: php
161160
162161
<?php
163162
164-
return PhpCsFixer\Config::create()
165-
->setCacheFile(__DIR__.'/.php_cs.cache')
166-
;
163+
$config = new PhpCsFixer\Config();
164+
return $config->setCacheFile(__DIR__.'/.php_cs.cache');
167165
168166
Using PHP CS Fixer on CI
169167
------------------------

0 commit comments

Comments
 (0)