|  | 
|  | 1 | +Migrating to Version 4.0 | 
|  | 2 | +************************ | 
|  | 3 | + | 
|  | 4 | +.[note] | 
|  | 5 | +This page is being built incrementally as packages are released. | 
|  | 6 | + | 
|  | 7 | +Minimum required PHP version is 8.0 | 
|  | 8 | + | 
|  | 9 | +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. | 
|  | 10 | + | 
|  | 11 | +/--comment | 
|  | 12 | +Verzí Nette 4.0 se rozumí, že máte tyto balíčky nainstalované ve verze 4.0.*. Ostatní balíčky mohou mít vyšší nebo nižší čísla verzí, kompatibilitu hlídá Composer. | 
|  | 13 | + | 
|  | 14 | +```json | 
|  | 15 | +"require": { | 
|  | 16 | +"nette/application": "4.0.*", | 
|  | 17 | +"nette/bootstrap": "3.2.*", | 
|  | 18 | +"nette/caching": "3.2.*", | 
|  | 19 | +"nette/database": "4.0.*", | 
|  | 20 | +"nette/forms": "4.0.*", | 
|  | 21 | +"nette/http": "4.0.*", | 
|  | 22 | +"nette/security": "4.0.*", | 
|  | 23 | +}, | 
|  | 24 | +``` | 
|  | 25 | +\-- | 
|  | 26 | + | 
|  | 27 | + | 
|  | 28 | +Utils 4.0 | 
|  | 29 | +--------- | 
|  | 30 | + | 
|  | 31 | +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. | 
|  | 32 | + | 
|  | 33 | +The method `Nette\Utils\Reflection::getParameterDefaultValue()` is deprecated because the native `ReflectionParameter::getDefaultValue()` already works correctly. | 
|  | 34 | + | 
|  | 35 | +The `Nette\Utils\Html::$xhtml` variable is removed. | 
|  | 36 | + | 
|  | 37 | +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: | 
|  | 38 | + | 
|  | 39 | +```shell | 
|  | 40 | +composer remove nette/finder | 
|  | 41 | +composer require "nette/utils:^4.0" "nette/robot-loader:^4.0" | 
|  | 42 | +``` | 
|  | 43 | + | 
|  | 44 | + | 
|  | 45 | +Finder 4.0 | 
|  | 46 | +---------- | 
|  | 47 | + | 
|  | 48 | +Finder has moved to the package `nette/utils`, see [Utils 4.0 |#Utils 4.0]. | 
|  | 49 | + | 
|  | 50 | +On Linux, it now behaves in case-sensitive mode. | 
|  | 51 | + | 
|  | 52 | +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. | 
|  | 53 | + | 
|  | 54 | +The Finder no longer implements the Countable interface. | 
|  | 55 | + | 
|  | 56 | +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*')`. | 
|  | 57 | + | 
|  | 58 | + | 
|  | 59 | +{{priority: -5}} | 
0 commit comments