Skip to content

Commit b647cc1

Browse files
committed
Use php-cs-fixer v2.
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent bb54563 commit b647cc1

File tree

3 files changed

+32
-68
lines changed

3 files changed

+32
-68
lines changed

.php_cs

Lines changed: 19 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,22 @@
11
<?php
22

3-
$finder = Symfony\Component\Finder\Finder::create()
4-
->files()
5-
->in(__DIR__.'/src')
6-
->ignoreDotFiles(true)
7-
->ignoreVCS(true);
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests');
86

9-
return Symfony\CS\Config\Config::create()
10-
->setUsingCache(true)
11-
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
12-
->fixers([
13-
'-psr0',
14-
'align_double_arrow',
15-
'align_equals',
16-
'blankline_after_open_tag',
17-
'concat_without_spaces',
18-
'double_arrow_multiline_whitespaces',
19-
'duplicate_semicolon',
20-
'empty_return',
21-
'extra_empty_lines',
22-
'include',
23-
'join_function',
24-
'multiline_array_trailing_comma',
25-
'multiline_spaces_before_semicolon',
26-
'new_with_braces',
27-
'no_blank_lines_after_class_opening',
28-
'no_empty_lines_after_phpdocs',
29-
'object_operator',
30-
'operators_spaces',
31-
'phpdoc_indent',
32-
'phpdoc_inline_tag',
33-
'phpdoc_no_access',
34-
'-phpdoc_no_empty_return',
35-
'phpdoc_no_package',
36-
'-phpdoc_params',
37-
'phpdoc_scalar',
38-
'phpdoc_separation',
39-
'phpdoc_short_description',
40-
'phpdoc_to_comment',
41-
'phpdoc_trim',
42-
'phpdoc_type_to_var',
43-
'phpdoc_var_without_name',
44-
'remove_leading_slash_use',
45-
'remove_lines_between_uses',
46-
'short_array_syntax',
47-
'single_array_no_trailing_comma',
48-
'single_blank_line_before_namespace',
49-
'single_quote',
50-
'spaces_cast',
51-
'standardize_not_equal',
52-
'ternary_spaces',
53-
'trim_array_spaces',
54-
'unused_use',
55-
'whitespacy_lines',
56-
'visibility',
57-
])
58-
->finder($finder);
7+
return PhpCsFixer\Config::create()
8+
->setRiskyAllowed(false)
9+
->setRules([
10+
'@Symfony' => true,
11+
'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false],
12+
'no_empty_comment' => false,
13+
'no_extra_consecutive_blank_lines' => false,
14+
'not_operator_with_successor_space' => true,
15+
'ordered_imports' => ['sortAlgorithm' => 'length'],
16+
'phpdoc_align' => false,
17+
'phpdoc_no_empty_return' => false,
18+
'phpdoc_order' => true,
19+
'pre_increment' => false,
20+
'yoda_style' => false,
21+
])
22+
->setFinder($finder);

tests/Xml/DocumentTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ public function dataCollectionProvider()
4646
<world></world>
4747
</foo>',
4848
[
49-
'foo' => ['uses' => 'bar', 'filter' => '@strToUpper'],
50-
'hello' => ['uses' => ['bar::hello', 'bar'], 'filter' => '@notFilterable'],
51-
'world' => ['uses' => 'world', 'default' => false],
52-
'foobar' => ['uses' => 'bar::foobar', 'default' => false],
49+
'foo' => ['uses' => 'bar', 'filter' => '@strToUpper'],
50+
'hello' => ['uses' => ['bar::hello', 'bar'], 'filter' => '@notFilterable'],
51+
'world' => ['uses' => 'world', 'default' => false],
52+
'foobar' => ['uses' => 'bar::foobar', 'default' => false],
5353
'username' => ['uses' => 'user::name', 'default' => 'Guest', 'filter' => FilterStub::class.'@filterStrToLower'],
54-
'google' => 'google.com',
54+
'google' => 'google.com',
5555
'facebook' => ['default' => 'facebook.com'],
5656
],
5757
[
58-
'foo' => 'FOOBAR',
59-
'hello' => ['hello world', 'foobar'],
60-
'world' => false,
61-
'foobar' => false,
58+
'foo' => 'FOOBAR',
59+
'hello' => ['hello world', 'foobar'],
60+
'world' => false,
61+
'foobar' => false,
6262
'username' => 'guest',
63-
'google' => 'google.com',
63+
'google' => 'google.com',
6464
'facebook' => 'facebook.com',
6565
],
6666
],

tests/Xml/ReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public function it_can_extract_valid_xml_from_string()
1414
{
1515
$xml = '<xml><foo>foobar</foo></xml>';
1616

17-
$app = new Container();
17+
$app = new Container();
1818
$document = new Document($app);
19-
$stub = new Reader($document);
20-
$output = $stub->extract($xml);
19+
$stub = new Reader($document);
20+
$output = $stub->extract($xml);
2121

2222
$this->assertInstanceOf('\Orchestra\Parser\Xml\Document', $output);
2323
}

0 commit comments

Comments
 (0)