-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to disable arguments split based on number of arguments
- Loading branch information
1 parent
6104e84
commit 7751926
Showing
3 changed files
with
177 additions
and
1 deletion.
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
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
100 changes: 100 additions & 0 deletions
100
tests/UseCase/LineBreakBetweenMethodsWithNoSplitOnNumberOfArgs.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 |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace tests\UseCase; | ||
|
||
use PedroTroller\CS\Fixer\CodingStyle\LineBreakBetweenMethodArgumentsFixer; | ||
use tests\UseCase; | ||
|
||
class LineBreakBetweenMethodsWithNoSplitOnNumberOfArgs implements UseCase | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFixer() | ||
{ | ||
$fixer = new LineBreakBetweenMethodArgumentsFixer(); | ||
|
||
$fixer->configure([ | ||
'max-args' => false, | ||
'max-length' => 90, | ||
]); | ||
|
||
return $fixer; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getRawScript() | ||
{ | ||
return <<<'PHP' | ||
<?php | ||
namespace Project\TheNamespace; | ||
class TheClass | ||
{ | ||
public function fun1($arg1, array $arg2 = [], \ArrayAccess $arg3 = null, $foo = 'bar') | ||
{ | ||
return; | ||
} | ||
public function fun2( | ||
$arg1, | ||
array $arg2 = [] | ||
) { | ||
return; | ||
} | ||
public function fun4($foo, $bar, $bar, $boolean = true, $integer = 1, $string = 'string') | ||
{ | ||
} | ||
} | ||
PHP; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getExpectation() | ||
{ | ||
return <<<'PHP' | ||
<?php | ||
namespace Project\TheNamespace; | ||
class TheClass | ||
{ | ||
public function fun1($arg1, array $arg2 = [], \ArrayAccess $arg3 = null, $foo = 'bar') | ||
{ | ||
return; | ||
} | ||
public function fun2($arg1, array $arg2 = []) | ||
{ | ||
return; | ||
} | ||
public function fun4( | ||
$foo, | ||
$bar, | ||
$bar, | ||
$boolean = true, | ||
$integer = 1, | ||
$string = 'string' | ||
) { | ||
} | ||
} | ||
PHP; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getMinSupportedPhpVersion() | ||
{ | ||
return 70100; | ||
} | ||
} |