<?php namespace Intellex\Upload;

/**
 * Assert various tests.
 */
class Assert {

	/**
	 * Assert the test or throw exception.
	 *
	 * @param mixed  $switch    If this value resolves to false, an exception will be thrown.
	 * @param string $exception The class name of exception to throw.
	 * @param string $message   An additional message for the exception.
	 *
	 * @throws \Exception If $switch resolve to false.
	 */
	public static function orThrow($switch, $exception, $message) {
		if (!$switch) {
			throw new $exception($message);
		}
	}

}
