Nette Documentation Preview

syntax
Upgrading
*********


Migrating from 3.x to 4.0
=========================

Minimum required PHP version is 8.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 |utils:type]. 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.


Finder
------

Finder has moved to the `nette/utils` package, remove the original package:

```shell
composer remove nette/finder
```

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*')`.

When directory you are searching in does not exist, `Nette\InvalidStateException` is thrown (instead of `UnexpectedValueException`).

Upgrading

Migrating from 3.x to 4.0

Minimum required PHP version is 8.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.

Finder

Finder has moved to the nette/utils package, remove the original package:

composer remove nette/finder

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*').

When directory you are searching in does not exist, Nette\InvalidStateException is thrown (instead of UnexpectedValueException).