From 47503d84c234d3fbc6d02c140a54a126abe76317 Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Sun, 13 Jul 2014 13:43:09 +0800 Subject: [PATCH] Added doccomment for Vector3::add() and Vector3::subtract() This is to avoid IDEs thinking that argument 1 for `Vector3::subtract()` must be an int. (But the fact is `Vector3` is OK too) --- src/pocketmine/math/Vector3.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/math/Vector3.php b/src/pocketmine/math/Vector3.php index 736c0ceb5..b44c0896c 100644 --- a/src/pocketmine/math/Vector3.php +++ b/src/pocketmine/math/Vector3.php @@ -80,6 +80,11 @@ class Vector3{ return $this->z; } + /** + * @param Vector3|int $x + * @param int $y + * @param int $z + */ public function add($x, $y = 0, $z = 0){ if($x instanceof Vector3){ return $this->add($x->x, $x->y, $x->z); @@ -88,6 +93,12 @@ class Vector3{ } } + /** + * @param Vector3|int $x + * @param int $y + * @param int $z + * @return Vector3 + */ public function subtract($x = 0, $y = 0, $z = 0){ if($x instanceof Vector3){ return $this->add(-$x->x, -$x->y, -$x->z); @@ -190,4 +201,4 @@ class Vector3{ return "Vector3(x=" . $this->x . ",y=" . $this->y . ",z=" . $this->z . ")"; } -} \ No newline at end of file +}