当前位置: 首页>>代码示例>>PHP>>正文


PHP Inspector::isCallable方法代码示例

本文整理汇总了PHP中lithium\analysis\Inspector::isCallable方法的典型用法代码示例。如果您正苦于以下问题:PHP Inspector::isCallable方法的具体用法?PHP Inspector::isCallable怎么用?PHP Inspector::isCallable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lithium\analysis\Inspector的用法示例。


在下文中一共展示了Inspector::isCallable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: respondsTo

 /**
  * Custom check to determine if our given magic methods can be responded to.
  *
  * @param  string  $method     Method name.
  * @param  bool    $internal   Interal call or not.
  * @return bool
  */
 public function respondsTo($method, $internal = false)
 {
     $class = $this->_model;
     $modelRespondsTo = false;
     $parentRespondsTo = parent::respondsTo($method, $internal);
     $staticRespondsTo = $class::respondsTo($method, $internal);
     if (method_exists($class, '_object')) {
         $model = $class::invokeMethod('_object');
         $modelRespondsTo = $model->respondsTo($method);
     } else {
         $modelRespondsTo = Inspector::isCallable($class, $method, $internal);
     }
     return $parentRespondsTo || $staticRespondsTo || $modelRespondsTo;
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:21,代码来源:Entity.php

示例2: respondsTo

 /**
  * Will determine if a method can be called.
  *
  * @param  string  $method     Method name.
  * @param  bool    $internal   Interal call or not.
  * @return bool
  */
 public static function respondsTo($method, $internal = false)
 {
     return Inspector::isCallable(get_called_class(), $method, $internal);
 }
开发者ID:nilamdoc,项目名称:KYCGlobal,代码行数:11,代码来源:StaticObject.php

示例3: testCallableVisibility

 public function testCallableVisibility()
 {
     $obj = new MockMethodFiltering();
     $this->assertTrue(Inspector::isCallable($obj, 'method', 0));
     $this->assertTrue(Inspector::isCallable($obj, 'method', 1));
     $this->assertFalse(Inspector::isCallable('lithium\\action\\Dispatcher', '_callable', 0));
     $this->assertTrue(Inspector::isCallable('lithium\\action\\Dispatcher', '_callable', 1));
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:8,代码来源:InspectorTest.php

示例4: respondsTo

 /**
  * Will determine if a method can be called.
  *
  * @param  string  $method     Method name.
  * @param  bool    $internal   Interal call or not.
  * @return bool
  */
 public function respondsTo($method, $internal = false)
 {
     return Inspector::isCallable($this, $method, $internal);
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:11,代码来源:Object.php

示例5: respondsTo

 /**
  * Determines if a given method can be called.
  *
  * @param string $method Name of the method.
  * @param boolean $internal Provide `true` to perform check from inside the
  *                class/object. When `false` checks also for public visibility;
  *                defaults to `false`.
  * @return boolean Returns `true` if the method can be called, `false` otherwise.
  */
 public function respondsTo($method, $internal = false)
 {
     if (method_exists($class = $this->_model, '_object')) {
         $result = $class::invokeMethod('_object')->respondsTo($method);
     } else {
         $result = Inspector::isCallable($class, $method, $internal);
     }
     $result = $result || parent::respondsTo($method, $internal);
     $result = $result || $class::respondsTo($method, $internal);
     return $result;
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:20,代码来源:Entity.php


注:本文中的lithium\analysis\Inspector::isCallable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。