Completed
Push — master ( 068f24...c0d04f )
by Sergey
02:17
created
src/Sender.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace seregazhuk\SmsIntel;
4 4
 
5
-use seregazhuk\SmsIntel\Adapters\GuzzleHttpAdapter;
6 5
 use seregazhuk\SmsIntel\Contracts\RequestInterface;
7 6
 
8 7
 class Sender
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
      * @param array $params
28 28
      * @return array|null
29 29
      */
30
-    public function send($to, $from, $message, $params = [])
30
+    public function send($to, $from, $message, $params = [ ])
31 31
     {
32
-        $to = is_array($to) ? $to : [$to];
32
+        $to = is_array($to) ? $to : [ $to ];
33 33
 
34 34
         $requestParams = array_merge(
35 35
             [
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function cancel($smsId)
50 50
     {
51
-        return $this->request->exec('cancel', ['smsid' => $smsId]);
51
+        return $this->request->exec('cancel', [ 'smsid' => $smsId ]);
52 52
     }
53 53
 
54 54
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function getReportBySms($smsId)
94 94
     {
95
-        return $this->request->exec('report', ['smsid' => $smsId]);
95
+        return $this->request->exec('report', [ 'smsid' => $smsId ]);
96 96
     }
97 97
 
98 98
     /**
Please login to merge, or discard this patch.
src/Adapters/GuzzleHttpAdapter.php 2 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -8,68 +8,68 @@
 block discarded – undo
8 8
 
9 9
 class GuzzleHttpAdapter implements HttpInterface{
10 10
 
11
-	/**
12
-	 * @var Client
13
-	 */
14
-	protected $client;
11
+    /**
12
+     * @var Client
13
+     */
14
+    protected $client;
15 15
 
16
-	public function __construct()
17
-	{
18
-		$this->client = new Client();
19
-	}
16
+    public function __construct()
17
+    {
18
+        $this->client = new Client();
19
+    }
20 20
 	
21
-	/**
22
-	 * @param $uri
23
-	 * @param array $params
24
-	 * @return array
25
-	 */
26
-	public function get($uri, $params = [])
27
-	{
28
-		if(!empty($params)){
29
-			$uri .= '?'. http_build_query($params);
30
-		}
31
-		$response = $this
32
-			->client
33
-			->get($uri)
34
-			->send();
21
+    /**
22
+     * @param $uri
23
+     * @param array $params
24
+     * @return array
25
+     */
26
+    public function get($uri, $params = [])
27
+    {
28
+        if(!empty($params)){
29
+            $uri .= '?'. http_build_query($params);
30
+        }
31
+        $response = $this
32
+            ->client
33
+            ->get($uri)
34
+            ->send();
35 35
 
36
-		return $this->parseResponse($response);
37
-	}
36
+        return $this->parseResponse($response);
37
+    }
38 38
 
39
-	/**
40
-	 * @param string $uri
41
-	 * @param array $body
42
-	 * @return array
43
-	 */
44
-	public function post($uri, $body)
45
-	{
46
-		$response = $this
47
-			->client
48
-			->post($uri, [], $body)
49
-			->send();
50
-		return $this->parseResponse($response);
51
-	}
39
+    /**
40
+     * @param string $uri
41
+     * @param array $body
42
+     * @return array
43
+     */
44
+    public function post($uri, $body)
45
+    {
46
+        $response = $this
47
+            ->client
48
+            ->post($uri, [], $body)
49
+            ->send();
50
+        return $this->parseResponse($response);
51
+    }
52 52
 
53
-	/**
54
-	 * @param string $url
55
-	 * @return $this
56
-	 */
57
-	public function setBaseUrl($url)
58
-	{
59
-		$this->client->setBaseUrl($url);
53
+    /**
54
+     * @param string $url
55
+     * @return $this
56
+     */
57
+    public function setBaseUrl($url)
58
+    {
59
+        $this->client->setBaseUrl($url);
60 60
 
61
-		return $this;
62
-	}
61
+        return $this;
62
+    }
63 63
 
64
-	/**
64
+    /**
65 65
      * Parses XML from response and returns it as an array
66 66
      *
67
-	 * @param Response $response
68
-	 * @return array
69
-	 */
70
-	protected function parseResponse(Response $response)
71
-	{
72
-		$xml = simplexml_load_string($response->getBody(true));
67
+     * @param Response $response
68
+     * @return array
69
+     */
70
+    protected function parseResponse(Response $response)
71
+    {
72
+        $xml = simplexml_load_string($response->getBody(true));
73 73
         return (array)$xml->children();
74
-	}
74
+    }
75 75
 }
76 76
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Guzzle\Http\Message\Response;
7 7
 use seregazhuk\SmsIntel\Contracts\HttpInterface;
8 8
 
9
-class GuzzleHttpAdapter implements HttpInterface{
9
+class GuzzleHttpAdapter implements HttpInterface {
10 10
 
11 11
 	/**
12 12
 	 * @var Client
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 	 * @param array $params
24 24
 	 * @return array
25 25
 	 */
26
-	public function get($uri, $params = [])
26
+	public function get($uri, $params = [ ])
27 27
 	{
28
-		if(!empty($params)){
29
-			$uri .= '?'. http_build_query($params);
28
+		if (!empty($params)) {
29
+			$uri .= '?' . http_build_query($params);
30 30
 		}
31 31
 		$response = $this
32 32
 			->client
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	{
46 46
 		$response = $this
47 47
 			->client
48
-			->post($uri, [], $body)
48
+			->post($uri, [ ], $body)
49 49
 			->send();
50 50
 		return $this->parseResponse($response);
51 51
 	}
Please login to merge, or discard this patch.
src/XMLFormatter.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
      */
32 32
     public function toXml()
33 33
     {
34
-       return $this->initDom()
35
-           ->createParamsNodes()
36
-           ->getXml();
34
+        return $this->initDom()
35
+            ->createParamsNodes()
36
+            ->getXml();
37 37
     }
38 38
 
39 39
     /**
Please login to merge, or discard this patch.
src/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      * @param array $params
39 39
      * @return array|null
40 40
      */
41
-    public function exec($action, $params = [])
41
+    public function exec($action, $params = [ ])
42 42
     {
43 43
         $endPoint = $this->makeEndPoint($action);
44 44
         $requestBody = $this->createRequestBody($params);
Please login to merge, or discard this patch.
src/Factories/SmsIntel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     protected static function checkCredentials($login, $password)
32 32
     {
33
-        if(empty($login) || empty($password)) {
33
+        if (empty($login) || empty($password)) {
34 34
             throw new AuthException('You must provide login and password to send messages!');
35 35
         }
36 36
     }
Please login to merge, or discard this patch.
src/Contracts/HttpInterface.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,23 +4,23 @@
 block discarded – undo
4 4
 
5 5
 interface HttpInterface {
6 6
 
7
-	/**
8
-	 * @param $uri
9
-	 * @param array $params
10
-	 * @return array
11
-	 */
12
-	public function get($uri, $params = []);
7
+    /**
8
+     * @param $uri
9
+     * @param array $params
10
+     * @return array
11
+     */
12
+    public function get($uri, $params = []);
13 13
 
14
-	/**
15
-	 * @param $uri
16
-	 * @param $body
17
-	 * @return array
18
-	 */
19
-	public function post($uri, $body);
14
+    /**
15
+     * @param $uri
16
+     * @param $body
17
+     * @return array
18
+     */
19
+    public function post($uri, $body);
20 20
 
21
-	/**
22
-	 * @param string $url
23
-	 * @return $this
24
-	 */
25
-	public function setBaseUrl($url);
21
+    /**
22
+     * @param string $url
23
+     * @return $this
24
+     */
25
+    public function setBaseUrl($url);
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 	 * @param array $params
10 10
 	 * @return array
11 11
 	 */
12
-	public function get($uri, $params = []);
12
+	public function get($uri, $params = [ ]);
13 13
 
14 14
 	/**
15 15
 	 * @param $uri
Please login to merge, or discard this patch.
src/Contracts/RequestInterface.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 interface RequestInterface {
6 6
 
7
-	/**
8
-	 * Send the request to API
9
-	 * @param $uri
10
-	 * @param $params
11
-	 */
12
-	public function exec($uri, $params);
7
+    /**
8
+     * Send the request to API
9
+     * @param $uri
10
+     * @param $params
11
+     */
12
+    public function exec($uri, $params);
13 13
 }
14 14
\ No newline at end of file
Please login to merge, or discard this patch.