From fede6b8234b067946bcb2f3774f4b090c566ac2c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 3 Dec 2019 12:06:57 +0000 Subject: [PATCH] protocol: fixed static analysis warnings in MetadataProperty::equals() implementations --- .../mcpe/protocol/types/entity/BlockPosMetadataProperty.php | 2 +- .../mcpe/protocol/types/entity/CompoundTagMetadataProperty.php | 2 +- .../mcpe/protocol/types/entity/FloatMetadataProperty.php | 2 +- .../mcpe/protocol/types/entity/IntegerishMetadataProperty.php | 2 +- .../mcpe/protocol/types/entity/StringMetadataProperty.php | 2 +- src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php b/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php index 5bf56214f..ebf88b110 100644 --- a/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php @@ -60,6 +60,6 @@ final class BlockPosMetadataProperty implements MetadataProperty{ } public function equals(MetadataProperty $other) : bool{ - return $other instanceof $this and $other->value->equals($this->value); + return $other instanceof self and $other->value->equals($this->value); } } diff --git a/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php b/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php index 5bd0ec22d..705779fd8 100644 --- a/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/CompoundTagMetadataProperty.php @@ -51,7 +51,7 @@ final class CompoundTagMetadataProperty implements MetadataProperty{ } public function equals(MetadataProperty $other) : bool{ - return $other instanceof $this and $other->value->equals($this->value); + return $other instanceof self and $other->value->equals($this->value); } public static function read(NetworkBinaryStream $in) : self{ diff --git a/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php b/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php index 6554af0a0..faf256111 100644 --- a/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/FloatMetadataProperty.php @@ -49,7 +49,7 @@ final class FloatMetadataProperty implements MetadataProperty{ } public function equals(MetadataProperty $other) : bool{ - return $other instanceof $this and $other->value === $this->value; + return $other instanceof self and $other->value === $this->value; } public static function read(NetworkBinaryStream $in) : self{ diff --git a/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php b/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php index a36f3c7dd..dad794140 100644 --- a/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/IntegerishMetadataProperty.php @@ -49,7 +49,7 @@ trait IntegerishMetadataProperty{ } public function equals(MetadataProperty $other) : bool{ - return $other instanceof $this and $other->value === $this->value; + return $other instanceof self and $other->value === $this->value; } public static function buildFromFlags(array $flags) : self{ diff --git a/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php b/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php index daf781c3c..846410a00 100644 --- a/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/StringMetadataProperty.php @@ -49,6 +49,6 @@ final class StringMetadataProperty implements MetadataProperty{ } public function equals(MetadataProperty $other) : bool{ - return $other instanceof $this and $other->value === $this->value; + return $other instanceof self and $other->value === $this->value; } } diff --git a/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php b/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php index 33fee7162..7115d42c5 100644 --- a/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php +++ b/src/network/mcpe/protocol/types/entity/Vec3MetadataProperty.php @@ -57,6 +57,6 @@ class Vec3MetadataProperty implements MetadataProperty{ } public function equals(MetadataProperty $other) : bool{ - return $other instanceof $this and $other->value->equals($this->value); + return $other instanceof self and $other->value->equals($this->value); } }