public static function generatePassphrase($length = 10){

		$recursion = 0;

		$generate = function($length){

			for($i = 0; $i < $length; $i++){

				$key = rand(0, count(self::$_passphrase_chars) - 1);
				/** @noinspection PhpUndefinedVariableInspection */
				$passphrase .= self::$_passphrase_chars[$key];
			}

			/** @noinspection PhpUndefinedVariableInspection */
			return $passphrase;
		};

		$passphrase = $generate($length);

		// Check if pass-phrase is secure enough

		$secure_pattern = "/^(?=.\{$length\})(?=(.*[A-Za-z].*){2,})(?=(.*[0-9].*){2,})(?=(.*\W.*){1,}).*$/";

		while(!preg_match($secure_pattern, $passphrase)){

			$passphrase = $generate($length);

			// We seem to be stuck; abort and go for last generated passphrase

			if($recursion > 10){

				ExceptionHandler::notice('Text::generatePassphrase() seems to be stuck, aborting');
				break;
			}
		}

		return $passphrase;
	}