Merge branch 'release/3.4'

This commit is contained in:
Dylan K. Taylor
2018-11-03 16:58:19 +00:00
4 changed files with 5 additions and 7 deletions

View File

@ -56,7 +56,7 @@ class ChunkRequestTask extends AsyncTask{
$stream = new PacketStream(); $stream = new PacketStream();
$stream->putPacket($pk); $stream->putPacket($pk);
$this->setResult(NetworkCompression::compress($stream->buffer, $this->compressionLevel), false); $this->setResult(NetworkCompression::compress($stream->buffer, $this->compressionLevel));
} }
public function onCompletion() : void{ public function onCompletion() : void{

View File

@ -42,7 +42,7 @@ class CompressBatchTask extends AsyncTask{
} }
public function onRun() : void{ public function onRun() : void{
$this->setResult(NetworkCompression::compress($this->data, $this->level), false); $this->setResult(NetworkCompression::compress($this->data, $this->level));
} }
public function onCompletion() : void{ public function onCompletion() : void{

View File

@ -107,11 +107,9 @@ abstract class AsyncTask extends Collectable{
/** /**
* @param mixed $result * @param mixed $result
* @param bool $serialize
*/ */
public function setResult($result, bool $serialize = true) : void{ public function setResult($result) : void{
$this->result = $serialize ? serialize($result) : $result; $this->result = ($this->serialized = !is_scalar($result)) ? serialize($result) : $result;
$this->serialized = $serialize;
} }
public function setSubmitted() : void{ public function setSubmitted() : void{

View File

@ -58,7 +58,7 @@ class UpdateCheckTask extends AsyncTask{
isset($response["download_url"]) isset($response["download_url"])
){ ){
$response["details_url"] = $response["details_url"] ?? null; $response["details_url"] = $response["details_url"] ?? null;
$this->setResult($response, true); $this->setResult($response);
}elseif(isset($response["error"])){ }elseif(isset($response["error"])){
$this->error = $response["error"]; $this->error = $response["error"];
}else{ }else{