Completed
Push — master ( b0d047...e9f17a )
by Adelar
03:30
created
src/OfxParser.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
         libxml_use_internal_errors(true);
32 32
         $xml = simplexml_load_string($xml);
33 33
         $errors = libxml_get_errors();
34
-        if (! empty($errors)) {
35
-            throw new \Exception("Failed to parse OFX: " . var_export($errors, true));
34
+        if (!empty($errors)) {
35
+            throw new \Exception("Failed to parse OFX: ".var_export($errors, true));
36 36
         }
37 37
         $this->ofx = new Ofx($xml);
38 38
         return $this->ofx;
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
                 $pos = strpos($read, ">");
51 51
                 $tag = substr($read, 1, $pos);
52 52
                 $value = trim(substr($read, $pos + 1));
53
-                $line = '<' . $tag;
53
+                $line = '<'.$tag;
54 54
                 if ($value != '') {
55 55
                     $line .= $value;
56
-                    if (strpos($value, '</' . $tag) === false) {
57
-                        $lastClosedTag = '/' . $tag;
58
-                        $line .= '<' . $lastClosedTag;
56
+                    if (strpos($value, '</'.$tag) === false) {
57
+                        $lastClosedTag = '/'.$tag;
58
+                        $line .= '<'.$lastClosedTag;
59 59
                     }
60 60
                 } else {
61 61
                     if ($lastClosedTag == $tag) {
62 62
                         $line = '';
63 63
                     }
64 64
                 }
65
-                $xml .= $line . "\n";
65
+                $xml .= $line."\n";
66 66
             }
67 67
         }
68 68
         return $xml;
Please login to merge, or discard this patch.
tests/OfxParseTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,16 +39,16 @@
 block discarded – undo
39 39
     {
40 40
         return [
41 41
             [
42
-                __DIR__ . '/fixtures/data.ofx'
42
+                __DIR__.'/fixtures/data.ofx'
43 43
             ],
44 44
             [
45
-                __DIR__ . '/fixtures/data2.ofx'
45
+                __DIR__.'/fixtures/data2.ofx'
46 46
             ],
47 47
             [
48
-                __DIR__ . '/fixtures/caixa_julho.ofx'
48
+                __DIR__.'/fixtures/caixa_julho.ofx'
49 49
             ],
50 50
             [
51
-                __DIR__ . '/fixtures/extrato_itau_maio.ofx'
51
+                __DIR__.'/fixtures/extrato_itau_maio.ofx'
52 52
             ]
53 53
         ];
54 54
     }
Please login to merge, or discard this patch.
src/OfxMovement.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,6 +17,6 @@
 block discarded – undo
17 17
     }
18 18
 
19 19
     public function getDescription(){
20
-    	return $this->description;
20
+        return $this->description;
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $this->description = $xml->MEMO;
17 17
     }
18 18
 
19
-    public function getDescription(){
19
+    public function getDescription() {
20 20
     	return $this->description;
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
src/Ofx.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@
 block discarded – undo
21 21
     }
22 22
 
23 23
     public function getMovements(){
24
-    	return $this->movements;
24
+        return $this->movements;
25 25
     }
26 26
 
27 27
     private function exportMovements(SimpleXMLElement $xml){
28
-    	foreach ($xml as $value) {
29
-    		$this->movements[] = new OfxMovement($value);
30
-    	}
28
+        foreach ($xml as $value) {
29
+            $this->movements[] = new OfxMovement($value);
30
+        }
31 31
     }
32 32
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
         $this->exportMovements($xml->BANKMSGSRSV1->STMTTRNRS->STMTRS->BANKTRANLIST->STMTTRN);
21 21
     }
22 22
 
23
-    public function getMovements(){
23
+    public function getMovements() {
24 24
     	return $this->movements;
25 25
     }
26 26
 
27
-    private function exportMovements(SimpleXMLElement $xml){
27
+    private function exportMovements(SimpleXMLElement $xml) {
28 28
     	foreach ($xml as $value) {
29 29
     		$this->movements[] = new OfxMovement($value);
30 30
     	}
Please login to merge, or discard this patch.