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 | |
/** | |
* The Signal class is the smallest and fastest observer written in PHP 5.6 and | |
* using some new features such as the variadic functions and the arguments | |
* unpacking. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> |
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 | |
/** | |
* The render function is a lightweight template engine, that allows string | |
* interpolation and output escaping. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> | |
*/ |
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 | |
/** | |
* The Container class is a lightweight service container. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> | |
*/ | |
class Container{private $s;function set($k,$c){$this->s[$k]=$c;}function get($k){return(is_a($v=$this->s[$k],'Closure'))?$v($this):$v;}} |
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 | |
/** | |
* The Router class is a fast and lightweight router (yes it is). It can handle | |
* a path and call the matching controller. If there is no match, then an | |
* exception will be throwned. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> |