Passed
Branch master (8e9907)
by Ridvan Lakas ng Bayan
03:37 queued 01:24
created
src/ridvanbaluyos/sms/Sms.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
      *
87 87
      * @param $code - the response code
88 88
      * @param null $message - an optional message aside from the default ones
89
-     * @param null $provider - the SMS provider used. Should only be enabled during debug mode.
89
+     * @param string $provider - the SMS provider used. Should only be enabled during debug mode.
90 90
      */
91 91
     protected function response($code, $message = null, $provider)
92 92
     {
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      * @var SmsProviderServicesInterface
18 18
      */
19
-	private $smsProvider;
19
+    private $smsProvider;
20 20
 
21 21
     /**
22 22
      * Sms constructor.
23 23
      * @param SmsProviderServicesInterface|null $smsProvider
24 24
      */
25
-	public function __construct(SmsProviderServicesInterface $smsProvider = null)
26
-	{
27
-	    // If no provider is specified, randomize by distribution percentage.
28
-	    if (is_null($smsProvider)) {
25
+    public function __construct(SmsProviderServicesInterface $smsProvider = null)
26
+    {
27
+        // If no provider is specified, randomize by distribution percentage.
28
+        if (is_null($smsProvider)) {
29 29
             $provider = 'ridvanbaluyos\\sms\\providers\\' . $this->randomizeProvider();
30 30
             $this->smsProvider = new $provider();
31 31
         } else {
32 32
             $this->smsProvider = $smsProvider;
33 33
         }
34 34
 
35
-	}
35
+    }
36 36
 
37 37
     /**
38 38
      * This function sends the SMS.
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
      * @param $phoneNumber - the mobile number
41 41
      * @param $message - the message
42 42
      */
43
-	public function send($phoneNumber, $message)
44
-	{
45
-	    $phoneNumber = $this->prepareNumber($phoneNumber);
46
-		$this->smsProvider->send($phoneNumber, $message . ' via ' . $this->smsProvider->className);
47
-	}
43
+    public function send($phoneNumber, $message)
44
+    {
45
+        $phoneNumber = $this->prepareNumber($phoneNumber);
46
+        $this->smsProvider->send($phoneNumber, $message . ' via ' . $this->smsProvider->className);
47
+    }
48 48
 
49 49
     /**
50 50
      * This function randomizes the SMS providers. Make sure that the total
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      *
54 54
      * @return string $result - the lucky SMS provider
55 55
      */
56
-	private function randomizeProvider()
56
+    private function randomizeProvider()
57 57
     {
58 58
         $providers = Config::load(__DIR__ . '/config/distribution.json');
59 59
 
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 namespace ridvanbaluyos\sms;
3 3
 
4 4
 use ridvanbaluyos\sms\providers\PromoTexter;
5
-use ridvanbaluyos\sms\providers\RisingTide;
6
-use ridvanbaluyos\sms\providers\Semaphore;
7
-use ridvanbaluyos\sms\providers\Chikka;
8 5
 use Noodlehaus\Config as Config;
9 6
 
10 7
 /**
Please login to merge, or discard this patch.
src/ridvanbaluyos/sms/SmsProviderServicesInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,5 +7,5 @@
 block discarded – undo
7 7
  */
8 8
 interface SmsProviderServicesInterface
9 9
 {
10
-	public function send($phoneNumber, $message);
10
+    public function send($phoneNumber, $message);
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
src/ridvanbaluyos/sms/providers/PromoTexter.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
      * @param $phoneNumber
31 31
      * @param $message
32 32
      */
33
-	public function send($phoneNumber, $message)
34
-	{
35
-	    try {
33
+    public function send($phoneNumber, $message)
34
+    {
35
+        try {
36 36
             $conf = Config::load(__DIR__ . '/../config/providers.json')[$this->className];
37 37
             $query = [
38 38
                 'senderid' => $conf['senderid'],
@@ -59,5 +59,5 @@  discard block
 block discarded – undo
59 59
         } catch (Exception $e) {
60 60
 
61 61
         }
62
-	}
62
+    }
63 63
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             $query = [
38 38
                 'senderid' => $conf['senderid'],
39 39
                 'clientid' => $conf['clientid'],
40
-                'passkey' => $conf['passkey'] ,
40
+                'passkey' => $conf['passkey'],
41 41
                 'msisdn' => $phoneNumber,
42 42
                 'message' => base64_encode($message),
43 43
                 'dlr-call' => $conf['dlr-call'],
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             $url = $conf['url'] . '?' . http_build_query($query);
48 48
 
49 49
             $ch = curl_init();
50
-            curl_setopt($ch,CURLOPT_URL,$url);
50
+            curl_setopt($ch, CURLOPT_URL, $url);
51 51
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
52 52
             curl_setopt($ch, CURLOPT_TIMEOUT, 240);
53 53
             $result = curl_exec($ch);
Please login to merge, or discard this patch.
src/ridvanbaluyos/sms/providers/Semaphore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             $url = $conf['url'] . '?' . http_build_query($query);
45 45
 
46 46
             $ch = curl_init();
47
-            curl_setopt($ch,CURLOPT_URL,$url);
47
+            curl_setopt($ch, CURLOPT_URL, $url);
48 48
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
49 49
             curl_setopt($ch, CURLOPT_TIMEOUT, 240);
50 50
             $result = curl_exec($ch);
Please login to merge, or discard this patch.
src/ridvanbaluyos/sms/providers/RisingTide.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
      * @param $phoneNumber
33 33
      * @param $message
34 34
      */
35
-	public function send($phoneNumber, $message)
36
-	{
35
+    public function send($phoneNumber, $message)
36
+    {
37 37
         try {
38 38
             $conf = Config::load(__DIR__ . '/../config/providers.json')[$this->className];
39 39
 
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
         } catch (Exception $e) {
77 77
 
78 78
         }
79
-	}
79
+    }
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.