Skip to content

Commit

Permalink
Merge pull request #203 from ergebnis/feature/code
Browse files Browse the repository at this point in the history
Enhancement: Modernize code examples
  • Loading branch information
ergebnis-bot authored Oct 8, 2020
2 parents 497e57e + bd5435c commit 0bcde3f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $ composer require --dev ergebnis/php-cs-fixer-config
Pick one of the rule sets:

* [`Ergebnis\PhpCsFixer\RuleSet\Laravel6`](src/RuleSet/Laravel6.php)
* [`Ergebnis\PhpCsFixer\RuleSet\Php71`](src/RuleSet/Php71.php)
* [`Ergebnis\PhpCsFixer\RuleSet\Php71`](src/RuleSet/Php74.php)
* [`Ergebnis\PhpCsFixer\RuleSet\Php73`](src/RuleSet/Php73.php)
* [`Ergebnis\PhpCsFixer\RuleSet\Php74`](src/RuleSet/Php74.php)

Expand All @@ -39,7 +39,7 @@ Create a configuration file `.php_cs` in the root of your project:

use Ergebnis\PhpCsFixer\Config;

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71());
$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php74());

$config->getFinder()->in(__DIR__);
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/php_cs.cache');
Expand Down Expand Up @@ -68,16 +68,16 @@ All configuration examples use the caching feature, and if you want to use it as
use Ergebnis\PhpCsFixer\Config;

+$header = <<<EOF
+Copyright (c) 2019 Andreas Möller
+Copyright (c) 2020 Andreas Möller
+
+For the full copyright and license information, please view
+the LICENSE file that was distributed with this source code.
+
+@see https://github.com/ergebnis/php-cs-fixer-config
+EOF;

-$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71());
+$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header));
-$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php74());
+$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php74($header));

$config->getFinder()->in(__DIR__);
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/php_cs.cache');
Expand All @@ -92,7 +92,7 @@ file headers will be added to PHP files, for example:
<?php

/**
* Copyright (c) 2019 Andreas Möller
* Copyright (c) 2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
Expand All @@ -110,8 +110,8 @@ file headers will be added to PHP files, for example:

use Ergebnis\PhpCsFixer\Config;

-$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71());
+$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71(), [
-$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php74());
+$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php74(), [
+ 'mb_str_functions' => false,
+ 'strict_comparison' => false,
+]);
Expand Down

0 comments on commit 0bcde3f

Please sign in to comment.