-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathAccessor.php
More file actions
46 lines (40 loc) · 1.13 KB
/
Accessor.php
File metadata and controls
46 lines (40 loc) · 1.13 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
<?php
declare(strict_types=1);
namespace PHPJava\Core\JVM;
use PHPJava\Core\JVM\Field\FieldInterface;
use PHPJava\Core\JVM\Field\StaticField;
use PHPJava\Core\JVM\Invoker\InvokerInterface;
use PHPJava\Core\JVM\Invoker\JavaClassStaticMethodInvoker;
class Accessor implements AccessorInterface
{
/**
* @var StaticField
*/
private $fieldAccessor;
/**
* @var JavaClassStaticMethodInvoker
*/
private $methodAccessor;
/**
* @param PHPJava\Kernel\Structures\MethodInfo[] $methods
*/
public function __construct(
ClassInvokerInterface $invoker,
string $targetedMethodAccessorClass,
string $targetedFieldAccessorClass,
array $methods,
array $fields,
array $options = []
) {
$this->methodAccessor = new $targetedMethodAccessorClass($invoker, $methods, $options);
$this->fieldAccessor = new $targetedFieldAccessorClass($invoker, $fields);
}
public function getFields(): FieldInterface
{
return $this->fieldAccessor;
}
public function getMethods(): InvokerInterface
{
return $this->methodAccessor;
}
}