-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from KnpLabs/refactoring/cs-fixing
Apply new cs fixing rule
- Loading branch information
Showing
55 changed files
with
153 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
<?php | ||
|
||
function recur_ksort(&$array) { | ||
foreach ($array as &$value) { | ||
if (is_array($value)) recur_ksort($value); | ||
} | ||
return ksort($array); | ||
} | ||
declare(strict_types=1); | ||
|
||
$rules = json_decode(file_get_contents('.php_cs.rules.json'), true); | ||
use PedroTroller\CS\Fixer\Fixers; | ||
use PedroTroller\CS\Fixer\RuleSetFactory; | ||
|
||
recur_ksort($rules); | ||
|
||
file_put_contents('.php_cs.rules.json', json_encode($rules, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); | ||
|
||
$config = PhpCsFixer\Config::create() | ||
return PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules($rules) | ||
->setRules(RuleSetFactory::create() | ||
->symfony(true) | ||
->php(7.0, true) | ||
->pedrotroller(true) | ||
->enable('ordered_imports') | ||
->enable('align_multiline_comment') | ||
->enable('array_indentation') | ||
->enable('no_superfluous_phpdoc_tags') | ||
->enable('binary_operator_spaces', [ | ||
'operators' => [ | ||
'=' => 'align_single_space_minimal', | ||
'=>' => 'align_single_space_minimal', | ||
], | ||
]) | ||
->getRules() | ||
) | ||
->setUsingCache(false) | ||
->registerCustomFixers(new PedroTroller\CS\Fixer\Fixers()) | ||
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) | ||
->registerCustomFixers(new Fixers()) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->append([__FILE__]) | ||
) | ||
; | ||
|
||
return $config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/DataCollector/DictionaryDataCollectorSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/DependencyInjection/Compiler/DictionaryBuildingPassSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/DependencyInjection/Compiler/DictionaryFactoryBuildingPassSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/DependencyInjection/Compiler/DictionaryRegistrationPassSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/DependencyInjection/ConfigurationSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/DependencyInjection/KnpDictionaryExtensionSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/DictionaryRegistrySpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\Knp\DictionaryBundle\Dictionary; | ||
|
||
use ArrayAccess; | ||
|
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/Factory/CallableFactorySpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/Factory/KeyValueSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/Factory/ValueAsKeySpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/SimpleDictionarySpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/TraceableDictionarySpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/ValueTransformer/ConstantTransformerSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Dictionary/ValueTransformer/TransformerAggregateSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Exception/DictionaryNotFoundExceptionSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\Knp\DictionaryBundle\Twig; | ||
|
||
use Knp\DictionaryBundle\Dictionary; | ||
|
2 changes: 2 additions & 0 deletions
2
spec/Knp/DictionaryBundle/Validator/Constraints/DictionarySpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/Knp/DictionaryBundle/DataCollector/DictionaryDataCollector.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Knp\DictionaryBundle\DataCollector; | ||
|
||
use Exception; | ||
|
2 changes: 2 additions & 0 deletions
2
src/Knp/DictionaryBundle/DependencyInjection/Compiler/DictionaryBuildingPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/Knp/DictionaryBundle/DependencyInjection/Compiler/DictionaryFactoryBuildingPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.