Created
April 14, 2016 00:37
-
-
Save patricknelson/162930fdbe56f95b0d8f2d7d77abdf82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Injector extends Nestception { | |
// ... rest of class... | |
public static function unnestTemp($callable) { | |
// Retain current instance so we can revert back to it momentarily. | |
$revertTo = self::inst(); | |
// Unnest. | |
self::unnest(); | |
// Execute. | |
call_user_func($callable, $revertTo); | |
// Revert! | |
return self::set_inst($revertTo); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment