Skip to content

Commit

Permalink
added utils/upgrading
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 18, 2024
1 parent f3ceee7 commit 6f294f1
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/cs/@home.texy
Expand Up @@ -41,3 +41,6 @@ composer require nette/utils
| Nette Utils 2.5 | PHP 5.6 – 8.0

Platí pro poslední patch verze.


Pokud aktualizujte balíček na novější verzi, podívejte se na stránku [upgrade|upgrading].
32 changes: 32 additions & 0 deletions utils/cs/upgrading.texy
@@ -0,0 +1,32 @@
Upgrade
*******


Přechod z verze 3.x na 4.0
==========================

Minimální požadovaná verze PHP je 8.0.

Třída `Nette\Utils\Reflection` poskytovala metody pro práci s typy `getParameterType()`, `getPropertyType()` a `getReturnType()`. Metody vznikly v době, kdy PHP nemělo union, intersection nebo nejnovější disjunctive normal form typy, se kterými už nefungují a nahradila je [třída Type |utils:type]. Od verze 4.0 jsou tyto metody odstraněné.

Metoda `Nette\Utils\Reflection::getParameterDefaultValue()` je deprecated, protože nativní `ReflectionParameter::getDefaultValue()` už funguje správně.

Zrušená je proměnná `Nette\Utils\Html::$xhtml`.


Finder
------

Finder se přestěhoval do balíčku `nette/utils`, původní odstraňte:

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

Na Linuxu se nově chová v režimu case-sensitive.

V předchozí verzi platilo, že metody `exclude()` a `filter()` fungovaly jinak, když byly zavolány **před** `from()` resp. `in()` a **po** ní. Tohle už neplatí, `exclude()` a `filter()` fungují vždy stejně. Dřívější `filter()` volaný *až po* nahradila nová metoda `descentFilter()`.

Finder již neimplementuje rozhraní Countable.

Řetězec začínající lomítkem ve `Finder::findFiles('/f*')` se nově považuje za absolutní cestu, je potřeba ho nahradit např. za `Finder::findFiles('./f*')`.
3 changes: 3 additions & 0 deletions utils/en/@home.texy
Expand Up @@ -41,3 +41,6 @@ composer require nette/utils
| Nette Utils 2.5 | PHP 5.6 – 8.0

Applies to the latest patch versions.


If you are upgrading to a newer version, see the [upgrading] page.
32 changes: 32 additions & 0 deletions utils/en/upgrading.texy
@@ -0,0 +1,32 @@
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*')`.

0 comments on commit 6f294f1

Please sign in to comment.