PhpStorm automated formatting (#11)

* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
This commit is contained in:
SOFe
2016-10-03 19:05:48 +08:00
committed by GitHub
parent 2b6d058760
commit 58ff381557
77 changed files with 266 additions and 264 deletions

View File

@ -23,6 +23,7 @@
* Various Utilities used around the code
*/
namespace pocketmine\utils;
use pocketmine\entity\Entity;
class Binary{

View File

@ -20,6 +20,7 @@
*/
namespace pocketmine\utils;
use pocketmine\scheduler\FileWriteTask;
use pocketmine\Server;

View File

@ -189,7 +189,7 @@ class MainLogger extends \AttachableThreadedLogger{
$threadName = (new \ReflectionClass($thread))->getShortName() . " thread";
}
$message = TextFormat::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] ". TextFormat::RESET . $color ."[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
$message = TextFormat::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] " . TextFormat::RESET . $color . "[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
$cleanMessage = TextFormat::clean($message);
if(!Terminal::hasFormattingCodes()){

View File

@ -71,7 +71,7 @@ class Random{
$this->seed = $seed;
$this->x = self::X ^ $seed;
$this->y = self::Y ^ ($seed << 17) | (($seed >> 15) & 0x7fffffff) & 0xffffffff;
$this->z = self::Z ^ ($seed << 31) | (($seed >> 1) & 0x7fffffff) & 0xffffffff;
$this->z = self::Z ^ ($seed << 31) | (($seed >> 1) & 0x7fffffff) & 0xffffffff;
$this->w = self::W ^ ($seed << 18) | (($seed >> 14) & 0x7fffffff) & 0xffffffff;
}
@ -100,7 +100,7 @@ class Random{
$this->y = $this->z;
$this->z = $this->w;
$this->w = ($this->w ^ (($this->w >> 19) & 0x7fffffff)
^ ($t ^ (($t >> 8) & 0x7fffffff))) & 0xffffffff;
^ ($t ^ (($t >> 8) & 0x7fffffff))) & 0xffffffff;
return $this->w;
}

View File

@ -59,7 +59,7 @@ abstract class TextFormat{
* @return array
*/
public static function tokenize($string){
return preg_split("/(". TextFormat::ESCAPE ."[0123456789abcdefklmnor])/", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
return preg_split("/(" . TextFormat::ESCAPE . "[0123456789abcdefklmnor])/", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
}
/**
@ -72,7 +72,7 @@ abstract class TextFormat{
*/
public static function clean($string, $removeFormat = true){
if($removeFormat){
return str_replace(TextFormat::ESCAPE, "", preg_replace(["/". TextFormat::ESCAPE ."[0123456789abcdefklmnor]/", "/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/"], "", $string));
return str_replace(TextFormat::ESCAPE, "", preg_replace(["/" . TextFormat::ESCAPE . "[0123456789abcdefklmnor]/", "/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/"], "", $string));
}
return str_replace("\x1b", "", preg_replace("/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/", "", $string));
}