Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_gateway.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-08-21 16:33:15 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-08-21 16:33:15 +0300
commit6de6fca2486413d9d92c2756b8d25583aed82780 (patch)
tree3ac68eea75c115ddacef90956a4f9fa49043cb02
parent636672327b65339b6bca1b50ad27e12942143b5b (diff)
Refactor gateway namespaces in preparation to #90
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--lib/AppInfo/Application.php10
-rw-r--r--lib/Provider/SmsProvider.php2
-rw-r--r--lib/Provider/State.php2
-rw-r--r--lib/Service/Gateway/IGateway.php (renamed from lib/Service/IGateway.php)2
-rw-r--r--lib/Service/Gateway/SMS/PlaySMSGateway.php (renamed from lib/Service/Gateway/PlaySMSGateway.php)4
-rw-r--r--lib/Service/Gateway/SMS/WebSmsGateway.php (renamed from lib/Service/Gateway/WebSmsGateway.php)4
-rw-r--r--lib/Service/Gateway/Signal/Gateway.php (renamed from lib/Service/Gateway/SignalGateway.php)6
-rw-r--r--lib/Service/Gateway/Telegram/Gateway.php (renamed from lib/Service/Gateway/TelegramGateway.php)6
-rw-r--r--lib/Service/Gateway/TestGateway.php2
-rw-r--r--lib/Service/SetupService.php1
-rw-r--r--lib/Service/StateStorage.php1
-rw-r--r--tests/Unit/Provider/SmsProviderTest.php2
-rw-r--r--tests/Unit/Service/SetupServiceTest.php2
-rw-r--r--tests/Unit/Service/StateStorageTest.php2
14 files changed, 24 insertions, 22 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index 8ce7af1..2c38aa8 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -24,12 +24,12 @@ declare(strict_types = 1);
namespace OCA\TwoFactorGateway\AppInfo;
use Exception;
-use OCA\TwoFactorGateway\Service\IGateway;
-use OCA\TwoFactorGateway\Service\Gateway\PlaySMSGateway;
-use OCA\TwoFactorGateway\Service\Gateway\SignalGateway;
-use OCA\TwoFactorGateway\Service\Gateway\TelegramGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\SMS\PlaySMSGateway;
+use OCA\TwoFactorGateway\Service\Gateway\Signal\Gateway as SignalGateway;
+use OCA\TwoFactorGateway\Service\Gateway\Telegram\Gateway as TelegramGateway;
use OCA\TwoFactorGateway\Service\Gateway\TestGateway;
-use OCA\TwoFactorGateway\Service\Gateway\WebSmsGateway;
+use OCA\TwoFactorGateway\Service\Gateway\SMS\WebSmsGateway;
use OCP\AppFramework\App;
use OCP\IConfig;
diff --git a/lib/Provider/SmsProvider.php b/lib/Provider/SmsProvider.php
index c4e5abb..73174c6 100644
--- a/lib/Provider/SmsProvider.php
+++ b/lib/Provider/SmsProvider.php
@@ -25,7 +25,7 @@ namespace OCA\TwoFactorGateway\Provider;
use OCA\TwoFactorGateway\Exception\SmsTransmissionException;
use OCA\TwoFactorGateway\PhoneNumberMask;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCA\TwoFactorGateway\Service\StateStorage;
use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\IL10N;
diff --git a/lib/Provider/State.php b/lib/Provider/State.php
index edae62d..58023a4 100644
--- a/lib/Provider/State.php
+++ b/lib/Provider/State.php
@@ -25,7 +25,7 @@
namespace OCA\TwoFactorGateway\Provider;
use JsonSerializable;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\IUser;
class State implements JsonSerializable {
diff --git a/lib/Service/IGateway.php b/lib/Service/Gateway/IGateway.php
index f3b2a22..588c476 100644
--- a/lib/Service/IGateway.php
+++ b/lib/Service/Gateway/IGateway.php
@@ -21,7 +21,7 @@ declare(strict_types=1);
*
*/
-namespace OCA\TwoFactorGateway\Service;
+namespace OCA\TwoFactorGateway\Service\Gateway;
use OCA\TwoFactorGateway\Exception\SmsTransmissionException;
use OCP\IUser;
diff --git a/lib/Service/Gateway/PlaySMSGateway.php b/lib/Service/Gateway/SMS/PlaySMSGateway.php
index c36116d..c38763e 100644
--- a/lib/Service/Gateway/PlaySMSGateway.php
+++ b/lib/Service/Gateway/SMS/PlaySMSGateway.php
@@ -21,11 +21,11 @@ declare(strict_types=1);
*
*/
-namespace OCA\TwoFactorGateway\Service\Gateway;
+namespace OCA\TwoFactorGateway\Service\Gateway\SMS;
use Exception;
use OCA\TwoFactorGateway\Exception\SmsTransmissionException;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
diff --git a/lib/Service/Gateway/WebSmsGateway.php b/lib/Service/Gateway/SMS/WebSmsGateway.php
index 08b8851..a238a1c 100644
--- a/lib/Service/Gateway/WebSmsGateway.php
+++ b/lib/Service/Gateway/SMS/WebSmsGateway.php
@@ -21,11 +21,11 @@ declare(strict_types=1);
*
*/
-namespace OCA\TwoFactorGateway\Service\Gateway;
+namespace OCA\TwoFactorGateway\Service\Gateway\SMS;
use Exception;
use OCA\TwoFactorGateway\Exception\SmsTransmissionException;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
diff --git a/lib/Service/Gateway/SignalGateway.php b/lib/Service/Gateway/Signal/Gateway.php
index 7c543f4..d4c3f48 100644
--- a/lib/Service/Gateway/SignalGateway.php
+++ b/lib/Service/Gateway/Signal/Gateway.php
@@ -22,10 +22,10 @@ declare(strict_types=1);
*
*/
-namespace OCA\TwoFactorGateway\Service\Gateway;
+namespace OCA\TwoFactorGateway\Service\Gateway\Signal;
use OCA\TwoFactorGateway\Exception\SmsTransmissionException;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\Http\Client\IClientService;
use OCP\IL10N;
use OCP\ILogger;
@@ -34,7 +34,7 @@ use OCP\IUser;
/**
* An integration of https://gitlab.com/morph027/signal-web-gateway
*/
-class SignalGateway implements IGateway {
+class Gateway implements IGateway {
/** @var IClientService */
private $clientService;
diff --git a/lib/Service/Gateway/TelegramGateway.php b/lib/Service/Gateway/Telegram/Gateway.php
index c8e04b9..444eaaf 100644
--- a/lib/Service/Gateway/TelegramGateway.php
+++ b/lib/Service/Gateway/Telegram/Gateway.php
@@ -22,11 +22,11 @@ declare(strict_types=1);
*
*/
-namespace OCA\TwoFactorGateway\Service\Gateway;
+namespace OCA\TwoFactorGateway\Service\Gateway\Telegram;
use Exception;
use OCA\TwoFactorGateway\Exception\SmsTransmissionException;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
@@ -35,7 +35,7 @@ use OCP\IUser;
use Telegram\Bot\Api;
use Telegram\Bot\Objects\Update;
-class TelegramGateway implements IGateway {
+class Gateway implements IGateway {
/** @var IClient */
private $client;
diff --git a/lib/Service/Gateway/TestGateway.php b/lib/Service/Gateway/TestGateway.php
index c6bde1d..9cf7bb7 100644
--- a/lib/Service/Gateway/TestGateway.php
+++ b/lib/Service/Gateway/TestGateway.php
@@ -24,7 +24,7 @@
namespace OCA\TwoFactorGateway\Service\Gateway;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\ILogger;
use OCP\IUser;
diff --git a/lib/Service/SetupService.php b/lib/Service/SetupService.php
index 48a3473..15f5945 100644
--- a/lib/Service/SetupService.php
+++ b/lib/Service/SetupService.php
@@ -31,6 +31,7 @@ use OCA\TwoFactorGateway\Exception\VerificationException;
use OCA\TwoFactorGateway\Exception\VerificationTransmissionException;
use OCA\TwoFactorGateway\Provider\SmsProvider;
use OCA\TwoFactorGateway\Provider\State;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\IUser;
use OCP\Security\ISecureRandom;
diff --git a/lib/Service/StateStorage.php b/lib/Service/StateStorage.php
index 4d50bea..e53f637 100644
--- a/lib/Service/StateStorage.php
+++ b/lib/Service/StateStorage.php
@@ -28,6 +28,7 @@ use Exception;
use OCA\TwoFactorGateway\AppInfo\Application;
use OCA\TwoFactorGateway\Provider\SmsProvider;
use OCA\TwoFactorGateway\Provider\State;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCP\IConfig;
use OCP\IUser;
diff --git a/tests/Unit/Provider/SmsProviderTest.php b/tests/Unit/Provider/SmsProviderTest.php
index b93e321..c1637a4 100644
--- a/tests/Unit/Provider/SmsProviderTest.php
+++ b/tests/Unit/Provider/SmsProviderTest.php
@@ -25,7 +25,7 @@ namespace OCA\TwoFactorGateway\Tests\Unit\Provider;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\TwoFactorGateway\Provider\SmsProvider;
use OCA\TwoFactorGateway\Provider\State;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCA\TwoFactorGateway\Service\StateStorage;
use OCP\IL10N;
use OCP\ISession;
diff --git a/tests/Unit/Service/SetupServiceTest.php b/tests/Unit/Service/SetupServiceTest.php
index 91a3da2..b7e5555 100644
--- a/tests/Unit/Service/SetupServiceTest.php
+++ b/tests/Unit/Service/SetupServiceTest.php
@@ -28,7 +28,7 @@ use OCA\TwoFactorGateway\Exception\VerificationException;
use OCA\TwoFactorGateway\Exception\VerificationTransmissionException;
use OCA\TwoFactorGateway\Provider\SmsProvider;
use OCA\TwoFactorGateway\Provider\State;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCA\TwoFactorGateway\Service\SetupService;
use OCA\TwoFactorGateway\Service\StateStorage;
use OCP\Authentication\TwoFactorAuth\IRegistry;
diff --git a/tests/Unit/Service/StateStorageTest.php b/tests/Unit/Service/StateStorageTest.php
index 0416efe..b4359eb 100644
--- a/tests/Unit/Service/StateStorageTest.php
+++ b/tests/Unit/Service/StateStorageTest.php
@@ -25,7 +25,7 @@ namespace OCA\TwoFactorGateway\Tests\Unit\Provider;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\TwoFactorGateway\Provider\SmsProvider;
use OCA\TwoFactorGateway\Provider\State;
-use OCA\TwoFactorGateway\Service\IGateway;
+use OCA\TwoFactorGateway\Service\Gateway\IGateway;
use OCA\TwoFactorGateway\Service\StateStorage;
use OCP\IConfig;
use OCP\IUser;