本文整理汇总了PHP中Std::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Std::instance方法的具体用法?PHP Std::instance怎么用?PHP Std::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Std
的用法示例。
在下文中一共展示了Std::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wrap
static function wrap($resultValue)
{
if ($resultValue === null) {
return new ufront_web_result_EmptyResult(null);
} else {
$actionResultValue = Std::instance($resultValue, _hx_qtype("ufront.web.result.ActionResult"));
if ($actionResultValue === null) {
$actionResultValue = new ufront_web_result_ContentResult(Std::string($resultValue), null);
}
return $actionResultValue;
}
}
示例2: minject_Injector_0
function minject_Injector_0(&$forClass, &$info, $p1, $p2)
{
$post1 = Std::instance($p1, _hx_qtype("minject.point.PostInjectionPoint"));
$post2 = Std::instance($p2, _hx_qtype("minject.point.PostInjectionPoint"));
if ($post1 === null) {
if ($post2 === null) {
return 0;
} else {
switch ($post2) {
default:
return -1;
break;
}
}
} else {
switch ($post1) {
default:
if ($post2 === null) {
return 1;
} else {
switch ($post2) {
default:
return $post1->order - $post2->order;
break;
}
}
break;
}
}
}
示例3: remotingError
static function remotingError($error, $pos = null)
{
switch ($error->index) {
case 0:
$responseData = _hx_deref($error)->params[2];
$responseCode = _hx_deref($error)->params[1];
$remotingCallString = _hx_deref($error)->params[0];
return tink_core_TypedError::typed($responseCode, "HTTP " . _hx_string_rec($responseCode, "") . " Error during " . _hx_string_or_null($remotingCallString), $error, $pos);
break;
case 1:
$errorMessage = _hx_deref($error)->params[1];
$remotingCallString1 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(404, "Remoting API " . _hx_string_or_null($remotingCallString1) . " not found: " . _hx_string_or_null($errorMessage), $error, $pos);
break;
case 2:
$stack = _hx_deref($error)->params[2];
$e = _hx_deref($error)->params[1];
$remotingCallString2 = _hx_deref($error)->params[0];
$errorObj = Std::instance($e, _hx_qtype("tink.core.TypedError"));
if ($errorObj !== null) {
return tink_core_TypedError::typed($errorObj->code, $errorObj->message, $error, $pos);
} else {
return tink_core_TypedError::typed(500, "Internal Server Error while executing " . _hx_string_or_null($remotingCallString2), $error, $pos);
}
break;
case 3:
$e1 = _hx_deref($error)->params[1];
$remotingCallString3 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Error during callback after " . _hx_string_or_null($remotingCallString3) . ": " . Std::string($e1), $error, $pos);
break;
case 4:
$err = _hx_deref($error)->params[2];
$troubleLine = _hx_deref($error)->params[1];
$remotingCallString4 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(422, "Remoting serialization failed for call " . _hx_string_or_null($remotingCallString4) . ": could not process " . _hx_string_or_null($troubleLine), $error, $pos);
break;
case 5:
$responseData1 = _hx_deref($error)->params[1];
$remotingCallString5 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Error with response for " . _hx_string_or_null($remotingCallString5) . ": no remoting response found", $error, $pos);
break;
case 6:
$data = _hx_deref($error)->params[1];
$remotingCallString6 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Call to " . _hx_string_or_null($remotingCallString6) . " failed: " . Std::string($data), $error, $pos);
break;
case 7:
$e2 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Unknown exception during remoting call", $error, $pos);
break;
}
}