forked from ircmaxell/PHPPHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FunctionCall.php
44 lines (35 loc) · 1.15 KB
/
FunctionCall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace PHPPHP\Engine;
class FunctionCall {
protected $executor;
protected $function;
protected $ci;
protected $ce;
public function __construct(Executor $executor, FunctionData $function, Objects\ClassInstance $ci = null, Objects\ClassEntry $ce = null) {
$this->function = $function;
$this->ci = $ci;
$this->ce = $ce;
$this->executor = $executor;
}
public function getName() {
if ($this->ci) {
return $this->ci->getClassEntry()->getMethodStore()->getName($this->function);
} else if ($this->ce) {
return $this->ce->getMethodStore()->getName($this->function);
} else {
return $this->executor->getFunctionStore()->getName($this->function);
}
}
public function execute(array $args, \PHPPHP\Engine\Zval $result) {
$this->function->execute($this->executor, $args, $result, $this->ci, $this->ce);
}
public function getFunction() {
return $this->function;
}
public function getClassInstance() {
return $this->ci;
}
public function getClassEntry() {
return $this->ce;
}
}