src/mako/common/ConnectionManager.php
public function executeAndClose(Closure $closure, ?string $connection = null)
	{
		$returnValue = $closure($this->connection($connection));

		$this->close($connection);

		return $returnValue;
	}
public function executeAndClose(Closure $closure, ?string $connection = null)
	{
		$returnValue = $closure($this->connection($connection));

		$this->close($connection);

		return $returnValue;
	}
public function executeAndClose ( Closure $ closure , ? string $ connection = null ) { $ returnValue = $ closure ( $ this -> connection ( $ connection ) ) ; $ this -> close ( $ connection ) ; return $ returnValue ; }
Executes the passed closure using the chosen connection before closing it.

@param  \Closure    $closure    Closure to execute
@param  string|null $connection Connection name
@return mixed
Executes the passed closure using the chosen connection before closing it .