LBCAlerte_ynh/sources/lib/Message/AdapterFactory.php
Jimmy Monin 57708e3169 Initial commit
Functional, without SSO
2016-09-18 11:03:26 +02:00

33 lines
904 B
PHP

<?php
namespace Message;
use \Message\Adapter;
class AdapterFactory
{
/**
* @param string $service
* @param array $options
* @return \Adapter\AdapterAbstract
*/
public static function factory($service, array $options = array())
{
$service = strtolower($service);
switch ($service) {
case "smsfreemobile":
case "freemobile":
return new Adapter\SmsFreeMobile($options);
case "smsovh":
case "ovh":
return new Adapter\SmsOvh($options);
case "notifymyandroid":
return new Adapter\NotifyMyAndroid($options);
case "pushbullet":
return new Adapter\Pushbullet($options);
case "pushover":
return new Adapter\Pushover($options);
}
throw new \Exception("No service available");
}
}