Skip to content
This repository was archived by the owner on Oct 5, 2026. It is now read-only.

Replace nette/utils and webmozart/assert with entropy - #45

Merged
TomasVotruba merged 1 commit into
mainfrom
replace-deps-with-entropy
Sep 30, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
replace-deps-with-entropy

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Slim down direct prod dependencies by reusing what the already-required entropy/entropy provides.

Changes

  • Bump entropy/entropy to ^0.4.17 - this version ships Entropy\Validation\Assert
  • Drop nette/utils from require:
    • Nette\Utils\Json -> Entropy\Utils\Json (decode already returns array, dropped the true arg)
    • Nette\Utils\FileSystem -> Entropy\Utils\FileSystem (dropped the trailing null mode arg)
    • Nette\Utils\Strings::match/replace -> Entropy\Utils\Regex::match/replace
  • Drop webmozart/assert from require:
    • fileExists, allIsInstanceOf map directly to Entropy\Validation\Assert
    • keyExists has no entropy equivalent, replaced with an array_key_exists guard throwing ShouldNotHappenException

Direct prod requires go from 5 to 3. Both dropped packages remain available transitively via dev tooling.

Notes worth a look

  • Regex::match returns [] on no match (nette returned null), so null checks became empty-array / isset guards.
  • Entropy\Utils\FileSystem::write does not create parent directories (nette did), so added ensureDirectoryExists() before writing the cache file in ComposerOutdatedResponseProvider.

PHPUnit, PHPStan (level 8), ECS and Rector all pass locally.

@TomasVotruba
TomasVotruba merged commit c3e93fb into main Sep 30, 2026
9 of 10 checks passed
@TomasVotruba
TomasVotruba deleted the replace-deps-with-entropy branch September 30, 2026 12:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant