Compiles the arg node.

@param \Zicht\Tool\Script\Buffer $buffer
@return void
321880
public function compile(Buffer $buffer)
    {
        $name = explode('.', $this->name);
        $phpName = Util::toPhp($name);

        $buffer->write('$z->set(')->raw($phpName)->raw(', ');
        $buffer->raw('$z->value(');
        $this->nodes[0]->compile($buffer);
        $buffer->raw('));')->eol();
    }
243770
public function write($buffer)
    {
        $result = fwrite($this->fileHandle, $buffer, strlen($buffer));
        if ($result === false) {
            throw new \UnexpectedValueException(sprintf('Failed to write buffer into the file [ %s ].', $this->file));
        }
    }
293513
public function compile($code, $path = null)
    {
        $this->indentLevel    = -1;
        $this->commentsSeen   = [];
        $this->extends        = [];
        $this->extendsMap     = [];
        $this->sourceIndex    = null;
        $this->sourceLine     = null;
        $this->sourceColumn   = null;
        $this->env            = null;
        $this->scope          = null;
        $this->storeEnv       = null;
        $this->charsetSeen    = null;
        $this->shouldEvaluate = null;
        $this->stderr         = fopen('php://stderr', 'w');

        $this->parser = $this->parserFactory($path);
        $tree = $this->parser->parse($code);
        $this->parser = null;

        $this->formatter = new $this->formatter();
        $this->rootBlock = null;
        $this->rootEnv   = $this->pushEnv($tree);

        $this->injectVariables($this->registeredVars);
        $this->compileRoot($tree);
        $this->popEnv();

        $sourceMapGenerator = null;

        if ($this->sourceMap) {
            if (is_object($this->sourceMap) && $this->sourceMap instanceof SourceMapGenerator) {
                $sourceMapGenerator = $this->sourceMap;
                $this->sourceMap = self::SOURCE_MAP_FILE;
            } elseif ($this->sourceMap !== self::SOURCE_MAP_NONE) {
                $sourceMapGenerator = new SourceMapGenerator($this->sourceMapOptions);
            }
        }

        $out = $this->formatter->format($this->scope, $sourceMapGenerator);

        if (! empty($out) && $this->sourceMap && $this->sourceMap !== self::SOURCE_MAP_NONE) {
            $sourceMap    = $sourceMapGenerator->generateJson();
            $sourceMapUrl = null;

            switch ($this->sourceMap) {
                case self::SOURCE_MAP_INLINE:
                    $sourceMapUrl = sprintf('data:application/json,%s', Util::encodeURIComponent($sourceMap));
                    break;

                case self::SOURCE_MAP_FILE:
                    $sourceMapUrl = $sourceMapGenerator->saveMap($sourceMap);
                    break;
            }

            $out .= sprintf('/*# sourceMappingURL=%s */', $sourceMapUrl);
        }

        return $out;
    }
