diff --git a/modules/sms_devel/sms_devel.virtualgw.inc b/modules/sms_devel/sms_devel.virtualgw.inc index 151f658..49876f1 100644 --- a/modules/sms_devel/sms_devel.virtualgw.inc +++ b/modules/sms_devel/sms_devel.virtualgw.inc @@ -14,7 +14,7 @@ "in_number" to simply "gw_number". */ -use Drupal\sms\Gateway\GatewayInterface; +use Drupal\sms\Gateway\SmsGatewayPluginInterface; use Drupal\sms\Message\SmsMessageInterface; define('SMS_DEVEL_VIRTUALGW_TYPE_OUT', 0); @@ -62,7 +62,7 @@ function sms_devel_virtualgw_send($number, $message, $options) { // Always return success return array( 'status' => TRUE, - 'status_code' => GatewayInterface::STATUS_OK, + 'status_code' => SmsGatewayPluginInterface::STATUS_OK, 'gateway_status_code' => 'OK', 'gateway_status_text' => 'sms_devel_virtualgw: send: OK', ); diff --git a/modules/sms_track/sms_track.module b/modules/sms_track/sms_track.module index 28ea498..213dff0 100644 --- a/modules/sms_track/sms_track.module +++ b/modules/sms_track/sms_track.module @@ -8,11 +8,11 @@ */ use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\sms\Gateway\GatewayInterface; +use Drupal\sms\Gateway\SmsGatewayPluginInterface; use Drupal\sms\Message\SmsMessageInterface; use Drupal\views\Plugin\views\query\QueryPluginBase; use \Drupal\views\ViewExecutable; -use Drupal\sms\SmsGatewayInterface; +use Drupal\sms\Entity\SmsGatewayInterface; /** * Implements hook_help(). @@ -62,7 +62,7 @@ function sms_track_sms_send(SmsMessageInterface $sms, array $options, SmsGateway * The SMS message object. * @param array $options * Additional options array including sender. - * @param \Drupal\sms\SmsGatewayInterface $sms_gateway + * @param \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway * Gateway array for the active gateway. * @param bool|array $result * The result from the gateway response handler. @@ -157,10 +157,10 @@ function sms_track_archive_write($dir, $number, $message, array $options = array // Or render a status code from a simple true/false result if (! $status) { if ($options['result']) { - $status = GatewayInterface::STATUS_OK; + $status = SmsGatewayPluginInterface::STATUS_OK; } else { - $status = GatewayInterface::STATUS_ERR_OTHER; + $status = SmsGatewayPluginInterface::STATUS_ERR_OTHER; } } // Add the author and recipient diff --git a/modules/sms_user/sms_user.module b/modules/sms_user/sms_user.module index e87b43d..470894d 100644 --- a/modules/sms_user/sms_user.module +++ b/modules/sms_user/sms_user.module @@ -8,9 +8,9 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; -use Drupal\sms\Gateway\GatewayInterface; +use Drupal\sms\Gateway\SmsGatewayPluginInterface; use Drupal\sms\Message\SmsMessageInterface; -use Drupal\sms\SmsGatewayInterface; +use Drupal\sms\Entity\SmsGatewayInterface; use Drupal\user\Entity\User; use Drupal\user\UserInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; diff --git a/sms.module b/sms.module index 01081f1..e23e82f 100644 --- a/sms.module +++ b/sms.module @@ -8,7 +8,7 @@ use Drupal\Core\Form\FormState; use Drupal\Core\Form\FormStateInterface; -use Drupal\sms\Gateway\GatewayInterface; +use Drupal\sms\Gateway\SmsGatewayPluginInterface; use Drupal\sms\Message\SmsMessage; use Drupal\sms\Message\SmsMessageInterface; use Drupal\sms\Message\SmsMessageResultInterface; @@ -129,7 +129,7 @@ function sms_incoming($number, $message, array $options = array()) { * * @deprecated use \Drupal\sms\Provider\SmsProviderInterface::receipt() instead. */ -function sms_receipt($number, $reference, $message_status = GatewayInterface::STATUS_UNKNOWN, $options = array()) { +function sms_receipt($number, $reference, $message_status = SmsGatewayPluginInterface::STATUS_UNKNOWN, $options = array()) { \Drupal::service('sms_provider')->receipt($number, $reference, $message_status, $options); } @@ -147,7 +147,7 @@ function sms_receipt($number, $reference, $message_status = GatewayInterface::ST * @see sms_send_form_submit_submit() */ function sms_send_form($required = FALSE) { - /** @var \Drupal\sms\Gateway\GatewayManagerInterface $manager */ + /** @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface $manager */ $manager = \Drupal::service('plugin.manager.sms_gateway'); if ($gateway = $manager->getDefaultGateway()) { @@ -349,7 +349,7 @@ function carrier_delete($domain) { * The formatted number. */ function sms_format_number($number, array $options = []) { - /** @var \Drupal\sms\Gateway\GatewayManagerInterface $manager */ + /** @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface $manager */ $manager = \Drupal::service('plugin.manager.sms_gateway'); if ($gateway = $manager->getDefaultGateway()) { @@ -435,7 +435,7 @@ function sms_validate_number(&$number, array $options = array()) { $gateway = \Drupal\sms\Entity\SmsGateway::load($options['gateway']); } else { - /** @var \Drupal\sms\Gateway\GatewayManagerInterface $manager */ + /** @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface $manager */ $manager = \Drupal::service('plugin.manager.sms_gateway'); $gateway = $manager->getDefaultGateway(); } diff --git a/sms.services.yml b/sms.services.yml index 48d827d..4fbc02f 100644 --- a/sms.services.yml +++ b/sms.services.yml @@ -5,5 +5,5 @@ services: class: Drupal\sms\Provider\DefaultSmsProvider arguments: ['@plugin.manager.sms_gateway', '@module_handler'] plugin.manager.sms_gateway: - class: Drupal\sms\Gateway\GatewayManager + class: Drupal\sms\Gateway\SmsGatewayPluginManager arguments: ['@container.namespaces', '@config.factory', '@cache.discovery', '@module_handler'] diff --git a/src/DeliveryReportController.php b/src/DeliveryReportController.php index 82c7f66..fb2d324 100644 --- a/src/DeliveryReportController.php +++ b/src/DeliveryReportController.php @@ -10,7 +10,7 @@ namespace Drupal\sms; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\sms\Entity\SmsGateway; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\sms\Gateway\GatewayManagerInterface; +use Drupal\sms\Gateway\SmsGatewayPluginManagerInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; @@ -22,7 +22,7 @@ class DeliveryReportController implements ContainerInjectionInterface { /** * The gateway manager. * - * @var \Drupal\sms\Gateway\GatewayManagerInterface + * @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface */ protected $gatewayManager; @@ -36,12 +36,12 @@ class DeliveryReportController implements ContainerInjectionInterface { /** * Creates an new delivery report controller. * - * @param \Drupal\sms\Gateway\GatewayManagerInterface $gateway_manager + * @param \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface $gateway_manager * The gateway manager service. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack. */ - public function __construct(GatewayManagerInterface $gateway_manager, RequestStack $request_stack) { + public function __construct(SmsGatewayPluginManagerInterface $gateway_manager, RequestStack $request_stack) { $this->gatewayManager = $gateway_manager; $this->requestStack = $request_stack; } diff --git a/src/Entity/SmsGateway.php b/src/Entity/SmsGateway.php index a2009ef..54d8f0f 100644 --- a/src/Entity/SmsGateway.php +++ b/src/Entity/SmsGateway.php @@ -9,7 +9,6 @@ namespace Drupal\sms\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\sms\Plugin\SmsGatewayPluginCollection; -use Drupal\sms\SmsGatewayInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; /** diff --git a/src/SmsGatewayInterface.php b/src/Entity/SmsGatewayInterface.php similarity index 77% rename from src/SmsGatewayInterface.php rename to src/Entity/SmsGatewayInterface.php index c24452d..d59c31b 100644 --- a/src/SmsGatewayInterface.php +++ b/src/Entity/SmsGatewayInterface.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\sms\SmsGatewayInterface. + * Contains \Drupal\sms\Entity\SmsGatewayInterface. */ -namespace Drupal\sms; +namespace Drupal\sms\Entity; use Drupal\Core\Config\Entity\ConfigEntityInterface; @@ -17,7 +17,7 @@ interface SmsGatewayInterface extends ConfigEntityInterface { /** * Returns the plugin instance. * - * @return \Drupal\sms\Gateway\GatewayInterface + * @return \Drupal\sms\Gateway\SmsGatewayPluginInterface * The plugin instance for this SMS Gateway. */ public function getPlugin(); diff --git a/src/Form/SmsGatewayForm.php b/src/Form/SmsGatewayForm.php index 20d2b13..a8a59e1 100644 --- a/src/Form/SmsGatewayForm.php +++ b/src/Form/SmsGatewayForm.php @@ -12,7 +12,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\sms\Gateway\GatewayManagerInterface; +use Drupal\sms\Gateway\SmsGatewayPluginManagerInterface; use Drupal\sms\Entity\SmsGateway; /** @@ -28,15 +28,15 @@ class SmsGatewayForm extends EntityForm { /** * The gateway manager. * - * @var \Drupal\sms\Gateway\GatewayManagerInterface + * @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface */ protected $gatewayManager; /** - * @param \Drupal\sms\Gateway\GatewayManagerInterface $gateway_manager + * @param \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface $gateway_manager * The gateway manager service. */ - public function __construct(QueryFactory $query_factory, GatewayManagerInterface $gateway_manager) { + public function __construct(QueryFactory $query_factory, SmsGatewayPluginManagerInterface $gateway_manager) { $this->entityQueryFactory = $query_factory; $this->gatewayManager = $gateway_manager; } @@ -57,7 +57,7 @@ class SmsGatewayForm extends EntityForm { public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); - /** @var \Drupal\sms\SmsGatewayInterface $sms_gateway */ + /** @var \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway */ $sms_gateway = $this->getEntity(); if (!$sms_gateway->isNew()) { @@ -134,7 +134,7 @@ class SmsGatewayForm extends EntityForm { * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\sms\SmsGatewayInterface $sms_gateway */ + /** @var \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway */ $sms_gateway = $this->getEntity(); if ($sms_gateway->isNew()) { @@ -155,7 +155,7 @@ class SmsGatewayForm extends EntityForm { public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); - /** @var \Drupal\sms\SmsGatewayInterface $sms_gateway */ + /** @var \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway */ $sms_gateway = $this->getEntity(); if (!$sms_gateway->isNew()) { @@ -168,7 +168,7 @@ class SmsGatewayForm extends EntityForm { * {@inheritdoc} */ public function save(array $form, FormStateInterface $form_state) { - /** @var \Drupal\sms\SmsGatewayInterface $sms_gateway */ + /** @var \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway */ $sms_gateway = $this->getEntity(); $sms_gateway->setStatus($form_state->getValue('status')); diff --git a/src/Gateway/GatewayBase.php b/src/Gateway/SmsGatewayPluginBase.php similarity index 94% rename from src/Gateway/GatewayBase.php rename to src/Gateway/SmsGatewayPluginBase.php index 9dccc6f..319adae 100644 --- a/src/Gateway/GatewayBase.php +++ b/src/Gateway/SmsGatewayPluginBase.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\sms\Gateway\GatewayBase + * Contains \Drupal\sms\Gateway\SmsGatewayPluginBase */ namespace Drupal\sms\Gateway; @@ -14,7 +14,7 @@ use Symfony\Component\HttpFoundation\Request; /** * Base class for sms gateway plugins. */ -abstract class GatewayBase extends PluginBase implements GatewayInterface { +abstract class SmsGatewayPluginBase extends PluginBase implements SmsGatewayPluginInterface { /** * The watchdog logger for this gateway. diff --git a/src/Gateway/GatewayInterface.php b/src/Gateway/SmsGatewayPluginInterface.php similarity index 95% rename from src/Gateway/GatewayInterface.php rename to src/Gateway/SmsGatewayPluginInterface.php index 8903088..adb77ac 100644 --- a/src/Gateway/GatewayInterface.php +++ b/src/Gateway/SmsGatewayPluginInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\sms\Gateway\GatewayInterface + * Contains \Drupal\sms\Gateway\SmsGatewayPluginInterface */ namespace Drupal\sms\Gateway; @@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Request; /** * Default implementation of sms gateway plugin */ -interface GatewayInterface extends ConfigurablePluginInterface, PluginFormInterface, PluginInspectionInterface { +interface SmsGatewayPluginInterface extends ConfigurablePluginInterface, PluginFormInterface, PluginInspectionInterface { /** * Status Unknown. diff --git a/src/Gateway/GatewayManager.php b/src/Gateway/SmsGatewayPluginManager.php similarity index 87% rename from src/Gateway/GatewayManager.php rename to src/Gateway/SmsGatewayPluginManager.php index ad1a166..44c4e7e 100644 --- a/src/Gateway/GatewayManager.php +++ b/src/Gateway/SmsGatewayPluginManager.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\sms\Gateway\GatewayManager + * Contains \Drupal\sms\Gateway\SmsGatewayPluginManager */ namespace Drupal\sms\Gateway; @@ -12,12 +12,12 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\sms\Entity\SmsGateway; -use Drupal\sms\SmsGatewayInterface; +use Drupal\sms\Entity\SmsGatewayInterface; /** * Manages SMS gateways implemented using AnnotatedClassDiscovery */ -class GatewayManager extends DefaultPluginManager implements GatewayManagerInterface { +class SmsGatewayPluginManager extends DefaultPluginManager implements SmsGatewayPluginManagerInterface { /** * Configuration factory for this gateway manager. @@ -29,7 +29,7 @@ class GatewayManager extends DefaultPluginManager implements GatewayManagerInter /** * List of gateways managed by this gateway manager. * - * @var \Drupal\sms\Gateway\GatewayInterface[] + * @var \Drupal\sms\Gateway\SmsGatewayPluginInterface[] */ protected $gateways; @@ -48,7 +48,7 @@ class GatewayManager extends DefaultPluginManager implements GatewayManagerInter protected $defaultGateway; /** - * Create new GatewayManager instance. + * Create new SmsGatewayPluginManager instance. * * @param \Traversable $namespaces * The namespaces to search for the gateway plugins. diff --git a/src/Gateway/GatewayManagerInterface.php b/src/Gateway/SmsGatewayPluginManagerInterface.php similarity index 63% rename from src/Gateway/GatewayManagerInterface.php rename to src/Gateway/SmsGatewayPluginManagerInterface.php index 9911174..bd24a91 100644 --- a/src/Gateway/GatewayManagerInterface.php +++ b/src/Gateway/SmsGatewayPluginManagerInterface.php @@ -2,22 +2,22 @@ /** * @file - * Contains \Drupal\sms\GatewayInterface + * Contains \Drupal\sms\SmsGatewayPluginInterface */ namespace Drupal\sms\Gateway; use Drupal\Component\Plugin\PluginManagerInterface; -use Drupal\sms\SmsGatewayInterface; +use Drupal\sms\Entity\SmsGatewayInterface; /** * Manages SMS Gateways. */ -interface GatewayManagerInterface extends PluginManagerInterface { +interface SmsGatewayPluginManagerInterface extends PluginManagerInterface { /** * Get the default SMS gateway. * - * @return \Drupal\sms\SmsGatewayInterface|FALSE + * @return \Drupal\sms\Entity\SmsGatewayInterface|FALSE * A SmsGateway config entity, or FALSE if default gateway is not set or * invalid. */ @@ -26,7 +26,7 @@ interface GatewayManagerInterface extends PluginManagerInterface { /** * Sets the default site SMS Gateway. * - * @param \Drupal\sms\SmsGatewayInterface $sms_gateway + * @param \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway * The new site default SMS Gateway. */ public function setDefaultGateway(SmsGatewayInterface $sms_gateway); diff --git a/src/Lists/SmsGatewayListBuilder.php b/src/Lists/SmsGatewayListBuilder.php index 8a9de66..f9929b0 100644 --- a/src/Lists/SmsGatewayListBuilder.php +++ b/src/Lists/SmsGatewayListBuilder.php @@ -30,7 +30,7 @@ class SmsGatewayListBuilder extends ConfigEntityListBuilder { public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage) { parent::__construct($entity_type, $storage); - /** @var \Drupal\sms\Gateway\GatewayManagerInterface $manager */ + /** @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface $manager */ $manager = \Drupal::service('plugin.manager.sms_gateway'); $this->defaultGatewayId = $manager->getDefaultGateway() ? $manager->getDefaultGateway()->id() : FALSE; } @@ -48,10 +48,9 @@ class SmsGatewayListBuilder extends ConfigEntityListBuilder { /** * {@inheritdoc} - * - * @param \Drupal\sms\SmsGatewayInterface $entity */ public function buildRow(EntityInterface $entity) { + /** @var \Drupal\sms\Entity\SmsGatewayInterface $entity */ $row['label'] = $entity->label(); $row['gateway'] = $entity->getPlugin()->getPluginDefinition()['label']; $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); diff --git a/src/Plugin/Gateway/LogGateway.php b/src/Plugin/Gateway/LogGateway.php index 65f07e4..915374a 100644 --- a/src/Plugin/Gateway/LogGateway.php +++ b/src/Plugin/Gateway/LogGateway.php @@ -6,7 +6,7 @@ namespace Drupal\sms\Plugin\Gateway; -use Drupal\sms\Gateway\GatewayBase; +use Drupal\sms\Gateway\SmsGatewayPluginBase; use Drupal\sms\Message\SmsMessageInterface; use Drupal\sms\Message\SmsMessageResult; @@ -16,7 +16,7 @@ use Drupal\sms\Message\SmsMessageResult; * label = @Translation("Drupal log"), * ) */ -class LogGateway extends GatewayBase { +class LogGateway extends SmsGatewayPluginBase { /** * {@inheritdoc} diff --git a/src/Provider/DefaultSmsProvider.php b/src/Provider/DefaultSmsProvider.php index cfb66d1..a8dbf77 100644 --- a/src/Provider/DefaultSmsProvider.php +++ b/src/Provider/DefaultSmsProvider.php @@ -9,12 +9,12 @@ namespace Drupal\sms\Provider; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\sms\Entity\SmsGateway; -use Drupal\sms\Gateway\GatewayInterface; -use Drupal\sms\Gateway\GatewayManagerInterface; +use Drupal\sms\Gateway\SmsGatewayPluginInterface; +use Drupal\sms\Gateway\SmsGatewayPluginManagerInterface; use Drupal\sms\Message\SmsMessageInterface; use Drupal\sms\Message\SmsMessageResultInterface; use Drupal\sms\SmsException; -use Drupal\sms\SmsGatewayInterface; +use Drupal\sms\Entity\SmsGatewayInterface; /** * The SMS provider that provides default messaging functionality. @@ -24,7 +24,7 @@ class DefaultSmsProvider implements SmsProviderInterface { /** * The SMS gateway manager. * - * @var \Drupal\sms\Gateway\GatewayManager + * @var \Drupal\sms\Gateway\SmsGatewayPluginManager */ protected $gatewayManager; @@ -38,12 +38,12 @@ class DefaultSmsProvider implements SmsProviderInterface { /** * Creates a new instance of the default SMS provider. * - * @param \Drupal\sms\Gateway\GatewayManagerInterface + * @param \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface * The gateway manager. * @param \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ - public function __construct(GatewayManagerInterface $gateway_manager, ModuleHandlerInterface $module_handler) { + public function __construct(SmsGatewayPluginManagerInterface $gateway_manager, ModuleHandlerInterface $module_handler) { $this->gatewayManager = $gateway_manager; $this->moduleHandler = $module_handler; } @@ -79,7 +79,7 @@ class DefaultSmsProvider implements SmsProviderInterface { * The SMS to be sent. * @param array $options * The gateway options. - * @param \Drupal\sms\Gateway\GatewayInterface $gateway + * @param \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway * The default gateway for sending this message. * * @return \Drupal\sms\Message\SmsMessageResultInterface @@ -97,7 +97,7 @@ class DefaultSmsProvider implements SmsProviderInterface { * The SMS to be sent. * @param array $options * Additional options to be passed to the SMS gateway. - * @param \Drupal\sms\Gateway\GatewayInterface $gateway + * @param \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway * The default gateway for sending this message. * * @return bool|null @@ -117,7 +117,7 @@ class DefaultSmsProvider implements SmsProviderInterface { * The SMS that was sent. * @param array $options * Additional options that were passed to the SMS gateway. - * @param \Drupal\sms\Gateway\GatewayInterface $gateway + * @param \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway * The default gateway for sending this message. * @param \Drupal\sms\Message\SmsMessageResultInterface $result * The message result from the gateway. @@ -141,7 +141,7 @@ class DefaultSmsProvider implements SmsProviderInterface { /** * {@inheritdoc} */ - public function receipt($number, $reference, $message_status = GatewayInterface::STATUS_UNKNOWN, array $options = array()) { + public function receipt($number, $reference, $message_status = SmsGatewayPluginInterface::STATUS_UNKNOWN, array $options = array()) { // @todo Implement rules event integration here for incoming SMS. // Execute three phases. $this->moduleHandler->invokeAll('sms_receipt', array('pre process', $number, $reference, $message_status, $options)); diff --git a/src/Provider/SmsProviderInterface.php b/src/Provider/SmsProviderInterface.php index c9e3438..dd751b9 100644 --- a/src/Provider/SmsProviderInterface.php +++ b/src/Provider/SmsProviderInterface.php @@ -7,7 +7,7 @@ namespace Drupal\sms\Provider; -use Drupal\sms\Gateway\GatewayInterface; +use Drupal\sms\Gateway\SmsGatewayPluginInterface; use Drupal\sms\Message\SmsMessageInterface; /** @@ -53,7 +53,7 @@ interface SmsProviderInterface { * status codes for common code handling. * * Allowed message status codes are defined as constants in - * @link \Drupal\sms\Gateway\GatewayInterface @endlink + * @link \Drupal\sms\Gateway\SmsGatewayPluginInterface @endlink * * The original gateway code and string will often be provided in the $options * array as 'gateway_message_status' and 'gateway_message_status_text'. @@ -65,10 +65,10 @@ interface SmsProviderInterface { * @param int $message_status * (optional) An SMS Framework message status code, according to the defined * constants. - * Defaults to \Drupal\sms\Gateway\GatewayInterface::STATUS_UNKNOWN. + * Defaults to \Drupal\sms\Gateway\SmsGatewayPluginInterface::STATUS_UNKNOWN. * @param array $options * (optional) Extended options passed by the receipt receiver. */ - public function receipt($number, $reference, $message_status = GatewayInterface::STATUS_UNKNOWN, array $options = array()); + public function receipt($number, $reference, $message_status = SmsGatewayPluginInterface::STATUS_UNKNOWN, array $options = array()); } diff --git a/src/Tests/SmsFrameworkWebTestBase.php b/src/Tests/SmsFrameworkWebTestBase.php index 3c4900b..7625bff 100644 --- a/src/Tests/SmsFrameworkWebTestBase.php +++ b/src/Tests/SmsFrameworkWebTestBase.php @@ -21,14 +21,14 @@ abstract class SmsFrameworkWebTestBase extends WebTestBase { /** * The gateway manager. * - * @var \Drupal\sms\Gateway\GatewayManagerInterface + * @var \Drupal\sms\Gateway\SmsGatewayPluginManagerInterface */ protected $gatewayManager; /** * 'Memory' test gateway instance. * - * @var \Drupal\sms\SmsGatewayInterface + * @var \Drupal\sms\Entity\SmsGatewayInterface */ protected $testGateway; diff --git a/tests/modules/sms_test_gateway/src/Plugin/Gateway/Memory.php b/tests/modules/sms_test_gateway/src/Plugin/Gateway/Memory.php index bb3ad62..ad26d0a 100644 --- a/tests/modules/sms_test_gateway/src/Plugin/Gateway/Memory.php +++ b/tests/modules/sms_test_gateway/src/Plugin/Gateway/Memory.php @@ -6,7 +6,7 @@ namespace Drupal\sms_test_gateway\Plugin\Gateway; -use Drupal\sms\Gateway\GatewayBase; +use Drupal\sms\Gateway\SmsGatewayPluginBase; use Drupal\sms\Message\SmsMessageInterface; use Drupal\sms\Message\SmsMessageResult; use Drupal\Core\Form\FormStateInterface; @@ -19,7 +19,7 @@ use Drupal\Core\Form\FormStateInterface; * label = @Translation("Memory"), * ) */ -class Memory extends GatewayBase { +class Memory extends SmsGatewayPluginBase { /** * {@inheritdoc}