callback = $callback; } } public function visit(Shell $shell): Shell { if (! isset($this->callback)) { return $shell; } return ($this->callback)($shell); } }