Skip to content

Commit

Permalink
upgrade-guide (ru)
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Mar 13, 2020
1 parent c181b53 commit 067a42a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/ru/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,44 @@ class Item extends Model implements Product
return $this->price;
}
```

## 4.0.x → 5.0.x

> Обновляясь с версии 4.x до 5.x Вы теряете строгую типизацию.
> Данная крайность необходима для вычислений с произвольной точностью.
В товарах:

Ваш код в версии 4.x:
```php
public function getAmountProduct(Customer $customer): int { ... }

public function getFeePercent(): float { ... }

public function getMinimalFee(): int { ... }
```

Ваш код в версии 5.x:
```php
public function getAmountProduct(Customer $customer) { ... }

public function getFeePercent() { ... }

public function getMinimalFee() { ... }
```

В сервисе обработки курса валют:

Ваш код в версии 4.x:
```php
protected function rate(Wallet $wallet): float { ... }

public function convertTo(Wallet $wallet): float { ... }
```

Ваш код в версии 5.x:
```php
protected function rate(Wallet $wallet) { ... }

public function convertTo(Wallet $wallet) { ... }
```

0 comments on commit 067a42a

Please sign in to comment.