Passed
Push — master ( b09173...5bfe47 )
by Dmitry
01:40
created
src/Provider31/Request/General.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         /**
45 45
          *      @var array list of possible operations
46 46
          */
47
-        protected $operations = array('Check','Payment','Confirm','Cancel');
47
+        protected $operations = array('Check', 'Payment', 'Confirm', 'Cancel');
48 48
 
49 49
         /**
50 50
          *      General constructor
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $doc = new \DOMDocument();
115 115
                 if ( ! $doc->loadXML($this->raw_request))
116 116
                 {
117
-                        foreach(libxml_get_errors() as $e){
117
+                        foreach (libxml_get_errors() as $e) {
118 118
                                 Log::instance()->error($e->message);
119 119
                         }
120 120
                         throw new Exception\Structure('The wrong XML is received', -51);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
          */
227 227
         public function verify_sign($options)
228 228
         {
229
-                if (!isset($options['UseSign']) || ($options['UseSign'] === false))
229
+                if ( ! isset($options['UseSign']) || ($options['UseSign'] === false))
230 230
                 {
231 231
                         return null;
232 232
                 }
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
          *
281 281
          *      @return array nodes with the name
282 282
          */
283
-        protected function getNodes($dom, $name, $ret=array())
283
+        protected function getNodes($dom, $name, $ret = array())
284 284
         {
285
-                foreach($dom->childNodes as $child)
285
+                foreach ($dom->childNodes as $child)
286 286
                 {
287 287
                         if ($child->nodeName == $name)
288 288
                         {
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -133,18 +133,15 @@  discard block
 block discarded – undo
133 133
                         if ($child->nodeName == 'DateTime')
134 134
                         {
135 135
                                 $this->parse_request_node($child, 'DateTime');
136
-                        }
137
-                        elseif ($child->nodeName == 'Sign')
136
+                        } elseif ($child->nodeName == 'Sign')
138 137
                         {
139 138
                                 $this->parse_request_node($child, 'Sign');
140
-                        }
141
-                        elseif (in_array($child->nodeName, $this->operations))
139
+                        } elseif (in_array($child->nodeName, $this->operations))
142 140
                         {
143 141
                                 if ( ! isset($this->Operation))
144 142
                                 {
145 143
                                         $this->Operation = $child->nodeName;
146
-                                }
147
-                                else
144
+                                } else
148 145
                                 {
149 146
                                         throw new Exception\Structure('There is more than one Operation type element in the xml-query!', -53);
150 147
                                 }
@@ -181,8 +178,7 @@  discard block
 block discarded – undo
181 178
                 if ( ! isset($this->$name))
182 179
                 {
183 180
                         $this->$name = $n->nodeValue;
184
-                }
185
-                else
181
+                } else
186 182
                 {
187 183
                         throw new Exception\Structure('There is more than one '.$name.' element in the xml-query!', -56);
188 184
                 }
@@ -264,8 +260,7 @@  discard block
 block discarded – undo
264 260
                 if ($check == -1)
265 261
                 {
266 262
                         throw new Exception\Sign('Error verify signature of request!', -96);
267
-                }
268
-                elseif ($check == 0)
263
+                } elseif ($check == 0)
269 264
                 {
270 265
                         throw new Exception\Sign('Signature of request is incorrect!', -95);
271 266
                 }
@@ -287,8 +282,7 @@  discard block
 block discarded – undo
287 282
                         if ($child->nodeName == $name)
288 283
                         {
289 284
                                 array_push($ret, $child);
290
-                        }
291
-                        else
285
+                        } else
292 286
                         {
293 287
                                 if (count($child->childNodes) > 0)
294 288
                                 {
Please login to merge, or discard this patch.