Skip to content

Commit 33d1cb7

Browse files
committed
Merge branch '2.15'
2 parents 665cedf + 7b1d2e2 commit 33d1cb7

File tree

6 files changed

+71
-17
lines changed

6 files changed

+71
-17
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,3 @@ jobs:
165165
tags: true
166166
after_deploy:
167167
- ./dev-tools/trigger-website.sh ${TRAVIS_TOKEN} ${TRAVIS_TAG}
168-
169-
allow_failures:
170-
- php: 7.4snapshot

dev-tools/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"php": "^7.1"
44
},
55
"require-dev": {
6-
"localheinz/composer-normalize": "^1.0.0",
7-
"maglnet/composer-require-checker": "^1.0",
8-
"mi-schi/phpmd-extension": "^4.2",
9-
"phpmd/phpmd": "^2.4.3"
6+
"localheinz/composer-normalize": "^1.1",
7+
"maglnet/composer-require-checker": "^2.0",
8+
"mi-schi/phpmd-extension": "^4.3",
9+
"phpmd/phpmd": "^2.6"
1010
},
1111
"conflict": {
1212
"hhvm": "*"

src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, $startFunctionInde
390390
continue;
391391
}
392392

393-
if ($token->equals(',')) {
393+
if ($token->equals(',') && !$tokens[$tokens->getNextMeaningfulToken($index)]->equals(')')) {
394394
$this->fixNewline($tokens, $index, $indentation);
395395
}
396396
}

tests/Fixer/FunctionNotation/MethodArgumentSpaceFixerTest.php

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,26 @@ public function provideFixCases()
192192
['keep_multiple_spaces_after_comma' => true],
193193
],
194194
'skip array' => [
195-
'<?php array(10 , 20 ,30);',
195+
'<?php array(10 , 20 ,30); $foo = [ 10,50 , 60 ] ?>',
196196
],
197197
'list call with trailing comma' => [
198198
'<?php list($path, $mode, ) = foo();',
199199
'<?php list($path, $mode,) = foo();',
200200
],
201+
'list call with trailing comma multi line' => [
202+
'<?php
203+
list(
204+
$a,
205+
$b,
206+
) = foo();
207+
',
208+
'<?php
209+
list(
210+
$a ,
211+
$b ,
212+
) = foo();
213+
',
214+
],
201215
'inline comments with spaces' => [
202216
'<?php xyz($a=10, /*comment1*/ $b=2000, /*comment2*/ $c=30);',
203217
'<?php xyz($a=10, /*comment1*/ $b=2000,/*comment2*/ $c=30);',
@@ -969,4 +983,47 @@ functionCall(
969983

970984
$this->doTest($expected, $input);
971985
}
986+
987+
/**
988+
* @param string $expected
989+
* @param null|string $input
990+
* @param null|array $config
991+
*
992+
* @requires PHP 7.3
993+
* @dataProvider provideFix73Cases
994+
*/
995+
public function testFix73($expected, $input = null, array $config = null)
996+
{
997+
if (null !== $config) {
998+
$this->fixer->configure($config);
999+
}
1000+
1001+
$this->doTest($expected, $input);
1002+
}
1003+
1004+
public function provideFix73Cases()
1005+
{
1006+
return [
1007+
[
1008+
'<?php
1009+
functionCall(
1010+
1,
1011+
2,
1012+
3,
1013+
);',
1014+
'<?php
1015+
functionCall(
1016+
1, 2,
1017+
3,
1018+
);',
1019+
[
1020+
'on_multiline' => 'ensure_fully_multiline',
1021+
],
1022+
],
1023+
[
1024+
'<?php foo(1, 2, 3, );',
1025+
'<?php foo(1,2,3,);',
1026+
],
1027+
];
1028+
}
9721029
}

tests/Fixer/Import/OrderedImportsFixerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,12 @@ public function provideFix70Cases()
796796
[
797797
'<?php
798798
use C\B;
799-
use function B\fn;
799+
use function B\fn_a;
800800
use const A\ConstA;
801801
',
802802
'<?php
803803
use const A\ConstA;
804-
use function B\fn;
804+
use function B\fn_a;
805805
use C\B;
806806
',
807807
[
@@ -1884,7 +1884,7 @@ public function provideFix70TypesOrderAndAlphabetCases()
18841884
use const some\a\{ConstD};
18851885
use const some\b\{ConstE};
18861886
use function some\a\{fn_a, fn_b};
1887-
use function some\a\{fn};
1887+
use function some\a\{fn_bc};
18881888
use function some\b\{fn_c, fn_d, fn_e};
18891889
use function some\c\{fn_f};
18901890
use function some\f\{fn_g, fn_h, fn_i};
@@ -1903,7 +1903,7 @@ public function provideFix70TypesOrderAndAlphabetCases()
19031903
};
19041904
use const some\a\{ConstD};
19051905
use Some\Cloz;
1906-
use function some\a\{fn};
1906+
use function some\a\{fn_bc};
19071907
use const some\a\{ConstA};
19081908
use function some\b\{fn_c, fn_d, fn_e};
19091909
use const some\a\{ConstB, ConstC as CC};
@@ -1956,7 +1956,7 @@ public function provideFix70TypesOrderAndNoneCases()
19561956
use const some\b\{ConstE};
19571957
use function some\f\{fn_g, fn_h, fn_i};
19581958
use function some\c\{fn_f};
1959-
use function some\a\{fn};
1959+
use function some\a\{fn_x};
19601960
use function some\b\{fn_c, fn_d, fn_e};
19611961
use function some\a\{fn_a, fn_b};
19621962
',
@@ -1974,7 +1974,7 @@ public function provideFix70TypesOrderAndNoneCases()
19741974
};
19751975
use const some\a\{ConstD};
19761976
use Some\Cloz;
1977-
use function some\a\{fn};
1977+
use function some\a\{fn_x};
19781978
use const some\a\{ConstA};
19791979
use function some\b\{fn_c, fn_d, fn_e};
19801980
use const some\a\{ConstB, ConstC as CC};

tests/Fixer/Import/SingleLineAfterImportsFixerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,12 @@ class Test {}
428428
[
429429
' <?php
430430
use some\a\ClassA;
431-
use function some\a\fn;
431+
use function some\a\fn_a;
432432
use const some\c;
433433
434434
',
435435
' <?php
436-
use some\a\ClassA; use function some\a\fn; use const some\c;
436+
use some\a\ClassA; use function some\a\fn_a; use const some\c;
437437
',
438438
],
439439
];

0 commit comments

Comments
 (0)