928849
public function consumeMethodFrame(Buffer $buffer)
    {
        $classId = $buffer->consumeUint16();
        $methodId = $buffer->consumeUint16();

        if ($classId === Constants::CLASS_CONNECTION) {
            if ($methodId === Constants::METHOD_CONNECTION_START) {
                $frame = new MethodConnectionStartFrame();
                $frame->versionMajor = $buffer->consumeUint8();
                $frame->versionMinor = $buffer->consumeUint8();
                $frame->serverProperties = $this->consumeTable($buffer);
                $frame->mechanisms = $buffer->consume($buffer->consumeUint32());
                $frame->locales = $buffer->consume($buffer->consumeUint32());
            } elseif ($methodId === Constants::METHOD_CONNECTION_START_OK) {
                $frame = new MethodConnectionStartOkFrame();
                $frame->clientProperties = $this->consumeTable($buffer);
                $frame->mechanism = $buffer->consume($buffer->consumeUint8());
                $frame->response = $buffer->consume($buffer->consumeUint32());
                $frame->locale = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_CONNECTION_SECURE) {
                $frame = new MethodConnectionSecureFrame();
                $frame->challenge = $buffer->consume($buffer->consumeUint32());
            } elseif ($methodId === Constants::METHOD_CONNECTION_SECURE_OK) {
                $frame = new MethodConnectionSecureOkFrame();
                $frame->response = $buffer->consume($buffer->consumeUint32());
            } elseif ($methodId === Constants::METHOD_CONNECTION_TUNE) {
                $frame = new MethodConnectionTuneFrame();
                $frame->channelMax = $buffer->consumeInt16();
                $frame->frameMax = $buffer->consumeInt32();
                $frame->heartbeat = $buffer->consumeInt16();
            } elseif ($methodId === Constants::METHOD_CONNECTION_TUNE_OK) {
                $frame = new MethodConnectionTuneOkFrame();
                $frame->channelMax = $buffer->consumeInt16();
                $frame->frameMax = $buffer->consumeInt32();
                $frame->heartbeat = $buffer->consumeInt16();
            } elseif ($methodId === Constants::METHOD_CONNECTION_OPEN) {
                $frame = new MethodConnectionOpenFrame();
                $frame->virtualHost = $buffer->consume($buffer->consumeUint8());
                $frame->capabilities = $buffer->consume($buffer->consumeUint8());
                list($frame->insist) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_CONNECTION_OPEN_OK) {
                $frame = new MethodConnectionOpenOkFrame();
                $frame->knownHosts = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_CONNECTION_CLOSE) {
                $frame = new MethodConnectionCloseFrame();
                $frame->replyCode = $buffer->consumeInt16();
                $frame->replyText = $buffer->consume($buffer->consumeUint8());
                $frame->closeClassId = $buffer->consumeInt16();
                $frame->closeMethodId = $buffer->consumeInt16();
            } elseif ($methodId === Constants::METHOD_CONNECTION_CLOSE_OK) {
                $frame = new MethodConnectionCloseOkFrame();
            } elseif ($methodId === Constants::METHOD_CONNECTION_BLOCKED) {
                $frame = new MethodConnectionBlockedFrame();
                $frame->reason = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_CONNECTION_UNBLOCKED) {
                $frame = new MethodConnectionUnblockedFrame();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_CHANNEL) {
            if ($methodId === Constants::METHOD_CHANNEL_OPEN) {
                $frame = new MethodChannelOpenFrame();
                $frame->outOfBand = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_CHANNEL_OPEN_OK) {
                $frame = new MethodChannelOpenOkFrame();
                $frame->channelId = $buffer->consume($buffer->consumeUint32());
            } elseif ($methodId === Constants::METHOD_CHANNEL_FLOW) {
                $frame = new MethodChannelFlowFrame();
                list($frame->active) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_CHANNEL_FLOW_OK) {
                $frame = new MethodChannelFlowOkFrame();
                list($frame->active) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_CHANNEL_CLOSE) {
                $frame = new MethodChannelCloseFrame();
                $frame->replyCode = $buffer->consumeInt16();
                $frame->replyText = $buffer->consume($buffer->consumeUint8());
                $frame->closeClassId = $buffer->consumeInt16();
                $frame->closeMethodId = $buffer->consumeInt16();
            } elseif ($methodId === Constants::METHOD_CHANNEL_CLOSE_OK) {
                $frame = new MethodChannelCloseOkFrame();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_ACCESS) {
            if ($methodId === Constants::METHOD_ACCESS_REQUEST) {
                $frame = new MethodAccessRequestFrame();
                $frame->realm = $buffer->consume($buffer->consumeUint8());
                list($frame->exclusive, $frame->passive, $frame->active, $frame->write, $frame->read) = $this->consumeBits($buffer, 5);
            } elseif ($methodId === Constants::METHOD_ACCESS_REQUEST_OK) {
                $frame = new MethodAccessRequestOkFrame();
                $frame->reserved1 = $buffer->consumeInt16();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_EXCHANGE) {
            if ($methodId === Constants::METHOD_EXCHANGE_DECLARE) {
                $frame = new MethodExchangeDeclareFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->exchangeType = $buffer->consume($buffer->consumeUint8());
                list($frame->passive, $frame->durable, $frame->autoDelete, $frame->internal, $frame->nowait) = $this->consumeBits($buffer, 5);
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_EXCHANGE_DECLARE_OK) {
                $frame = new MethodExchangeDeclareOkFrame();
            } elseif ($methodId === Constants::METHOD_EXCHANGE_DELETE) {
                $frame = new MethodExchangeDeleteFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                list($frame->ifUnused, $frame->nowait) = $this->consumeBits($buffer, 2);
            } elseif ($methodId === Constants::METHOD_EXCHANGE_DELETE_OK) {
                $frame = new MethodExchangeDeleteOkFrame();
            } elseif ($methodId === Constants::METHOD_EXCHANGE_BIND) {
                $frame = new MethodExchangeBindFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->destination = $buffer->consume($buffer->consumeUint8());
                $frame->source = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
                list($frame->nowait) = $this->consumeBits($buffer, 1);
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_EXCHANGE_BIND_OK) {
                $frame = new MethodExchangeBindOkFrame();
            } elseif ($methodId === Constants::METHOD_EXCHANGE_UNBIND) {
                $frame = new MethodExchangeUnbindFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->destination = $buffer->consume($buffer->consumeUint8());
                $frame->source = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
                list($frame->nowait) = $this->consumeBits($buffer, 1);
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_EXCHANGE_UNBIND_OK) {
                $frame = new MethodExchangeUnbindOkFrame();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_QUEUE) {
            if ($methodId === Constants::METHOD_QUEUE_DECLARE) {
                $frame = new MethodQueueDeclareFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                list($frame->passive, $frame->durable, $frame->exclusive, $frame->autoDelete, $frame->nowait) = $this->consumeBits($buffer, 5);
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_QUEUE_DECLARE_OK) {
                $frame = new MethodQueueDeclareOkFrame();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                $frame->messageCount = $buffer->consumeInt32();
                $frame->consumerCount = $buffer->consumeInt32();
            } elseif ($methodId === Constants::METHOD_QUEUE_BIND) {
                $frame = new MethodQueueBindFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
                list($frame->nowait) = $this->consumeBits($buffer, 1);
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_QUEUE_BIND_OK) {
                $frame = new MethodQueueBindOkFrame();
            } elseif ($methodId === Constants::METHOD_QUEUE_PURGE) {
                $frame = new MethodQueuePurgeFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                list($frame->nowait) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_QUEUE_PURGE_OK) {
                $frame = new MethodQueuePurgeOkFrame();
                $frame->messageCount = $buffer->consumeInt32();
            } elseif ($methodId === Constants::METHOD_QUEUE_DELETE) {
                $frame = new MethodQueueDeleteFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                list($frame->ifUnused, $frame->ifEmpty, $frame->nowait) = $this->consumeBits($buffer, 3);
            } elseif ($methodId === Constants::METHOD_QUEUE_DELETE_OK) {
                $frame = new MethodQueueDeleteOkFrame();
                $frame->messageCount = $buffer->consumeInt32();
            } elseif ($methodId === Constants::METHOD_QUEUE_UNBIND) {
                $frame = new MethodQueueUnbindFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_QUEUE_UNBIND_OK) {
                $frame = new MethodQueueUnbindOkFrame();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_BASIC) {
            if ($methodId === Constants::METHOD_BASIC_QOS) {
                $frame = new MethodBasicQosFrame();
                $frame->prefetchSize = $buffer->consumeInt32();
                $frame->prefetchCount = $buffer->consumeInt16();
                list($frame->global) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_QOS_OK) {
                $frame = new MethodBasicQosOkFrame();
            } elseif ($methodId === Constants::METHOD_BASIC_CONSUME) {
                $frame = new MethodBasicConsumeFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                $frame->consumerTag = $buffer->consume($buffer->consumeUint8());
                list($frame->noLocal, $frame->noAck, $frame->exclusive, $frame->nowait) = $this->consumeBits($buffer, 4);
                $frame->arguments = $this->consumeTable($buffer);
            } elseif ($methodId === Constants::METHOD_BASIC_CONSUME_OK) {
                $frame = new MethodBasicConsumeOkFrame();
                $frame->consumerTag = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_BASIC_CANCEL) {
                $frame = new MethodBasicCancelFrame();
                $frame->consumerTag = $buffer->consume($buffer->consumeUint8());
                list($frame->nowait) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_CANCEL_OK) {
                $frame = new MethodBasicCancelOkFrame();
                $frame->consumerTag = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_BASIC_PUBLISH) {
                $frame = new MethodBasicPublishFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
                list($frame->mandatory, $frame->immediate) = $this->consumeBits($buffer, 2);
            } elseif ($methodId === Constants::METHOD_BASIC_RETURN) {
                $frame = new MethodBasicReturnFrame();
                $frame->replyCode = $buffer->consumeInt16();
                $frame->replyText = $buffer->consume($buffer->consumeUint8());
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_BASIC_DELIVER) {
                $frame = new MethodBasicDeliverFrame();
                $frame->consumerTag = $buffer->consume($buffer->consumeUint8());
                $frame->deliveryTag = $buffer->consumeInt64();
                list($frame->redelivered) = $this->consumeBits($buffer, 1);
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_BASIC_GET) {
                $frame = new MethodBasicGetFrame();
                $frame->reserved1 = $buffer->consumeInt16();
                $frame->queue = $buffer->consume($buffer->consumeUint8());
                list($frame->noAck) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_GET_OK) {
                $frame = new MethodBasicGetOkFrame();
                $frame->deliveryTag = $buffer->consumeInt64();
                list($frame->redelivered) = $this->consumeBits($buffer, 1);
                $frame->exchange = $buffer->consume($buffer->consumeUint8());
                $frame->routingKey = $buffer->consume($buffer->consumeUint8());
                $frame->messageCount = $buffer->consumeInt32();
            } elseif ($methodId === Constants::METHOD_BASIC_GET_EMPTY) {
                $frame = new MethodBasicGetEmptyFrame();
                $frame->clusterId = $buffer->consume($buffer->consumeUint8());
            } elseif ($methodId === Constants::METHOD_BASIC_ACK) {
                $frame = new MethodBasicAckFrame();
                $frame->deliveryTag = $buffer->consumeInt64();
                list($frame->multiple) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_REJECT) {
                $frame = new MethodBasicRejectFrame();
                $frame->deliveryTag = $buffer->consumeInt64();
                list($frame->requeue) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_RECOVER_ASYNC) {
                $frame = new MethodBasicRecoverAsyncFrame();
                list($frame->requeue) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_RECOVER) {
                $frame = new MethodBasicRecoverFrame();
                list($frame->requeue) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_BASIC_RECOVER_OK) {
                $frame = new MethodBasicRecoverOkFrame();
            } elseif ($methodId === Constants::METHOD_BASIC_NACK) {
                $frame = new MethodBasicNackFrame();
                $frame->deliveryTag = $buffer->consumeInt64();
                list($frame->multiple, $frame->requeue) = $this->consumeBits($buffer, 2);
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_TX) {
            if ($methodId === Constants::METHOD_TX_SELECT) {
                $frame = new MethodTxSelectFrame();
            } elseif ($methodId === Constants::METHOD_TX_SELECT_OK) {
                $frame = new MethodTxSelectOkFrame();
            } elseif ($methodId === Constants::METHOD_TX_COMMIT) {
                $frame = new MethodTxCommitFrame();
            } elseif ($methodId === Constants::METHOD_TX_COMMIT_OK) {
                $frame = new MethodTxCommitOkFrame();
            } elseif ($methodId === Constants::METHOD_TX_ROLLBACK) {
                $frame = new MethodTxRollbackFrame();
            } elseif ($methodId === Constants::METHOD_TX_ROLLBACK_OK) {
                $frame = new MethodTxRollbackOkFrame();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } elseif ($classId === Constants::CLASS_CONFIRM) {
            if ($methodId === Constants::METHOD_CONFIRM_SELECT) {
                $frame = new MethodConfirmSelectFrame();
                list($frame->nowait) = $this->consumeBits($buffer, 1);
            } elseif ($methodId === Constants::METHOD_CONFIRM_SELECT_OK) {
                $frame = new MethodConfirmSelectOkFrame();
            } else {
                throw new InvalidMethodException($classId, $methodId);
            }
        } else {
            throw new InvalidClassException($classId);
        }

        $frame->classId = $classId;
        $frame->methodId = $methodId;

        return $frame;
    }
115727
public function insert(Node $node) : void
    {
        $node->setParent($this->scope);
        $this->scope->insert($node);
    }
1036753
protected function compileInitialization(Buffer $buffer)
    {
        $buffer->write('$app = new Zicht\Tool\Application(')
            ->asPhp($this->appName)
            ->raw(', Zicht\Version\Version::fromString(')
            ->asPhp($this->appVersion)
            ->raw(') ?: new Zicht\Version\Version(), Zicht\Tool\Configuration\ConfigurationLoader::fromEnv(')->asPhp($this->configFilename)->raw(')')
            ->raw(');')
            ->eol();
    }
917861
private function compile() : void
    {
        $this->isCompiled = true;

        if ($this->type === self::TYPE_SIMPLE) {
            $this->compileSimpleTable();
        } else {
            $this->compilePrettyTable();
        }
    }
1353812
protected function processRules(Buffer $buffer)
    {

        // Set the result to a new result instance
        $result = new Result();

        // Named values
        $inc = -1;
        while ($buffer->getLength()) {
            // Grab the key
            $key = $buffer->readPascalString(1);

            // Make sure mutators don't overwrite each other
            if ($key === 'Mutator') {
                $key .= ++$inc;
            }

            $result->add(strtolower($key), utf8_encode($buffer->readPascalString(1)));
        }

        unset($buffer);

        return $result->fetch();
    }
616236
public function run(Input\InputInterface $input = null, Output\OutputInterface $output = null)
    {
        if (null === $input) {
            $input = new Input\ArgvInput();
        }

        if (null === $output) {
            $output = new Output\ConsoleOutput();
        }

        $this->_input  = $input;
        $this->_output = $output;

        $this->configureIO($this->_input, $this->_output);

        $this->_setup();

        $this->_loadPlugins();

        parent::run($this->_input, $this->_output);
    }
729640
public function write($buffer)
    {
        if ($this->driver === self::DRIVER_SOCKET) {
            return socket_write($this->sock, $buffer, \strlen($buffer));
        } else {
            // $buffer = str_replace(chr(255), chr(255) . chr(255), $buffer);
            return fwrite($this->sock, $buffer);
        }
    }
1235598
public function write($buffer, $length = 0)
    {
        if ("\n" != substr($buffer, -1)) {
            $buffer .= "\n";
        }
        if (!$length) {
            $length = strlen($buffer);
        }

        return socket_write($this->socket, $buffer, $length);
    }
978142
public function compileArgument($compiler, $argument)
    {
        if (empty($argument['name'])) {
            $compiler
                ->write('(array) ')
                ->subcompile($argument['value']);
        } else {
            $compiler
                ->write('array(')
                ->repr($argument['name'])
                ->raw(' => ')
                ->subcompile($argument['value'])
                ->raw(')');
        }
    }
567503
public function compile(Compiler $compiler): void
    {
        $runtimeErrorClass = RuntimeError::class;
        $suppressedExceptionClass = SuppressedException::class;

        $compiler
            ->write("try {\n")
            ->indent()
            ->write("ob_start();\n\n")
            ->subcompile($this->getNode('body'))
            ->raw("\n")
            ->write("echo ob_get_clean();\n")
            ->outdent()
            ->write("} catch ({$runtimeErrorClass} \$exception) {\n")
            ->indent()
            ->write("ob_end_clean();\n\n")
            ->write("if (\$exception->getPrevious() === null) {\n")
            ->indent()
            ->write("throw \$exception;\n")
            ->outdent()
            ->write("}\n\n")
            ->write("\$suppressedException = new {$suppressedExceptionClass}(\$exception->getPrevious());\n")
            ->outdent()
            ->write("}\n\n");
    }
299896
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Param || ! $parent instanceof FunctionModelInterface) {
            throw new Exception('ParameterNodeParser is made to parse a function parameter node');
        }

        $parameter = new ParameterModel();
        $parameter->setParentNode($parent);
        $parameter->setName($node->var->name);
        $parameter->setIsVariadic($node->variadic);

        if ($node->type !== null) {
            $this->typeNodeParser->invoke($node->type, $parameter);
        }
        if ($node->default !== null) {
            $this->valueNodeParser->invoke($node->default, $parameter);
        }

        $parent->addParameter($parameter);
    }
1247997
public function appendMethodFrame(MethodFrame $frame, Buffer $buffer)
    {
        $buffer->appendUint16($frame->classId);
        $buffer->appendUint16($frame->methodId);

        if ($frame instanceof MethodConnectionStartFrame) {
            $buffer->appendUint8($frame->versionMajor);
            $buffer->appendUint8($frame->versionMinor);
            $this->appendTable($frame->serverProperties, $buffer);
            $buffer->appendUint32(strlen($frame->mechanisms)); $buffer->append($frame->mechanisms);
            $buffer->appendUint32(strlen($frame->locales)); $buffer->append($frame->locales);
        } elseif ($frame instanceof MethodConnectionStartOkFrame) {
            $this->appendTable($frame->clientProperties, $buffer);
            $buffer->appendUint8(strlen($frame->mechanism)); $buffer->append($frame->mechanism);
            $buffer->appendUint32(strlen($frame->response)); $buffer->append($frame->response);
            $buffer->appendUint8(strlen($frame->locale)); $buffer->append($frame->locale);
        } elseif ($frame instanceof MethodConnectionSecureFrame) {
            $buffer->appendUint32(strlen($frame->challenge)); $buffer->append($frame->challenge);
        } elseif ($frame instanceof MethodConnectionSecureOkFrame) {
            $buffer->appendUint32(strlen($frame->response)); $buffer->append($frame->response);
        } elseif ($frame instanceof MethodConnectionTuneFrame) {
            $buffer->appendInt16($frame->channelMax);
            $buffer->appendInt32($frame->frameMax);
            $buffer->appendInt16($frame->heartbeat);
        } elseif ($frame instanceof MethodConnectionTuneOkFrame) {
            $buffer->appendInt16($frame->channelMax);
            $buffer->appendInt32($frame->frameMax);
            $buffer->appendInt16($frame->heartbeat);
        } elseif ($frame instanceof MethodConnectionOpenFrame) {
            $buffer->appendUint8(strlen($frame->virtualHost)); $buffer->append($frame->virtualHost);
            $buffer->appendUint8(strlen($frame->capabilities)); $buffer->append($frame->capabilities);
            $this->appendBits([$frame->insist], $buffer);
        } elseif ($frame instanceof MethodConnectionOpenOkFrame) {
            $buffer->appendUint8(strlen($frame->knownHosts)); $buffer->append($frame->knownHosts);
        } elseif ($frame instanceof MethodConnectionCloseFrame) {
            $buffer->appendInt16($frame->replyCode);
            $buffer->appendUint8(strlen($frame->replyText)); $buffer->append($frame->replyText);
            $buffer->appendInt16($frame->closeClassId);
            $buffer->appendInt16($frame->closeMethodId);
        } elseif ($frame instanceof MethodConnectionCloseOkFrame) {
        } elseif ($frame instanceof MethodConnectionBlockedFrame) {
            $buffer->appendUint8(strlen($frame->reason)); $buffer->append($frame->reason);
        } elseif ($frame instanceof MethodConnectionUnblockedFrame) {
        } elseif ($frame instanceof MethodChannelOpenFrame) {
            $buffer->appendUint8(strlen($frame->outOfBand)); $buffer->append($frame->outOfBand);
        } elseif ($frame instanceof MethodChannelOpenOkFrame) {
            $buffer->appendUint32(strlen($frame->channelId)); $buffer->append($frame->channelId);
        } elseif ($frame instanceof MethodChannelFlowFrame) {
            $this->appendBits([$frame->active], $buffer);
        } elseif ($frame instanceof MethodChannelFlowOkFrame) {
            $this->appendBits([$frame->active], $buffer);
        } elseif ($frame instanceof MethodChannelCloseFrame) {
            $buffer->appendInt16($frame->replyCode);
            $buffer->appendUint8(strlen($frame->replyText)); $buffer->append($frame->replyText);
            $buffer->appendInt16($frame->closeClassId);
            $buffer->appendInt16($frame->closeMethodId);
        } elseif ($frame instanceof MethodChannelCloseOkFrame) {
        } elseif ($frame instanceof MethodAccessRequestFrame) {
            $buffer->appendUint8(strlen($frame->realm)); $buffer->append($frame->realm);
            $this->appendBits([$frame->exclusive, $frame->passive, $frame->active, $frame->write, $frame->read], $buffer);
        } elseif ($frame instanceof MethodAccessRequestOkFrame) {
            $buffer->appendInt16($frame->reserved1);
        } elseif ($frame instanceof MethodExchangeDeclareFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->exchangeType)); $buffer->append($frame->exchangeType);
            $this->appendBits([$frame->passive, $frame->durable, $frame->autoDelete, $frame->internal, $frame->nowait], $buffer);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodExchangeDeclareOkFrame) {
        } elseif ($frame instanceof MethodExchangeDeleteFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $this->appendBits([$frame->ifUnused, $frame->nowait], $buffer);
        } elseif ($frame instanceof MethodExchangeDeleteOkFrame) {
        } elseif ($frame instanceof MethodExchangeBindFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->destination)); $buffer->append($frame->destination);
            $buffer->appendUint8(strlen($frame->source)); $buffer->append($frame->source);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
            $this->appendBits([$frame->nowait], $buffer);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodExchangeBindOkFrame) {
        } elseif ($frame instanceof MethodExchangeUnbindFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->destination)); $buffer->append($frame->destination);
            $buffer->appendUint8(strlen($frame->source)); $buffer->append($frame->source);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
            $this->appendBits([$frame->nowait], $buffer);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodExchangeUnbindOkFrame) {
        } elseif ($frame instanceof MethodQueueDeclareFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $this->appendBits([$frame->passive, $frame->durable, $frame->exclusive, $frame->autoDelete, $frame->nowait], $buffer);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodQueueDeclareOkFrame) {
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $buffer->appendInt32($frame->messageCount);
            $buffer->appendInt32($frame->consumerCount);
        } elseif ($frame instanceof MethodQueueBindFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
            $this->appendBits([$frame->nowait], $buffer);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodQueueBindOkFrame) {
        } elseif ($frame instanceof MethodQueuePurgeFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $this->appendBits([$frame->nowait], $buffer);
        } elseif ($frame instanceof MethodQueuePurgeOkFrame) {
            $buffer->appendInt32($frame->messageCount);
        } elseif ($frame instanceof MethodQueueDeleteFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $this->appendBits([$frame->ifUnused, $frame->ifEmpty, $frame->nowait], $buffer);
        } elseif ($frame instanceof MethodQueueDeleteOkFrame) {
            $buffer->appendInt32($frame->messageCount);
        } elseif ($frame instanceof MethodQueueUnbindFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodQueueUnbindOkFrame) {
        } elseif ($frame instanceof MethodBasicQosFrame) {
            $buffer->appendInt32($frame->prefetchSize);
            $buffer->appendInt16($frame->prefetchCount);
            $this->appendBits([$frame->global], $buffer);
        } elseif ($frame instanceof MethodBasicQosOkFrame) {
        } elseif ($frame instanceof MethodBasicConsumeFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $buffer->appendUint8(strlen($frame->consumerTag)); $buffer->append($frame->consumerTag);
            $this->appendBits([$frame->noLocal, $frame->noAck, $frame->exclusive, $frame->nowait], $buffer);
            $this->appendTable($frame->arguments, $buffer);
        } elseif ($frame instanceof MethodBasicConsumeOkFrame) {
            $buffer->appendUint8(strlen($frame->consumerTag)); $buffer->append($frame->consumerTag);
        } elseif ($frame instanceof MethodBasicCancelFrame) {
            $buffer->appendUint8(strlen($frame->consumerTag)); $buffer->append($frame->consumerTag);
            $this->appendBits([$frame->nowait], $buffer);
        } elseif ($frame instanceof MethodBasicCancelOkFrame) {
            $buffer->appendUint8(strlen($frame->consumerTag)); $buffer->append($frame->consumerTag);
        } elseif ($frame instanceof MethodBasicPublishFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
            $this->appendBits([$frame->mandatory, $frame->immediate], $buffer);
        } elseif ($frame instanceof MethodBasicReturnFrame) {
            $buffer->appendInt16($frame->replyCode);
            $buffer->appendUint8(strlen($frame->replyText)); $buffer->append($frame->replyText);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
        } elseif ($frame instanceof MethodBasicDeliverFrame) {
            $buffer->appendUint8(strlen($frame->consumerTag)); $buffer->append($frame->consumerTag);
            $buffer->appendInt64($frame->deliveryTag);
            $this->appendBits([$frame->redelivered], $buffer);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
        } elseif ($frame instanceof MethodBasicGetFrame) {
            $buffer->appendInt16($frame->reserved1);
            $buffer->appendUint8(strlen($frame->queue)); $buffer->append($frame->queue);
            $this->appendBits([$frame->noAck], $buffer);
        } elseif ($frame instanceof MethodBasicGetOkFrame) {
            $buffer->appendInt64($frame->deliveryTag);
            $this->appendBits([$frame->redelivered], $buffer);
            $buffer->appendUint8(strlen($frame->exchange)); $buffer->append($frame->exchange);
            $buffer->appendUint8(strlen($frame->routingKey)); $buffer->append($frame->routingKey);
            $buffer->appendInt32($frame->messageCount);
        } elseif ($frame instanceof MethodBasicGetEmptyFrame) {
            $buffer->appendUint8(strlen($frame->clusterId)); $buffer->append($frame->clusterId);
        } elseif ($frame instanceof MethodBasicAckFrame) {
            $buffer->appendInt64($frame->deliveryTag);
            $this->appendBits([$frame->multiple], $buffer);
        } elseif ($frame instanceof MethodBasicRejectFrame) {
            $buffer->appendInt64($frame->deliveryTag);
            $this->appendBits([$frame->requeue], $buffer);
        } elseif ($frame instanceof MethodBasicRecoverAsyncFrame) {
            $this->appendBits([$frame->requeue], $buffer);
        } elseif ($frame instanceof MethodBasicRecoverFrame) {
            $this->appendBits([$frame->requeue], $buffer);
        } elseif ($frame instanceof MethodBasicRecoverOkFrame) {
        } elseif ($frame instanceof MethodBasicNackFrame) {
            $buffer->appendInt64($frame->deliveryTag);
            $this->appendBits([$frame->multiple, $frame->requeue], $buffer);
        } elseif ($frame instanceof MethodTxSelectFrame) {
        } elseif ($frame instanceof MethodTxSelectOkFrame) {
        } elseif ($frame instanceof MethodTxCommitFrame) {
        } elseif ($frame instanceof MethodTxCommitOkFrame) {
        } elseif ($frame instanceof MethodTxRollbackFrame) {
        } elseif ($frame instanceof MethodTxRollbackOkFrame) {
        } elseif ($frame instanceof MethodConfirmSelectFrame) {
            $this->appendBits([$frame->nowait], $buffer);
        } elseif ($frame instanceof MethodConfirmSelectOkFrame) {
        } else {
            throw new ProtocolException('Unhandled method frame ' . get_class($frame) . '.');
        }
    }
1139254
protected function bufferize($char)
    {
        $buffer = $this->getBuffer();
        $buffer[] = $char;
        $this->setBuffer($buffer);
    }
153042
public void compile() {
        if (compiledSize == 0) {
            ByteBuffer bb = m_container.b();
            compiledSize = bb.position();
            bb.flip();
            m_allocator.track(compiledSize);
        }

        if (log.isTraceEnabled()) {
            StringBuilder sb = new StringBuilder("Compiling buffer:   ");
            ByteBuffer dup = m_container.bDR();
            while (dup.hasRemaining()) {
                sb.append(" ").append(dup.get());
            }
            log.trace(sb.toString());
        }
    }