Skip to content

Commit 155fbbd

Browse files
author
Oleksii Korshenko
authored
MAGETWO-66227: [GitHub][PR] Upgrade PHP CS Fixer to v2 #8822
2 parents f93f77b + a85b987 commit 155fbbd

File tree

12 files changed

+439
-176
lines changed

12 files changed

+439
-176
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ atlassian*
2525
/.grunt
2626
/Gruntfile.js
2727
/package.json
28+
/.php_cs
29+
/.php_cs.cache
2830
/grunt-config.json
2931
/dev/tools/grunt/configs/local-themes.js
3032

.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
order allow,deny
223223
deny from all
224224
</Files>
225-
<Files .php_cs>
225+
<Files .php_cs.dist>
226226
order allow,deny
227227
deny from all
228228
</Files>

.htaccess.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
order allow,deny
199199
deny from all
200200
</Files>
201-
<Files .php_cs>
201+
<Files .php_cs.dist>
202202
order allow,deny
203203
deny from all
204204
</Files>

.php_cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

.php_cs.dist

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/**
8+
* Pre-commit hook installation:
9+
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
10+
*/
11+
$finder = PhpCsFixer\Finder::create()
12+
->name('*.phtml')
13+
->exclude('dev/tests/functional/generated')
14+
->exclude('dev/tests/functional/var')
15+
->exclude('dev/tests/functional/vendor')
16+
->exclude('dev/tests/integration/tmp')
17+
->exclude('dev/tests/integration/var')
18+
->exclude('lib/internal/Cm')
19+
->exclude('lib/internal/Credis')
20+
->exclude('lib/internal/Less')
21+
->exclude('lib/internal/LinLibertineFont')
22+
->exclude('pub/media')
23+
->exclude('pub/static')
24+
->exclude('setup/vendor')
25+
->exclude('var');
26+
27+
return PhpCsFixer\Config::create()
28+
->setFinder($finder)
29+
->setRules([
30+
'@PSR2' => true,
31+
'array_syntax' => ['syntax' => 'short'],
32+
'concat_space' => ['spacing' => 'one'],
33+
'include' => true,
34+
'new_with_braces' => true,
35+
'no_empty_statement' => true,
36+
'no_extra_consecutive_blank_lines' => true,
37+
'no_leading_import_slash' => true,
38+
'no_leading_namespace_whitespace' => true,
39+
'no_multiline_whitespace_around_double_arrow' => true,
40+
'no_multiline_whitespace_before_semicolons' => true,
41+
'no_singleline_whitespace_before_semicolons' => true,
42+
'no_trailing_comma_in_singleline_array' => true,
43+
'no_unused_imports' => true,
44+
'no_whitespace_in_blank_line' => true,
45+
'object_operator_without_whitespace' => true,
46+
'ordered_imports' => true,
47+
'standardize_not_equals' => true,
48+
'ternary_operator_spaces' => true,
49+
]);

app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/_module.less

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,5 @@
33
// * See COPYING.txt for license details.
44
// */
55

6-
//
7-
// Order Case Info
8-
// ---------------------------------------------
9-
10-
.order-case-table {
11-
&:extend(.abs-order-tables all);
12-
&:extend(.abs-order-tbody-border all);
13-
}
14-
15-
//
16-
// Layout
17-
// ---------------------------------------------
18-
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
19-
.case-information {
20-
float: left;
21-
#mix-grid .width(6,12);
22-
}
23-
}
6+
@import 'module/_order.less';
7+
@import 'module/_config.less';
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// /**
2+
// * Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
@image-signifyd-logo-path: '../Magento_Signifyd/images/logo.png';
7+
8+
//
9+
// Outer slider of configuration
10+
//
11+
.signifyd-logo-header {
12+
> .entry-edit-head {
13+
> a:after {content: url(@image-signifyd-logo-path)}
14+
}
15+
16+
ul {
17+
margin-left: 5em;
18+
}
19+
20+
.webhook-url {
21+
word-break: break-all;
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// /**
2+
// * Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Order Case Info
8+
// ---------------------------------------------
9+
10+
.order-case-table {
11+
&:extend(.abs-order-tables all);
12+
&:extend(.abs-order-tbody-border all);
13+
}
14+
15+
//
16+
// Layout
17+
// ---------------------------------------------
18+
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
19+
.case-information {
20+
float: left;
21+
#mix-grid .width(6,12);
22+
}
23+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"squizlabs/php_codesniffer": "1.5.3",
7777
"phpmd/phpmd": "@stable",
7878
"pdepend/pdepend": "2.4.0",
79-
"friendsofphp/php-cs-fixer": "~1.2",
79+
"friendsofphp/php-cs-fixer": "~2.1.1",
8080
"lusitanian/oauth": "~0.3 <=0.7.0",
8181
"sebastian/phpcpd": "2.0.0"
8282
},

0 commit comments

Comments
 (0)