Skip to content

[remove] Drop nette/utils set, deprecate withComposerBased(netteUtils:) argument - #8329

Merged
TomasVotruba merged 1 commit into
mainfrom
drop-nette-utils-set
Aug 9, 2026
Merged

[remove] Drop nette/utils set, deprecate withComposerBased(netteUtils:) argument#8329
TomasVotruba merged 1 commit into
mainfrom
drop-nette-utils-set

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Drops the nette/utils set and its single rule, and deprecates the netteUtils: argument of withComposerBased().

UtilsJsonStaticCallNamedArgRector was the only third-party-library rule in rector-src. Symfony, Doctrine and PHPUnit rules all live in their own packages; Nette had an exception with no package behind it. What it delivered:

 use Nette\Utils\Json;

-$encodedJson = Json::encode($data, true);
-$decodedJson = Json::decode($json, true);
+$encodedJson = Json::encode($data, pretty: true);
+$decodedJson = Json::decode($json, forceArrays: true);

Readability only — the positional form still works on nette/utils 4.0, nothing was being repaired. For that, core carried 4 pieces of public API: the rule, SetList::NETTE_UTILS_COMPOSER_BASED, config/set/nette-utils/, and a withComposerBased() argument. It was also registered in the named-args set.

Anyone who still wants it can register the rule directly.

Scope note: only the netteUtils: argument is deprecated. withComposerBased() itself is untouched and keeps working for twig, doctrine, phpunit, symfony, laravel and drupal — 137 rules across the sibling packages implement ComposerPackageConstraintInterface and depend on it.

The argument stays as a no-op with a runtime warning, following the withAttributesSets(symfonyRoute:) precedent:

[WARNING] The "->withComposerBased(netteUtils: 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.

Changes:

  • removed rules/NetteUtils/ + its tests, config/set/nette-utils/, SetList::NETTE_UTILS_COMPOSER_BASED
  • removed the rule from config/set/named-args.php
  • added Option::DEPRECATED_COMPOSER_BASED_ARGS + DeprecatedRulesReporter::reportDeprecatedComposerBasedArgs(), wired into ProcessCommand

NetteClassName::JSON stays, it is still used by AddReturnDocblockForJsonArrayRector.

…:) argument

The only third-party-library rule in core, delivering a named-argument label on 2 methods of one package. The netteUtils: argument is kept as a no-op with a runtime warning, following the withAttributesSets() precedent.
@TomasVotruba
TomasVotruba enabled auto-merge (squash) August 9, 2026 16:42
@TomasVotruba
TomasVotruba merged commit 7ad3ac0 into main Aug 9, 2026
64 checks passed
@TomasVotruba
TomasVotruba deleted the drop-nette-utils-set branch August 9, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant