Skip to content

Commit 067a42a

Browse files
committed
upgrade-guide (ru)
1 parent c181b53 commit 067a42a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/ru/upgrade-guide.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,44 @@ class Item extends Model implements Product
9191
return $this->price;
9292
}
9393
```
94+
95+
## 4.0.x → 5.0.x
96+
97+
> Обновляясь с версии 4.x до 5.x Вы теряете строгую типизацию.
98+
> Данная крайность необходима для вычислений с произвольной точностью.
99+
100+
В товарах:
101+
102+
Ваш код в версии 4.x:
103+
```php
104+
public function getAmountProduct(Customer $customer): int { ... }
105+
106+
public function getFeePercent(): float { ... }
107+
108+
public function getMinimalFee(): int { ... }
109+
```
110+
111+
Ваш код в версии 5.x:
112+
```php
113+
public function getAmountProduct(Customer $customer) { ... }
114+
115+
public function getFeePercent() { ... }
116+
117+
public function getMinimalFee() { ... }
118+
```
119+
120+
В сервисе обработки курса валют:
121+
122+
Ваш код в версии 4.x:
123+
```php
124+
protected function rate(Wallet $wallet): float { ... }
125+
126+
public function convertTo(Wallet $wallet): float { ... }
127+
```
128+
129+
Ваш код в версии 5.x:
130+
```php
131+
protected function rate(Wallet $wallet) { ... }
132+
133+
public function convertTo(Wallet $wallet) { ... }
134+
```

0 commit comments

Comments
 (0)