コード例 #1
0
 protected function handle($client)
 {
     $trans = $this->transportFactory->getTransport($client);
     $prot = $this->protocolFactory->getProtocol($trans);
     $this->_clientBegin($prot);
     try {
         if (!$trans instanceof TTransportStatus || \hacklib_cast_as_boolean($trans->isReadable())) {
             $this->processor->process($prot, $prot);
         }
     } catch (Exception $x) {
         $md = $client->getMetaData();
         if (\hacklib_cast_as_boolean($md[\hacklib_id("timed_out")])) {
         } else {
             if (\hacklib_cast_as_boolean($md[\hacklib_id("eof")])) {
                 \HH\invariant($trans instanceof TTransport, "Need to make Hack happy");
                 $trans->close();
                 return false;
             } else {
                 echo "Handle caught transport exception: " . $x->getMessage() . "\n";
             }
         }
     }
     return true;
 }
コード例 #2
0
ファイル: invariant_no_return.php プロジェクト: badlamer/hhvm
<?php

var_dump(HH\invariant(3));
コード例 #3
0
 public function readSetEnd()
 {
     $this->stack->pop();
     $val = $this->stack->lastValue();
     \HH\invariant($val !== null, "Stack is empty, this shouldn't happen!");
     $this->top = $val;
 }
コード例 #4
0
 public function handlerError($handler_context, $fn_name, $ex)
 {
     \HH\invariant($handler_context instanceof \HH\Map, 'Context is not a Map');
     foreach ($this->handlers as $key => $handler) {
         $handler->handlerError($handler_context->at($key), $fn_name, $ex);
     }
 }
コード例 #5
0
ファイル: invariant.php プロジェクト: jeremyadoux/hhvm
function f()
{
    \HH\invariant(1 == 1, 'test');
    \HH\invariant_violation('test2');
}
コード例 #6
0
ファイル: invariant.php プロジェクト: badlamer/hhvm
function f()
{
    \HH\invariant(1 == 1, "test");
    \HH\invariant_violation("test2");
}