Completed
Push — master ( 241032...67be65 )
by Sergey
02:51
created
src/Contracts/HttpInterface.php 1 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/Requests/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public static function getAllowedMethods()
36 36
     {
37
-        return [];
37
+        return [ ];
38 38
     }
39 39
 
40 40
     /**
Please login to merge, or discard this patch.
src/Requests/RequestsContainer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * @var RequestInterface[]
43 43
      */
44
-    protected $requests = [];
44
+    protected $requests = [ ];
45 45
 
46 46
     /**
47 47
      * Gets request object by name. If there is no such request
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $requestClass = strtolower($requestClass);
60 60
         // Check if an instance has already been initiated
61
-        if (!isset($this->requests[$requestClass])) {
61
+        if (!isset($this->requests[ $requestClass ])) {
62 62
             $this->addRequest($requestClass);
63 63
         }
64
-        return $this->requests[$requestClass];
64
+        return $this->requests[ $requestClass ];
65 65
     }
66 66
 
67 67
     /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function resolveRequestByAction($action)
73 73
     {
74 74
         foreach ($this->getRequestsActionsMap() as $requestClass => $actions) {
75
-            if(in_array($action, $actions)) {
75
+            if (in_array($action, $actions)) {
76 76
                 return $this->getRequest($requestClass);
77 77
             }
78 78
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         if (!class_exists($requestClass)) {
94 94
             throw new WrongRequestException("Request $requestClass not found.");
95 95
         }
96
-        $this->requests[$requestClass] = $this->buildRequest($requestClass);
96
+        $this->requests[ $requestClass ] = $this->buildRequest($requestClass);
97 97
     }
98 98
 
99 99
     /**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     protected function buildRequest($className)
108 108
     {
109 109
         return (new ReflectionClass($className))
110
-            ->newInstanceArgs([$this->http])
110
+            ->newInstanceArgs([ $this->http ])
111 111
             ->setCredentials($this->login, $this->password);
112 112
     }
113 113
 }
114 114
\ No newline at end of file
Please login to merge, or discard this patch.
src/Adapters/GuzzleHttpAdapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      * @param array $params
25 25
      * @return string
26 26
      */
27
-    public function get($uri, $params = [])
27
+    public function get($uri, $params = [ ])
28 28
     {
29 29
         if (!empty($params)) {
30 30
             $uri .= '?' . http_build_query($params);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function post($uri, $body)
41 41
     {
42
-        return $this->client->post($uri, [], $body)->send()->getBody(true);
42
+        return $this->client->post($uri, [ ], $body)->send()->getBody(true);
43 43
     }
44 44
 
45 45
     /**
Please login to merge, or discard this patch.
src/Sender.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,19 +44,19 @@
 block discarded – undo
44 44
      */
45 45
     protected function callRequestMethod(RequestInterface $request, $method, array $arguments)
46 46
     {
47
-        if(empty($arguments)) return $request->{$method}();
47
+        if (empty($arguments)) return $request->{$method}();
48 48
 
49 49
         switch (count($arguments)) {
50 50
             case 1:
51
-                return $request->{$method}($arguments[0]);
51
+                return $request->{$method}($arguments[ 0 ]);
52 52
             case 2:
53
-                return $request->{$method}($arguments[0], $arguments[1]);
53
+                return $request->{$method}($arguments[ 0 ], $arguments[ 1 ]);
54 54
             case 3:
55
-                return $request->{$method}($arguments[0], $arguments[1], $arguments[2]);
55
+                return $request->{$method}($arguments[ 0 ], $arguments[ 1 ], $arguments[ 2 ]);
56 56
             case 4:
57
-                return $request->{$method}($arguments[0], $arguments[1], $arguments[2], $arguments[3]);
57
+                return $request->{$method}($arguments[ 0 ], $arguments[ 1 ], $arguments[ 2 ], $arguments[ 3 ]);
58 58
             case 5:
59
-                return $request->{$method}($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4]);
59
+                return $request->{$method}($arguments[ 0 ], $arguments[ 1 ], $arguments[ 2 ], $arguments[ 3 ], $arguments[ 4 ]);
60 60
             default:
61 61
                 return $request->{$method}($arguments);
62 62
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,9 @@
 block discarded – undo
44 44
      */
45 45
     protected function callRequestMethod(RequestInterface $request, $method, array $arguments)
46 46
     {
47
-        if(empty($arguments)) return $request->{$method}();
47
+        if(empty($arguments)) {
48
+            return $request->{$method}();
49
+        }
48 50
 
49 51
         switch (count($arguments)) {
50 52
             case 1:
Please login to merge, or discard this patch.
src/Requests/JSONRequest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function requestSource($name)
53 53
     {
54
-        return $this->exec('requestSource', ['source' => $name]);
54
+        return $this->exec('requestSource', [ 'source' => $name ]);
55 55
     }
56 56
 
57 57
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         return $this->exec(
65 65
             'getContacts',
66
-            ['idGroup' => $groupId, 'phone' => $phone]
66
+            [ 'idGroup' => $groupId, 'phone' => $phone ]
67 67
         );
68 68
     }
69 69
     
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function getPhoneInfo($phone)
75 75
     {
76
-        return $this->exec('getPhoneInfo', ['phone' => $phone]);
76
+        return $this->exec('getPhoneInfo', [ 'phone' => $phone ]);
77 77
     }
78 78
 
79 79
     /**
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
      * @param string|null $groupName
91 91
      * @return array|null
92 92
      */
93
-    public function getGroups($groupId = null,  $groupName = null)
93
+    public function getGroups($groupId = null, $groupName = null)
94 94
     {
95 95
         return $this->exec(
96 96
             'getGroups',
97
-            ['id' => $groupId, 'name' => $groupName]
97
+            [ 'id' => $groupId, 'name' => $groupName ]
98 98
         );
99 99
     }
100 100
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function editGroup($name, $id)
116 116
     {
117
-        return $this->exec('saveGroup', ['id' => $id, 'name' => $name]);
117
+        return $this->exec('saveGroup', [ 'id' => $id, 'name' => $name ]);
118 118
     }
119 119
 
120 120
     /**
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function removeContact($phone, $groupId = null)
134 134
     {
135
-        return $this->exec('removeContact', ['phone' => $phone, 'groupId' => $groupId]);
135
+        return $this->exec('removeContact', [ 'phone' => $phone, 'groupId' => $groupId ]);
136 136
     }
137 137
 
138 138
     /**
Please login to merge, or discard this patch.
src/Requests/XMLRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
      * @param null|string $number
79 79
      * @return array|null
80 80
      */
81
-    public function getReportByNumber($dateFrom , $dateTo, $number = null)
81
+    public function getReportByNumber($dateFrom, $dateTo, $number = null)
82 82
     {
83 83
         return $this->exec('reportNumber',
84 84
             [
Please login to merge, or discard this patch.