/** * @param callable $value * @param int $flag A flag used by the `ValueType::getType()` method (not used here) * @throws \ReflectionException if the parameter is not a closure */ public function __construct($value, $flag = ValueType::MODE_STRICT) { if (!ValueType::isCallable($value)) { throw new \ReflectionException(sprintf(__METHOD__ . ' expects parameter one to be callable, %s given', gettype($value))); } parent::__construct($value, $flag); $this->value_type = ValueType::TYPE_CALLBACK; $this->callback = $this->value; $this->callback_type = ValueType::getCallbackType($this->callback); }