diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index d01cc263cac77fe158649a89628f6cc27490b56e..ec4c611fba484966a95fe5cd5857815c09cf48cf 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -342,7 +342,7 @@ $config = [ 'VuFind\Service\ReCaptcha' => 'VuFind\Service\ReCaptchaFactory', 'VuFind\Session\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Session\Settings' => 'Zend\ServiceManager\Factory\InvokableFactory', - 'VuFind\SMS' => 'VuFind\SMS\Factory', + 'VuFind\SMS\SMSInterface' => 'VuFind\SMS\Factory', 'VuFind\Solr\Writer' => 'VuFind\Solr\WriterFactory', 'VuFind\Tags' => 'VuFind\Service\Factory::getTags', 'VuFind\Translator' => 'VuFind\Service\Factory::getTranslator', @@ -413,6 +413,7 @@ $config = [ 'VuFind\SearchTabsHelper' => 'VuFind\Search\SearchTabsHelper', 'VuFind\SessionManager' => 'Zend\Session\SessionManager', 'VuFind\SessionPluginManager' => 'VuFind\Session\PluginManager', + 'VuFind\SMS' => 'VuFind\SMS\SMSInterface', 'VuFind\YamlReader' => 'VuFind\Config\YamlReader', ], ], diff --git a/module/VuFind/src/VuFind/Controller/AbstractRecord.php b/module/VuFind/src/VuFind/Controller/AbstractRecord.php index 57be64272accc8f02df58fce3b2209636961a180..ed085cc8e7dc6b79a809a5ee16b63a0b64beb5c5 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractRecord.php +++ b/module/VuFind/src/VuFind/Controller/AbstractRecord.php @@ -472,7 +472,7 @@ class AbstractRecord extends AbstractBase $driver = $this->loadRecord(); // Load the SMS carrier list: - $sms = $this->serviceLocator->get('VuFind\SMS'); + $sms = $this->serviceLocator->get('VuFind\SMS\SMSInterface'); $view = $this->createViewModel(); $view->carriers = $sms->getCarriers(); $view->validation = $sms->getValidationType(); diff --git a/module/VuFind/src/VuFind/SMS/Factory.php b/module/VuFind/src/VuFind/SMS/Factory.php index 91e8bc29057e2c3f980d4fb69fea5de82fbc831e..8892f42a3fea76525a4348b5088102003fd657f7 100644 --- a/module/VuFind/src/VuFind/SMS/Factory.php +++ b/module/VuFind/src/VuFind/SMS/Factory.php @@ -46,19 +46,20 @@ class Factory implements FactoryInterface /** * Create service * - * @param ContainerInterface $sm Service manager - * @param string $name Requested service name (unused) - * @param array $options Extra options (unused) + * @param ContainerInterface $container Service manager + * @param string $name Requested service name (unused) + * @param array $options Extra options (unused) * * @return SMSInterface * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function __invoke(ContainerInterface $sm, $name, array $options = null) - { + public function __invoke(ContainerInterface $container, $name, + array $options = null + ) { // Load configurations: - $mainConfig = $sm->get('VuFind\Config\PluginManager')->get('config'); - $smsConfig = $sm->get('VuFind\Config\PluginManager')->get('sms'); + $mainConfig = $container->get('VuFind\Config\PluginManager')->get('config'); + $smsConfig = $container->get('VuFind\Config\PluginManager')->get('sms'); // Determine SMS type: $type = isset($smsConfig->General->smsType) @@ -67,10 +68,10 @@ class Factory implements FactoryInterface // Initialize object based on requested type: switch (strtolower($type)) { case 'clickatell': - $client = $sm->get('VuFindHttp\HttpService')->createClient(); + $client = $container->get('VuFindHttp\HttpService')->createClient(); return new Clickatell($smsConfig, ['client' => $client]); case 'mailer': - $options = ['mailer' => $sm->get('VuFind\Mailer\Mailer')]; + $options = ['mailer' => $container->get('VuFind\Mailer\Mailer')]; if (isset($mainConfig->Site->email)) { $options['defaultFrom'] = $mainConfig->Site->email; }