-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathVerificationTypeInfo.php
More file actions
62 lines (55 loc) · 2.3 KB
/
VerificationTypeInfo.php
File metadata and controls
62 lines (55 loc) · 2.3 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
<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Structures;
use PHPJava\Kernel\Maps\VerificationTypeTag;
use PHPJava\Kernel\Variables\VariableInfoInterface;
class VerificationTypeInfo implements StructureInterface
{
use \PHPJava\Kernel\Core\BinaryReader;
use \PHPJava\Kernel\Core\ConstantPool;
use \PHPJava\Kernel\Core\DebugTool;
/**
* @var int
*/
private $tag = 0;
/**
* @var null|VariableInfoInterface
*/
private $variableInfo;
public function execute(): void
{
$this->tag = $this->readUnsignedByte();
// back by tag
$this->reader->getReader()->seek(-1);
switch ($this->tag) {
case VerificationTypeTag::ITEM_Top:
$this->variableInfo = new \PHPJava\Kernel\Variables\TopVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Integer:
$this->variableInfo = new \PHPJava\Kernel\Variables\IntegerVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Float:
$this->variableInfo = new \PHPJava\Kernel\Variables\FloatVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Long:
$this->variableInfo = new \PHPJava\Kernel\Variables\LongVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Double:
$this->variableInfo = new \PHPJava\Kernel\Variables\DoubleVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Null:
$this->variableInfo = new \PHPJava\Kernel\Variables\NullVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_UninitializedThis:
$this->variableInfo = new \PHPJava\Kernel\Variables\UninitializedThisVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Object:
$this->variableInfo = new \PHPJava\Kernel\Variables\ObjectVariableInfo($this->reader);
break;
case VerificationTypeTag::ITEM_Uninitialized:
$this->variableInfo = new \PHPJava\Kernel\Variables\UninitializedVariableInfo($this->reader);
break;
}
$this->variableInfo->execute();
}
}