Skip to content

Commit

Permalink
minor #4585 Fix deprecation notices (julienfalque)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.15 branch.

Discussion
----------

Fix deprecation notices

Commits
-------

c81295c Fix deprecation notices
  • Loading branch information
keradus committed Nov 2, 2019
2 parents 681e7f9 + c81295c commit f031f23
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 70 deletions.
28 changes: 14 additions & 14 deletions tests/Fixer/ClassNotation/ClassDefinitionFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testInvalidConfigurationValueType()
);

$fixer = new ClassDefinitionFixer();
$fixer->configure(['singleLine' => 'z']);
$fixer->configure(['single_line' => 'z']);
}

public function provideAnonymousClassesCases()
Expand All @@ -163,7 +163,7 @@ public function provideAnonymousClassesCases()
[
'<?php $a = new class(1) extends SomeClass implements SomeInterface, D {};',
"<?php \$a = new class(1) extends\nSomeClass\timplements SomeInterface, D {};",
['singleLine' => true],
['single_line' => true],
],
[
"<?php \$a = new class('1a') implements\nA\n{};",
Expand All @@ -172,7 +172,7 @@ public function provideAnonymousClassesCases()
[
"<?php \$a = new class('1a') implements A {};",
"<?php \$a = new class('1a') implements\nA{};",
['singleItemSingleLine' => true],
['single_item_single_line' => true],
],
[
'<?php $a = new class {};',
Expand Down Expand Up @@ -289,7 +289,7 @@ class#
#
}#
;",
['singleItemSingleLine' => true],
['single_item_single_line' => true],
],
[
'<?php $a = new class() #
Expand All @@ -315,45 +315,45 @@ public function provideClassesWithConfigCases()
[
"<?php class configA implements B, C\n{}",
"<?php class configA implements\nB, C{}",
['singleLine' => true],
['single_line' => true],
],
[
"<?php class configA1 extends B\n{}",
"<?php class configA1\n extends\nB{}",
['singleLine' => true],
['single_line' => true],
],
[
"<?php class configA1a extends B\n{}",
"<?php class configA1a\n extends\nB{}",
['singleLine' => false, 'singleItemSingleLine' => true],
['single_line' => false, 'single_item_single_line' => true],
],
[
"<?php class configA2 extends D implements B, C\n{}",
"<?php class configA2 extends D implements\nB,\nC{}",
['singleLine' => true],
['single_line' => true],
],
[
"<?php class configA3 extends D implements B, C\n{}",
"<?php class configA3\n extends\nD\n\t implements\nB,\nC{}",
['singleLine' => true],
['single_line' => true],
],
[
"<?php class configA4 extends D implements B, #\nC\n{}",
"<?php class configA4\n extends\nD\n\t implements\nB,#\nC{}",
['singleLine' => true],
['single_line' => true],
],
[
"<?php class configA5 implements A\n{}",
"<?php class configA5 implements\nA{}",
['singleLine' => false, 'singleItemSingleLine' => true],
['single_line' => false, 'single_item_single_line' => true],
],
[
"<?php interface TestWithMultiExtendsMultiLine extends\n A,\nAb,\n C,\n D\n{}",
"<?php interface TestWithMultiExtendsMultiLine extends A,\nAb,C,D\n{}",
[
'singleLine' => false,
'singleItemSingleLine' => false,
'multiLineExtendsEachSingleLine' => true,
'single_line' => false,
'single_item_single_line' => false,
'multi_line_extends_each_single_line' => true,
],
],
];
Expand Down
18 changes: 9 additions & 9 deletions tests/Fixer/Comment/HeaderCommentFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function provideFixCases()
'header' => 'tmp',
'location' => 'after_declare_strict',
'separate' => 'bottom',
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
],
'<?php
declare(strict_types=1);
Expand Down Expand Up @@ -122,7 +122,7 @@ public function provideFixCases()
[
[
'header' => 'new',
'commentType' => 'comment',
'comment_type' => 'comment',
],
'<?php
Expand All @@ -138,7 +138,7 @@ public function provideFixCases()
[
[
'header' => 'new',
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
],
'<?php
Expand All @@ -154,7 +154,7 @@ public function provideFixCases()
[
[
'header' => 'def',
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
],
'<?php
Expand Down Expand Up @@ -194,7 +194,7 @@ public function provideFixCases()
[
[
'header' => 'abc',
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
],
'<?php
Expand Down Expand Up @@ -360,14 +360,14 @@ public function provideMisconfigurationCases()
[
[
'header' => '',
'commentType' => 'foo',
'comment_type' => 'foo',
],
'Invalid configuration: The option "comment_type" with value "foo" is invalid. Accepted values are: "PHPDoc", "comment".',
],
[
[
'header' => '',
'commentType' => new \stdClass(),
'comment_type' => new \stdClass(),
],
'Invalid configuration: The option "comment_type" with value stdClass is invalid. Accepted values are: "PHPDoc", "comment".',
],
Expand Down Expand Up @@ -399,7 +399,7 @@ public function testHeaderGeneration($expected, $header, $type)
{
$this->configureFixerWithAliasedOptions([
'header' => $header,
'commentType' => $type,
'comment_type' => $type,
]);
$this->doTest(
'<?php
Expand Down Expand Up @@ -547,7 +547,7 @@ public function provideMessyWhitespacesCases()
'header' => 'whitemess',
'location' => 'after_declare_strict',
'separate' => 'bottom',
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
],
"<?php\r\ndeclare(strict_types=1);\r\n/**\r\n * whitemess\r\n */\r\n\r\nnamespace A\\B;\r\n\r\necho 1;",
"<?php\r\ndeclare(strict_types=1);\r\n\r\nnamespace A\\B;\r\n\r\necho 1;",
Expand Down

0 comments on commit f031f23

Please sign in to comment.