Skip to content

Commit cc1d6ee

Browse files
authored
[sets] kick of named args set (#8013)
1 parent d348b68 commit cc1d6ee

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

config/set/named-args.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\CodeQuality\Rector\Attribute\SortAttributeNamedArgsRector;
6+
use Rector\CodeQuality\Rector\CallLike\AddNameToBooleanArgumentRector;
7+
use Rector\CodeQuality\Rector\CallLike\AddNameToNullArgumentRector;
8+
use Rector\CodeQuality\Rector\FuncCall\SortCallLikeNamedArgsRector;
9+
use Rector\Config\RectorConfig;
10+
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
11+
use Rector\NetteUtils\Rector\StaticCall\UtilsJsonStaticCallNamedArgRector;
12+
13+
return static function (RectorConfig $rectorConfig): void {
14+
$rectorConfig->rules([
15+
AddNameToNullArgumentRector::class,
16+
AddNameToBooleanArgumentRector::class,
17+
RemoveNullArgOnNullDefaultParamRector::class,
18+
SortCallLikeNamedArgsRector::class,
19+
SortAttributeNamedArgsRector::class,
20+
UtilsJsonStaticCallNamedArgRector::class,
21+
]);
22+
};

src/Configuration/RectorConfigBuilder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ public function withPreparedSets(
773773
bool $typeDeclarationDocblocks = false,
774774
bool $privatization = false,
775775
bool $naming = false,
776+
bool $namedArgs = false,
776777
bool $instanceOf = false,
777778
bool $earlyReturn = false,
778779
/** @deprecated */
@@ -801,6 +802,7 @@ public function withPreparedSets(
801802
SetList::TYPE_DECLARATION_DOCBLOCKS => $typeDeclarationDocblocks,
802803
SetList::PRIVATIZATION => $privatization,
803804
SetList::NAMING => $naming,
805+
SetList::NAMED_ARGS => $namedArgs,
804806
SetList::INSTANCEOF => $instanceOf,
805807
SetList::EARLY_RETURN => $earlyReturn,
806808
SetList::CARBON => $carbon,

src/Set/ValueObject/SetList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ final class SetList
2929

3030
public const string NAMING = __DIR__ . '/../../../config/set/naming.php';
3131

32+
public const string NAMED_ARGS = __DIR__ . '/../../../config/set/named-args.php';
33+
3234
/**
3335
* Opinionated rules that match rector coding standard
3436
*/

0 commit comments

Comments
 (0)