public function Decorator::isCallable in Devel 8.2
Same name and namespace in other branches
- 8.3 webprofiler/src/Decorator.php \Drupal\webprofiler\Decorator::isCallable()
- 8 webprofiler/src/Decorator.php \Drupal\webprofiler\Decorator::isCallable()
- 4.x webprofiler/src/Decorator.php \Drupal\webprofiler\Decorator::isCallable()
Returns true if $method is a PHP callable.
Parameters
string $method: The method name.
bool $checkSelf:
Return value
bool|mixed
1 call to Decorator::isCallable()
- Decorator::__call in webprofiler/src/ Decorator.php 
File
- webprofiler/src/ Decorator.php, line 48 
Class
- Decorator
- Generic class Decorator.
Namespace
Drupal\webprofilerCode
public function isCallable($method, $checkSelf = FALSE) {
  //Check the original object
  $object = $this
    ->getOriginalObject();
  if (is_callable([
    $object,
    $method,
  ])) {
    return $object;
  }
  // Check Decorators.
  $object = $checkSelf ? $this : $this->object;
  while ($object instanceof Decorator) {
    if (is_callable([
      $object,
      $method,
    ])) {
      return $object;
    }
    $object = $this->object;
  }
  return FALSE;
}