本文整理汇总了PHP中Type::getClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getClass方法的具体用法?PHP Type::getClass怎么用?PHP Type::getClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::getClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: accepts
public function accepts(Type $type) : bool
{
if ($type instanceof MixedType) {
return true;
}
if ($this->isNullable() && $type instanceof NullType) {
return true;
}
if ($type instanceof StaticType) {
return $this->checkSubclassAcceptability($type->getBaseClass());
}
if ($type->getClass() === null) {
return false;
}
return $this->checkSubclassAcceptability($type->getClass());
}
示例2: accepts
public function accepts(Type $type) : bool
{
if ($type instanceof IterableType) {
return $this->getItemType()->accepts($type->getItemType());
}
if ($type->getClass() !== null && $this->exists($type->getClass())) {
$classReflection = new \ReflectionClass($type->getClass());
return $classReflection->implementsInterface(\Traversable::class);
}
if ($type instanceof MixedType) {
return true;
}
if ($this->isNullable() && $type instanceof NullType) {
return true;
}
return false;
}
示例3: isObject
static function isObject($v)
{
if ($v === null) {
return false;
}
if (is_object($v)) {
return $v instanceof _hx_anonymous || Type::getClass($v) !== null;
}
return is_string($v) && !_hx_is_lambda($v);
}
示例4: injectInto
public function injectInto($target)
{
$info = $this->getInfo(Type::getClass($target));
if ($info === null) {
return;
}
$_g = 0;
$_g1 = $info->fields;
while ($_g < $_g1->length) {
$field = $_g1[$_g];
++$_g;
$field->applyInjection($target, $this);
unset($field);
}
}
示例5: executeResult
public function executeResult($context)
{
try {
return $context->actionContext->actionResult->executeResult($context->actionContext);
} catch (Exception $__hx__e) {
$_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
$e = $_ex_;
$p_methodName = "executeResult";
$p_lineNumber = -1;
$p_fileName = "";
$p_customParams = new _hx_array(array("actionContext"));
$p_className = Type::getClassName(Type::getClass($context->actionContext));
return tink_core__Future_Future_Impl_::sync(tink_core_Outcome::Failure(ufront_web_HttpError::wrap($e, null, _hx_anonymous(array("fileName" => "MVCHandler.hx", "lineNumber" => 70, "className" => "ufront.web.MVCHandler", "methodName" => "executeResult")))));
}
}
示例6: accepts
public function accepts(Type $type) : bool
{
if ($type instanceof self) {
return true;
}
if ($this->isNullable() && $type instanceof NullType) {
return true;
}
if ($type instanceof ArrayType && $type->isPossiblyCallable()) {
return true;
}
if ($type->getClass() === 'Closure') {
return true;
}
return $type instanceof MixedType;
}
示例7: isEditorLicensed
public function isEditorLicensed()
{
$licenseClass = Type::resolveClass("com.wiris.util.sys.License");
if ($licenseClass !== null) {
$init = Reflect::field($licenseClass, "init");
$initMethodParams = new _hx_array(array());
$initMethodParams->push($this->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$EDITOR_KEY, ""));
$initMethodParams->push("");
$initMethodParams->push(new _hx_array(array(4, 5, 9, 10)));
Reflect::callMethod($licenseClass, $init, $initMethodParams);
$isLicensedMethod = Reflect::field($licenseClass, "isLicensed");
$isLicensedObject = Reflect::callMethod($licenseClass, $isLicensedMethod, null);
$isLicensed = null;
if (_hx_index_of(Type::getClassName(Type::getClass($isLicensedObject)), "Boolean", null) !== -1) {
$isLicensed = _hx_string_call($isLicensedObject, "toString", array());
} else {
$isLicensed = $isLicensedObject;
}
return $isLicensed;
}
return false;
}
示例8: executeApiCall
public function executeApiCall($path, $args, $remotingContext, $actionContext)
{
if ($remotingContext->objects->exists($path[0]) === false) {
throw new HException("Invalid path " . _hx_string_or_null($path->join(".")));
}
$actionContext->handler = $this;
$actionContext->action = $path[$path->length - 1];
$actionContext->controller = $remotingContext->objects->get($path[0])->obj;
$actionContext->args = $args;
$returnType = null;
try {
$fieldsMeta = haxe_rtti_Meta::getFields(Type::getClass($actionContext->controller));
$actionMeta = Reflect::field($fieldsMeta, $actionContext->action);
$returnType = $actionMeta->returnType[0];
} catch (Exception $__hx__e) {
$_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
$e = $_ex_;
$returnType = 0;
}
$flags = $returnType;
$result = $remotingContext->call($path, $args);
if (($flags & 1 << ufront_api_ApiReturnType::$ARTFuture->index) !== 0) {
return $result;
} else {
if (($flags & 1 << ufront_api_ApiReturnType::$ARTVoid->index) !== 0) {
return tink_core__Future_Future_Impl_::sync(null);
} else {
return tink_core__Future_Future_Impl_::sync($result);
}
}
}
示例9: toString
public function toString()
{
return Type::getClassName(Type::getClass($this));
}
示例10: isArray
static function isArray($arr)
{
if (Type::getClassName(Type::getClass($arr)) === "Array") {
return true;
} else {
return false;
}
}
示例11: encodeImpl
public function encodeImpl($sb, $o)
{
if (com_wiris_system_TypeTools::isHash($o)) {
$this->encodeHash($sb, $o);
} else {
if (com_wiris_system_TypeTools::isArray($o)) {
$this->encodeArray($sb, $o);
} else {
if (Std::is($o, _hx_qtype("String"))) {
$this->encodeString($sb, $o);
} else {
if (Std::is($o, _hx_qtype("Int"))) {
$this->encodeInteger($sb, $o);
} else {
if (Std::is($o, _hx_qtype("haxe.Int64"))) {
$this->encodeLong($sb, $o);
} else {
if (Std::is($o, _hx_qtype("com.wiris.util.json.JSonIntegerFormat"))) {
$this->encodeIntegerFormat($sb, $o);
} else {
if (Std::is($o, _hx_qtype("Bool"))) {
$this->encodeBoolean($sb, $o);
} else {
if (Std::is($o, _hx_qtype("Float"))) {
$this->encodeFloat($sb, $o);
} else {
throw new HException("Impossible to convert to json object of type " . Std::string(Type::getClass($o)));
}
}
}
}
}
}
}
}
}
示例12: addCrumb
public function addCrumb($instance, $methodName = null)
{
$classPath = Type::getClassName(Type::getClass($instance));
$this->data->error->crumbs->push(_hx_anonymous(array("classPath" => $classPath, "methodName" => $methodName)));
}
示例13: ufront_app_HttpApplication_12
function ufront_app_HttpApplication_12(&$_g, &$ctx, &$doneTrigger, &$err, &$errHandlerModules, &$resMidModules, $m2)
{
$b2 = _hx_anonymous(array("methodName" => "log", "lineNumber" => -1, "fileName" => "", "customParams" => new _hx_array(array("httpContext", "appMessages")), "className" => Type::getClassName(Type::getClass($m2))));
return new tink_core_MPair(ufront_app_HttpApplication_25($__hx__this, $_g, $b2, $ctx, $doneTrigger, $err, $errHandlerModules, $m2, $resMidModules), $b2);
}
示例14: fakePosition
static function fakePosition($obj, $method, $args = null)
{
return _hx_anonymous(array("methodName" => $method, "lineNumber" => -1, "fileName" => "", "customParams" => $args, "className" => Type::getClassName(Type::getClass($obj))));
}
示例15: dumpObjectRsafe
static function dumpObjectRsafe($ob, $i = null)
{
$tClass = Type::getClass($ob);
$m = "dumpObjectRsafe:" . Std::string($ob !== null ? Type::getClass($ob) : $ob) . "\n";
$names = new _hx_array(array());
if (Type::getClass($ob) !== null) {
$names = Type::getInstanceFields(Type::getClass($ob));
} else {
$names = Reflect::fields($ob);
}
if (Type::getClass($ob) !== null) {
$m = _hx_string_or_null(Type::getClassName(Type::getClass($ob))) . ":\n";
}
$_g = 0;
while ($_g < $names->length) {
$name = $names[$_g];
++$_g;
try {
$t = Std::string(Type::typeof(Reflect::field($ob, $name)));
if (me_cunity_debug_Out::$skipFunctions && $t === "TFunction") {
null;
}
if ($name === "parentView" || $name === "ContextMenu" || $name === "cMenu") {
$m .= _hx_string_or_null($name) . ":" . Std::string($ob->parentView->id) . "\n";
} else {
$m .= _hx_string_or_null($name) . ":" . Std::string(Reflect::field($ob, $name)) . ":" . _hx_string_or_null($t) . "\n";
}
unset($t);
} catch (Exception $__hx__e) {
$_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
$ex = $_ex_;
$m .= _hx_string_or_null($name) . ":" . Std::string($ex);
}
unset($name, $ex);
}
me_cunity_debug_Out::_trace($m, $i);
}