-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathJavaClassMethodInvoker.php
More file actions
63 lines (54 loc) · 1.46 KB
/
JavaClassMethodInvoker.php
File metadata and controls
63 lines (54 loc) · 1.46 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
namespace PHPJava\Core\JVM\Invoker;
use PHPJava\Core\JVM\ClassInvokerInterface;
use PHPJava\Kernel\Structures\MethodInfo;
use PHPJava\Utilities\DebugTool;
class JavaClassMethodInvoker implements InvokerInterface
{
use Extended\SpecialMethodCallable;
use Extended\JavaMethodCallable;
use Extended\JavaMethodFindable;
use Extended\MethodListable;
use Extended\ArgumentsStringifyable;
use Extended\StaticConstructorInitializable;
use Extended\JavaMethodAnnotationInjectable;
use Extended\JavaMethodSpecifiable;
/**
* @var ClassInvokerInterface
*/
private $javaClassInvoker;
/**
* @var MethodInfo[]
*/
private $methods = [];
/**
* @var array
*/
private $options = [];
/**
* @var DebugTool
*/
private $debugTool;
/**
* @param MethodInfo[] $methods
*/
public function __construct(ClassInvokerInterface $javaClassInvoker, array $methods, array $options = [])
{
$this->javaClassInvoker = $javaClassInvoker;
$this->methods = $methods;
$this->options = $options;
$this->debugTool = new DebugTool(
str_replace('/', '.', $javaClassInvoker->getJavaClass()->getClassName()),
$this->options
);
}
public function isDynamic(): bool
{
return false;
}
public function has(string $name): bool
{
return count($this->methods[$name] ?? []) > 0;
}
}