Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4c8b25c118
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (21 sloc) 0.869 kb
<?php
trait CallableProperties {
public function __call($property, $args) {
if (!isset($this->$property)) {
return parent::__call($property, $args);
} elseif (!is_callable($this->$property)) {
$message = __CLASS__ . '::' . $property . ' is not callable.';
throw new BadMethodCallException($message);
}
return call_user_func_array($this->$property, $args);
}
public static function __callStatic($property, $args) {
if (!isset(static::$property)) {
return parent::__callStatic($property, $args);
} elseif (!is_callable(static::$property)) {
$message = __CLASS__ . '::' . $property . ' is not callable.';
throw new BadMethodCallException($message);
}
return forward_static_call_array(static::$property, $args);
}
}
Jump to Line
Something went wrong with that request. Please try again.