-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathAnnotation.php
More file actions
43 lines (36 loc) · 1.1 KB
/
Annotation.php
File metadata and controls
43 lines (36 loc) · 1.1 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
<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Structures\Annotations;
final class Annotation implements AnnotationInterface
{
use \PHPJava\Kernel\Core\BinaryReader;
use \PHPJava\Kernel\Core\ConstantPool;
use \PHPJava\Kernel\Core\DebugTool;
/**
* @var int
*/
private $typeIndex = 0;
/**
* @var int
*/
private $numElementValuePairs = 0;
/**
* @var (int|null)[][]
*/
private $elementValuePairs = [];
public function execute(): void
{
$this->typeIndex = $this->readUnsignedShort();
$this->numElementValuePairs = $this->readUnsignedShort();
for ($i = 0; $i < $this->numElementValuePairs; $i++) {
$elementNameIndex = $this->readUnsignedShort();
$this->elementValuePairs[] = [
'element_name_index' => $elementNameIndex,
'element_value_pair' => (new ElementValue($this->reader))
->setConstantPool($this->getConstantPool())
->setDebugTool($this->getDebugTool())
->execute(),
];
}
}
}