Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22388951
MethodCallFuture.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
824 B
Referenced Files
None
Subscribers
None
MethodCallFuture.php
View Options
<?php
/**
* Degenerate future which resolves by calling a method.
*
* $future = new MethodCallFuture($calculator, 'add', 1, 2);
*
* This future is similar to @{class:ImmediateFuture}, but may make it easier
* to implement exception behavior correctly. See T13666.
*/
final
class
MethodCallFuture
extends
Future
{
private
$callObject
;
private
$callMethod
;
private
$callArgv
;
public
function
__construct
(
$object
,
$method
/* , ...*/
)
{
$argv
=
func_get_args
();
$this
->
callObject
=
$object
;
$this
->
callMethod
=
$method
;
$this
->
callArgv
=
array_slice
(
$argv
,
2
);
}
public
function
isReady
()
{
$call
=
array
(
$this
->
callObject
,
$this
->
callMethod
);
$argv
=
$this
->
callArgv
;
$result
=
call_user_func_array
(
$call
,
$argv
);
$this
->
setResult
(
$result
);
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 15:07 (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1220629
Default Alt Text
MethodCallFuture.php (824 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline