mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Disallow Threaded objects to be passed as progress parameter
This commit is contained in:
parent
8404ce88bd
commit
d5881dbe83
@ -175,7 +175,7 @@ abstract class AsyncTask extends Collectable{
|
|||||||
* Call this method from {@link AsyncTask#onRun} (AsyncTask execution therad) to schedule a call to
|
* Call this method from {@link AsyncTask#onRun} (AsyncTask execution therad) to schedule a call to
|
||||||
* {@link AsyncTask#onProgressUpdate} from the main thread with the given progress parameter.
|
* {@link AsyncTask#onProgressUpdate} from the main thread with the given progress parameter.
|
||||||
*
|
*
|
||||||
* @param \Threaded|mixed $progress A Threaded object, or a value that can be safely serialize()'ed.
|
* @param mixed $progress A value that can be safely serialize()'ed.
|
||||||
*/
|
*/
|
||||||
public function publishProgress($progress){
|
public function publishProgress($progress){
|
||||||
$this->progressUpdates[] = $progress;
|
$this->progressUpdates[] = $progress;
|
||||||
@ -198,10 +198,9 @@ abstract class AsyncTask extends Collectable{
|
|||||||
* All {@link AsyncTask#publishProgress} calls should result in {@link AsyncTask#onProgressUpdate} calls before
|
* All {@link AsyncTask#publishProgress} calls should result in {@link AsyncTask#onProgressUpdate} calls before
|
||||||
* {@link AsyncTask#onCompletion} is called.
|
* {@link AsyncTask#onCompletion} is called.
|
||||||
*
|
*
|
||||||
* @param Server $server
|
* @param Server $server
|
||||||
* @param \Threaded|mixed $progress The parameter passed to {@link AsyncTask#publishProgress}. If it is not a
|
* @param mixed $progress The parameter passed to {@link AsyncTask#publishProgress}. It is serialize()'ed
|
||||||
* Threaded object, it would be serialize()'ed and later unserialize()'ed, as if it
|
* and then unserialize()'ed, as if it has been cloned.
|
||||||
* has been cloned.
|
|
||||||
*/
|
*/
|
||||||
public function onProgressUpdate(Server $server, $progress){
|
public function onProgressUpdate(Server $server, $progress){
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user