public function __construct($closure) { $this->_closure = $closure; if (!is_callable($this->_closure)) { throw new Exception("A closure is required by `Given` constructor."); } $this->_closure = $this->_closure->bindTo($this); }