Указываем тип данных на выходе из функций.

This commit is contained in:
Igor Barkov (iwork) 2021-01-25 19:59:55 +02:00
parent 2f977fab00
commit f11e9ba454
1 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ class Magic
{
protected $status;
protected function isVisible($caster, $target)
protected function isVisible($caster, $target):bool
{
if ($caster->battle != $target->battle || $caster->room != $target->room) {
$this->status = 'Вы не видите цель!';
@ -15,7 +15,7 @@ class Magic
}
}
protected function isNotDead($caster)
protected function isNotDead($caster):bool
{
if ($caster->health < 1) {
$this->status = 'Вы мертвы!';
@ -25,7 +25,7 @@ class Magic
}
}
protected function enoughMana($caster)
protected function enoughMana($caster):bool
{
if ($caster->mana < 1) {
$this->status = 'Недостаточно пыли!';
@ -35,7 +35,7 @@ class Magic
}
}
protected function isNotInBattle($caster)
protected function isNotInBattle($caster):bool
{
if ($caster->battle) {
$this->status = 'Невозможно применить в поединке!';