| 1 | <?php |
||
| 8 | class Operation |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var int[] |
||
| 12 | */ |
||
| 13 | protected static $logical = [ |
||
| 14 | Opcodes::OP_IF, Opcodes::OP_NOTIF, Opcodes::OP_ELSE, Opcodes::OP_ENDIF, |
||
| 15 | ]; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var bool |
||
| 19 | */ |
||
| 20 | private $push; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var int |
||
| 24 | */ |
||
| 25 | private $opCode; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var BufferInterface |
||
| 29 | */ |
||
| 30 | private $pushData; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var int |
||
| 34 | */ |
||
| 35 | private $pushDataSize; |
||
| 36 | 2566 | ||
| 37 | /** |
||
| 38 | 2566 | * Operation constructor. |
|
| 39 | 2566 | * @param int $opCode |
|
| 40 | 2566 | * @param BufferInterface $pushData |
|
| 41 | 2566 | * @param int $pushDataSize |
|
| 42 | 2566 | */ |
|
| 43 | public function __construct($opCode, BufferInterface $pushData, $pushDataSize = 0) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function encode() |
||
| 62 | |||
| 63 | 2532 | /** |
|
| 64 | * @return bool |
||
| 65 | 2532 | */ |
|
| 66 | public function isPush() |
||
| 70 | |||
| 71 | 1900 | /** |
|
| 72 | * @return bool |
||
| 73 | 1900 | */ |
|
| 74 | public function isLogical() |
||
| 78 | |||
| 79 | |||
| 80 | /** |
||
| 81 | * @return int |
||
| 82 | */ |
||
| 83 | public function getOp() |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @return BufferInterface |
||
| 90 | */ |
||
| 91 | public function getData() |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @return int |
||
| 98 | */ |
||
| 99 | public function getDataSize() |
||
| 107 | } |
||
| 108 |