Created
January 3, 2016 02:21
-
-
Save aaemnnosttv/1b77e9300e77b4ac7748 to your computer and use it in GitHub Desktop.
Simple value callback return generator
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 | |
if ( ! function_exists('__return') ) : | |
/** | |
* Simple return callback generator | |
* | |
* @param null $return | |
* @return Closure | |
*/ | |
function __return($return = null) { | |
return function() use ($return) { | |
return $return; | |
}; | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment