Migrating to Version 4.0

This page is being built incrementally as packages are released.

Minimum required PHP version is 8.0

All name changes mentioned in this document mean that the original name obviously still exists and works, it is just marked as deprecated. You may encounter the IDE visually marking them as deprecated.

Utils 4.0

The Nette\Utils\Reflection class provided methods getParameterType(), getPropertyType() and getReturnType() for working with the types. These methods were created when PHP didn't have union, intersection or the newest disjunctive normal form types, which they no longer work with and were replaced by the Type class. As of version 4.0, these methods have been removed.

The method Nette\Utils\Reflection::getParameterDefaultValue() is deprecated because the native ReflectionParameter::getDefaultValue() already works correctly.

The Nette\Utils\Html::$xhtml variable is removed.

To install Nette Utils 4.0 you need to update RobotLoader to version 4 if you are using it, and remove the nette/finder package:

composer remove nette/finder
composer require "nette/utils:^4.0" "nette/robot-loader:^4.0"

Finder 4.0

Finder has moved to the package nette/utils, see Utils 4.0.

On Linux, it now behaves in case-sensitive mode.

In the previous version, the exclude() and filter() methods worked differently when called before from() and in() respectively, and after it. This is no longer the case, exclude() and filter() always work the same. The former filter() called before has been replaced by the new descentFilter() method.

The Finder no longer implements the Countable interface.

A string starting with a slash in Finder::findFiles('/f*') is now considered an absolute path, it should be replaced with e.g. Finder::findFiles('./f*').