VanillaCommand: fix bogus mixed typehints

This commit is contained in:
Dylan K. Taylor 2021-08-15 19:32:33 +01:00
parent 60ac76a3bc
commit dfc82f6820
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 2 additions and 18 deletions

View File

@ -35,10 +35,7 @@ abstract class VanillaCommand extends Command{
public const MAX_COORD = 30000000;
public const MIN_COORD = -30000000;
/**
* @param mixed $value
*/
protected function getInteger(CommandSender $sender, $value, int $min = self::MIN_COORD, int $max = self::MAX_COORD) : int{
protected function getInteger(CommandSender $sender, string $value, int $min = self::MIN_COORD, int $max = self::MAX_COORD) : int{
$i = (int) $value;
if($i < $min){
@ -60,10 +57,7 @@ abstract class VanillaCommand extends Command{
return $this->getDouble($sender, $input, $min, $max);
}
/**
* @param mixed $value
*/
protected function getDouble(CommandSender $sender, $value, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{
protected function getDouble(CommandSender $sender, string $value, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{
$i = (double) $value;
if($i < $min){

View File

@ -50,16 +50,6 @@ parameters:
count: 2
path: ../../../src/VersionInfo.php
-
message: "#^Cannot cast mixed to float\\.$#"
count: 1
path: ../../../src/command/defaults/VanillaCommand.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: ../../../src/command/defaults/VanillaCommand.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1