Skip to content

Commit

Permalink
Update Mace.php
Browse files Browse the repository at this point in the history
  • Loading branch information
KnosTx committed Sep 9, 2024
1 parent 0fca75b commit d1f3735
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/item/Mace.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
use pocketmine\block\Block;
use pocketmine\block\BlockToolType;
use pocketmine\entity\Entity;
use pocketmine\event\entity\EntityDamageByEntityEvent;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityDemageByEntityEvent;
use pocketmine\math\Vector3;

class Mace extends Tool{
Expand Down Expand Up @@ -63,10 +63,10 @@ public function onDestroyBlock(Block $block, array &$returnedItems) : bool{
return false;
}

private function getDemager() : EntityDamageByEntityEvent{
return $this->demager;
private function getDamager() : ?EntityDamageByEntityEvent{

Check failure on line 66 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 / PHPStan analysis

Method pocketmine\item\Mace::getDamager() is unused.

Check failure on line 66 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 / PHPStan analysis

Method pocketmine\item\Mace::getDamager() is unused.

Check failure on line 66 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 / PHPStan analysis

Method pocketmine\item\Mace::getDamager() is unused.
return $this->damager ?? null;
}

public function onAttackEntity(EntityDamageByEntityEvent $demager, Entity $victim, array &$returnedItems) : bool{

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 / PHPStan analysis

Method pocketmine\item\Mace::onAttackEntity() has parameter $returnedItems with no value type specified in iterable type array.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 / PHPStan analysis

Parameter #1 $demager (pocketmine\event\entity\EntityDamageByEntityEvent) of method pocketmine\item\Mace::onAttackEntity() is not contravariant with parameter #1 $victim (pocketmine\entity\Entity) of method pocketmine\item\Item::onAttackEntity().

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 / PHPStan analysis

Parameter #2 $victim (pocketmine\entity\Entity) of method pocketmine\item\Mace::onAttackEntity() is not contravariant with parameter #2 $returnedItems (array) of method pocketmine\item\Item::onAttackEntity().

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 / PHPStan analysis

Parameter #2 $victim of method pocketmine\item\Mace::onAttackEntity() is not passed by reference but parameter #2 $returnedItems of method pocketmine\item\Item::onAttackEntity() is passed by reference.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 / PHPStan analysis

Parameter #3 $returnedItems of method pocketmine\item\Mace::onAttackEntity() is not optional.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 / PHPStan analysis

Method pocketmine\item\Mace::onAttackEntity() has parameter $returnedItems with no value type specified in iterable type array.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 / PHPStan analysis

Parameter #1 $demager (pocketmine\event\entity\EntityDamageByEntityEvent) of method pocketmine\item\Mace::onAttackEntity() is not contravariant with parameter #1 $victim (pocketmine\entity\Entity) of method pocketmine\item\Item::onAttackEntity().

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 / PHPStan analysis

Parameter #2 $victim (pocketmine\entity\Entity) of method pocketmine\item\Mace::onAttackEntity() is not contravariant with parameter #2 $returnedItems (array) of method pocketmine\item\Item::onAttackEntity().

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 / PHPStan analysis

Parameter #2 $victim of method pocketmine\item\Mace::onAttackEntity() is not passed by reference but parameter #2 $returnedItems of method pocketmine\item\Item::onAttackEntity() is passed by reference.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 / PHPStan analysis

Parameter #3 $returnedItems of method pocketmine\item\Mace::onAttackEntity() is not optional.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 / PHPStan analysis

Method pocketmine\item\Mace::onAttackEntity() has parameter $returnedItems with no value type specified in iterable type array.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 / PHPStan analysis

Parameter #1 $demager (pocketmine\event\entity\EntityDamageByEntityEvent) of method pocketmine\item\Mace::onAttackEntity() is not contravariant with parameter #1 $victim (pocketmine\entity\Entity) of method pocketmine\item\Item::onAttackEntity().

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 / PHPStan analysis

Parameter #2 $victim (pocketmine\entity\Entity) of method pocketmine\item\Mace::onAttackEntity() is not contravariant with parameter #2 $returnedItems (array) of method pocketmine\item\Item::onAttackEntity().

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 / PHPStan analysis

Parameter #2 $victim of method pocketmine\item\Mace::onAttackEntity() is not passed by reference but parameter #2 $returnedItems of method pocketmine\item\Item::onAttackEntity() is passed by reference.

Check failure on line 70 in src/item/Mace.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 / PHPStan analysis

Parameter #3 $returnedItems of method pocketmine\item\Mace::onAttackEntity() is not optional.
$damageEvent = $victim->getLastDamageCause();

Expand Down

0 comments on commit d1f3735

Please sign in to comment.