SwitchStatic.php



namespace SwitchIt;

/**
 * @author Chris Chase
 * @version 1       
 */
class SwitchStatic {
	
	/**
	 *
	 * @param string $what        	
	 * @param unknown $data        	
	 */
	static function SwitchIt($what, $data = null) {
		if (is_callable ( array (static::class,	$what ) )) {
			return static::{$what} ( $data );
		} else {
			return static::DefaultSwitch ( $data );
		}
	}
	/**
	 *
	 * @param unknown $data        	
	 * @return boolean
	 */
	static function DefaultSwitch($data) {
		return false;
	}
}

1 Trackback / Pingback

  1. Switch Hell in PHP – S|RMonkeys

Leave a Reply

Your email address will not be published.


*