Skip to content

Update dependency nette/utils to v4 - #217

Open
renovate[bot] wants to merge 1 commit into
2.0.xfrom
renovate/nette-utils-4.x
Open

Update dependency nette/utils to v4#217
renovate[bot] wants to merge 1 commit into
2.0.xfrom
renovate/nette-utils-4.x

Conversation

@renovate

@renovaterenovateBot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

PackageChangeAgeConfidence
nette/utils (source)^3.2.5^4.0.0ageconfidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

nette/utils (nette/utils)

v4.1.5: Released version 4.1.5

Compare Source

This release adds an immutable date/time class, makes file writes safer, background processes possible, and Finder masks smarter. Plus a couple of bug fixes worth picking up.

✨ New Features

  • DateTimeImmutable – a new immutable counterpart to Nette\Utils\DateTime. It extends PHP's \DateTimeImmutable with strict validation (invalid dates and times throw instead of being silently rolled over), convenient factories from() and fromParts(), DST-safe relative modifications, and JSON serialization.
  • FileSystem::writeAtomic() – writes a file atomically via a temporary file and rename, so a concurrent reader never sees it partially written or truncated. Ideal for caches and generated configs.
  • Process::detach() – lets a process keep running in the background after the Process object is destroyed, instead of being killed by the destructor. Output must go to a file or be discarded, since nobody reads the pipes after detaching.
  • Process – on Windows with PHP 8.5, captured output now flows through real pipes instead of temporary files, thanks to the fixed stream_select().
  • Html::fragment() and add() – create a nameless element pre-filled with children, or append children to an existing element. Unlike addHtml(), plain strings are escaped by default and nulls are skipped.
  • Html::text() and Html::html() – new static factories replacing fromText() and fromHtml(), which are now deprecated.
  • Finder – the mask now fully drives recursion: **/foo together with in() searches recursively, and the ** short form expands like in zsh, so test/** means test/**/* and **.c means **/*.c (previously such masks silently degraded to a single *).
  • Finder – a trailing slash in a find() mask matches directories only: find('temp/').
  • Finder::exclude() – now uses the same mask grammar as find(): **.txt works, ./ anchors to the search root, and a trailing /, /* or /** controls whether the directory itself, its contents, or both are excluded.
  • Finder – paths are no longer normalized to forward slashes; they stay in their native form, which also fixes corruption of backslashes in POSIX file names. Note: on Windows, returned paths may now contain backslashes where they used to be unified.

🐛 Bug Fixes

  • ArrayList::prepend() – no longer misbehaves on an empty list.
  • Validators::isUrl() – now rejects malformed IPv4 addresses with octets above 255, so nonsense like http://999.1.1.1 no longer passes as a valid URL.
  • Strings::compare() – tolerates invalid UTF-8 instead of failing when the Normalizer gives up.
  • Strings::length() – the fallback used when neither mbstring nor iconv is available no longer relies on the deprecated utf8_decode(), so it stays quiet on PHP 8.2+.
  • Finder::exclude()exclude('subdir/') silently excluded nothing due to a greedy regex; the trailing /, /* and /** variants now work as documented.

v4.1.4: Released version 4.1.4

Compare Source

  • Process – a new class for starting and controlling external processes: read their output, feed them input, pipe one process into another, wait for completion, terminate, and check exit codes. Process::runExecutable() passes arguments as an array so there's zero shell involvement and no risk of shell injection, while Process::runCommand() is there when you really do want the shell. Comes with timeouts, incremental output consumption (consumeStdOutput() / consumeStdError()), and works on Windows too.
  • FileSystem::isValidFilename() – quickly check whether a string is a safe, cross-platform filename: it rejects path separators, control and reserved characters, trailing dots or spaces, and Windows device names like CON or LPT1.
  • Image::fromFile() and Image::fromString() now accept an optional $warnings parameter – pass it in and any GD warnings are handed back to you as a string instead of being emitted as a PHP warning, so you can log or display them on your own terms.

v4.1.3: Released version 4.1.3

Compare Source

A maintenance release focused on code quality: stricter types, better PHPDoc annotations, and PHPStan now runs as a mandatory CI check. No breaking changes.

v4.1.1: Released version 4.1.1

Compare Source

  • Html::addText() accepts int|null for back compatibility [Closes #​332][Closes #​333]

v4.1.0: Released version 4.1.0

Compare Source

  • requires PHP 8.2
  • DateTime: strict behavior (BC break)
  • Strings::webalize() requires INTL extension
  • StaticClass: is not overriding __callStatic()

v4.0.10: Released version 4.0.10

Compare Source

  • added Type::with()
  • added Type::fromValue()
  • added Helpers::splitClassName()
  • added Iterables::repeatable()
  • Finder: is_file() does not work with symlinks under Windows

v4.0.9: Released version 4.0.9

Compare Source

support for PHP 8.5

v4.0.8: Released version 4.0.8

Compare Source

  • support for PHP 8.5
  • Strings::trim() trims Line Separator and Ideographic Space (#​326)
  • DateTime: fixed parsing 'ago' modifier #​327
  • DateTime::relativeToSeconds() checks for error
  • optimized global function calls

v4.0.7: Released version 4.0.7

Compare Source

  • DateTime: constructor and modify() correctly handle the relative time even if the daylight saving time is changed
  • DateTime: added static method relativeToSeconds() for converting relative time string to seconds
  • DateTime: triggers a warning when time overflow occurs

v4.0.6: Released version 4.0.6

Compare Source

  • Image: catches all errors during saving
  • added Helpers::IsWindows
  • added ShouldNotHappenException
  • added FileSystem::resolvePath()#​308
  • tests: improved descriptions
  • exception: use natural explanatory style

v4.0.5: Released version 4.0.5

Compare Source

  • Strings::matchAll(): added option 'lazy'
  • added Arrays::mapWithKeys() & Iterables::mapWithKeys()
  • added Iterables::memoize() & toIterator()
  • Image: GD extension detection added
  • support for PHP 8.4

v4.0.4: Released version 4.0.4

Compare Source

  • added Iterables
  • added Arrays::firstKey(), lastKey()
  • added Arrays::filter()
  • Arrays::first() & last(): added parameter $else
  • Arrays::first() & last(): added parameter $predicate #​305
  • added Image::getSupportedTypes()
  • Arrays: improved phpDoc
  • utilizes Random\Randomizer in PHP 8.3
  • StaticClass: fixed compatibility with PHP 8.3.2
  • Strings::trim() trims unicode spaces and ZWSP (#​304)

v4.0.3: Released version 4.0.3

Compare Source

  • added ImageColor, replaces Image::rgb()
  • added Image::rectangleWH(), filledRectangleWH(), calculateTextBox()
  • Type: fixed resolving of 'static' nette/di#295

v4.0.2: Released version 4.0.2

Compare Source

  • Strings::length() uses mbstring, iconv and then utf8_decode #​299
  • Finder: getType() replaced with isDir() / isFile()
  • StaticClass: constructor is private nette/di#292
  • Arrays: add generic type declaration for some(), every() and map() (#​298)
  • FileSystem: can be used as instance

v4.0.1: Released version 4.0.1

Compare Source

  • support for PHP 8.3
  • added Image::isTypeSupported()
  • added enum ImageType
  • Finder: collect() returns list
  • Finder: improved exception when directory is missing
  • Finder: default mask is '*'
  • improved type annotations (#​290)
  • Callback::unwrap() returns correct class name for private methods

v4.0.0: Released version 4.0.0 🥳

Compare Source

  • uses PHP 8 featurs
  • includes a completely rewritten Finder
  • PascalCase constants
  • Strings: added support for UTF-8 offsets in regexp
  • Translator: improved interface, accepts and returns string|Stringable [Closes #​231]
  • ArrayHash & ArrayList: support iteration with reference (#​289)

new methods:

  • Nette\Utils\Json::decodeFile() reads JSON from a file
  • Nette\Utils\FileSystem::unixSlashes() & platformSlashes() converts slashes to Unix slashes
  • Nette\Utils\Strings::ord(), unixNewLines() & platformNewLines()
  • Nette\Utils\Helpers::compare() compare using the operator

new parameters:

  • Nette\Utils\Strings::split() added parameter $limit
  • Nette\Utils\Strings::replace() added parameters $captureOffset, $unmatchedAsNull
  • Nette\Utils\Strings, Nette\Utils\Arrays, Nette\Utils\Json: flags replaced with parameters

removed

  • Reflection: removed obsolete getReturnType(), getParameterType(), getPropertyType() (BC break)

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, only on Monday (* 0-3 * * 1)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovateBotforce-pushed the renovate/nette-utils-4.x branch from 31fda83 to f7c7946CompareAugust 4, 2026 13:56
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants