Upgrading
Migrating from 3.x to 4.0
The minimum required PHP version is 8.0.
The Nette\Utils\Reflection
class provided methods getParameterType()
, getPropertyType()
,
and getReturnType()
for working with types. These methods were created when PHP didn't have union, intersection, or
the newest disjunctive normal form types, with which they no longer work correctly. They have been 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()
now works correctly.
The variable Nette\Utils\Html::$xhtml
has been removed.
Finder
Finder has moved to the nette/utils
package. Remove the original nette/finder
package:
composer remove nette/finder
On Linux, Finder now operates in case-sensitive mode by default.
In the previous version, the exclude()
and filter()
methods behaved differently depending on whether
they were called before or after from()
or in()
. This is no longer the case;
exclude()
and filter()
always function the same way. The behavior of filter()
called
after from()
/in()
is now handled by the new method descentFilter()
.
Finder no longer implements the Countable
interface.
A string starting with a slash in Finder::findFiles('/f*')
is now considered an absolute path. If you intended a
relative path from the current directory, replace it with, for example, Finder::findFiles('./f*')
.
If a directory you are searching in does not exist, Nette\InvalidStateException
is thrown (instead of the previous
UnexpectedValueException
).