Skip to content

Instantly share code, notes, and snippets.

@Danack
Created January 6, 2014 15:35
Show Gist options
  • Save Danack/8284515 to your computer and use it in GitHub Desktop.
Save Danack/8284515 to your computer and use it in GitHub Desktop.
Closure based factory.
<?php
function createTimerProxyXMySQLiStatementFactory(\Intahwebz\Timer $timer) {
$closure = function ($statement, $queryString, $logger) use ($timer) {
$object = new \Intahwebz\DB\TimerProxyXMySQLiStatement(
$statement, $queryString, $logger, $timer
);
return $object;
};
return new Intahwebz\DB\ClosureStatementFactory($closure);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment