Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions config/set/named-args.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Rector\CodeQuality\Rector\FuncCall\SortCallLikeNamedArgsRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\MethodCall\RemoveNullNamedArgOnNullDefaultParamRector;
use Rector\NetteUtils\Rector\StaticCall\UtilsJsonStaticCallNamedArgRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rules([
Expand All @@ -19,6 +18,5 @@
SortCallLikeNamedArgsRector::class,
SortAttributeNamedArgsRector::class,
ExplicitAttributeNamedArgsRector::class,
UtilsJsonStaticCallNamedArgRector::class,
]);
};
12 changes: 0 additions & 12 deletions config/set/nette-utils/composer-based.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ final class Option
*/
public const string DEPRECATED_ATTRIBUTES_SETS_ARGS = 'deprecated_attributes_sets_args';

/**
* @internal For reporting deprecated withComposerBased() arguments
*/
public const string DEPRECATED_COMPOSER_BASED_ARGS = 'deprecated_composer_based_args';

/**
* @internal For collect skipped start with short open tag files to be reported
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ public function withComposerBased(
$this->sets[] = SymfonySetList::COMPOSER_BASED;
}

// deprecated, no longer applied - it only added named args to 2 methods of a single package
if ($netteUtils) {
// single set, as every rule inside is bound to the installed nette/utils version on its own
$this->sets[] = SetList::NETTE_UTILS_COMPOSER_BASED;
SimpleParameterProvider::addParameter(Option::DEPRECATED_COMPOSER_BASED_ARGS, 'netteUtils');
}

return $this;
Expand Down
1 change: 1 addition & 0 deletions src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->deprecatedRulesReporter->reportDeprecatedCacheMetaExtensions();
$this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods();
$this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs();
$this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs();

$this->missConfigurationReporter->reportSkippedNeverRegisteredRules();
$this->missConfigurationReporter->reportSkippedNonRectorClasses();
Expand Down
15 changes: 15 additions & 0 deletions src/Reporting/DeprecatedRulesReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ public function reportDeprecatedAttributesSetsArgs(): void
}
}

public function reportDeprecatedComposerBasedArgs(): void
{
/** @var string[] $deprecatedComposerBasedArgs */
$deprecatedComposerBasedArgs = SimpleParameterProvider::provideArrayParameter(
Option::DEPRECATED_COMPOSER_BASED_ARGS
);

foreach (array_unique($deprecatedComposerBasedArgs) as $deprecatedComposerBasedArg) {
$this->symfonyStyle->warning(sprintf(
'The "->withComposerBased(%s: true)" argument is deprecated and no longer applied. It only added named args to 2 methods of a single package, register the rule directly if needed.',
$deprecatedComposerBasedArg
));
}
}

public function reportDeprecatedRectorUnsupportedMethods(): void
{
// to be added in related PR
Expand Down
6 changes: 0 additions & 6 deletions src/Set/ValueObject/SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ final class SetList

public const string NAMED_ARGS = __DIR__ . '/../../../config/set/named-args.php';

/**
* Applies to any installed nette/utils version, the rules inside are bound
* to the exact version they are available from
*/
public const string NETTE_UTILS_COMPOSER_BASED = __DIR__ . '/../../../config/set/nette-utils/composer-based.php';

/**
* Opinionated rules that match rector coding standard
*/
Expand Down
Loading