Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3282688
MethodCallFuture.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
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
Mar 24 2025, 10:04 (7 w, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1115724
Default Alt Text
MethodCallFuture.php (824 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment