-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PhpStorm inspections #41
Conversation
Fixed some minor bugs and dropped some obsolete code pocketmine\level\generator namespace is ignored in this commit
@@ -1528,6 +1528,7 @@ public function close(){ | |||
* @param int $type | |||
* @param mixed $value | |||
* | |||
* @param bool $send |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems misplaced
@@ -453,7 +453,7 @@ public function sendSlot($index, $target){ | |||
* @return Human|Player | |||
*/ | |||
public function getHolder(){ | |||
return parent::getHolder(); | |||
return $this->holder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This override only seems to be here for the documentation. Pretty much pointless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already other instances of these overrides. They should not affect performance, and they are indeed necessary for IDEs to identify the type (for autocompletion) in a loosely typed language like PHP.
My change only carries out premature optimization to the method, and does not really change anything that can be worse.
use pocketmine\nbt\tag\ShortTag; | ||
use pocketmine\nbt\tag\StringTag; | ||
use pocketmine\nbt\tag\Tag; | ||
use pocketmine\utils\Binary; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the preprocessor again. Please make corrections.
@@ -589,6 +590,10 @@ public function clearCustomName(){ | |||
return $this; | |||
} | |||
|
|||
/** | |||
* @param $name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably needs to be changed to @param string $name
@@ -28,7 +28,7 @@ | |||
use pocketmine\utils\PluginException; | |||
|
|||
abstract class MetadataStore{ | |||
/** @var \WeakMap[] */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to comment this line out instead.
@@ -180,7 +180,7 @@ public function shutdown(){ | |||
protected function send($message, $level, $prefix, $color){ | |||
$now = time(); | |||
|
|||
$thread = \Thread::getCurrentThread(); | |||
$thread = Thread::getCurrentThread(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is for better IDE autocompletion. You might want to revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh?
Obsoleted by #87 |
Fixed some minor bugs and dropped some obsolete code
pocketmine\level\generator namespace is ignored in this commit
Also recommended to merge into 0.16 branch