/** * @param callable $value * @throws \ReflectionException if the parameter is not a closure */ public function __construct($value) { if (!ValueType::isCallable($value)) { throw new \ReflectionException(sprintf(__METHOD__ . ' expects parameter one to be callable, %s given', gettype($value))); } $this->setReadOnlyProperties($this::$_read_only); $this->callback = $value; $this->type = ValueType::getCallbackType($value); $this->_populate(); }