Completed
Push — master ( 83472f...6fbcb0 )
by Adelar
02:23
created
tests/OfxParseTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function itau()
31 31
     {
32
-        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_itau.ofx');
32
+        $ofx = OfxParser::loadOfx(__DIR__.'/fixtures/extrato_itau.ofx');
33 33
         $this->assertInstanceOf(Ofx::class, $ofx);
34 34
         $this->assertInternalType('array', $ofx->jsonSerialize());
35 35
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function santander()
43 43
     {
44
-        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_santander.ofx');
44
+        $ofx = OfxParser::loadOfx(__DIR__.'/fixtures/extrato_santander.ofx');
45 45
         $this->assertInstanceOf(Ofx::class, $ofx);
46 46
         $this->assertInternalType('array', $ofx->jsonSerialize());
47 47
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function caixa()
55 55
     {
56
-        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_caixa.ofx');
56
+        $ofx = OfxParser::loadOfx(__DIR__.'/fixtures/extrato_caixa.ofx');
57 57
         $this->assertInstanceOf(Ofx::class, $ofx);
58 58
         $this->assertInternalType('array', $ofx->jsonSerialize());
59 59
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function faturaCC()
67 67
     {
68
-        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/fatura_cc_1.ofx');
68
+        $ofx = OfxParser::loadOfx(__DIR__.'/fixtures/fatura_cc_1.ofx');
69 69
         $this->assertInstanceOf(Ofx::class, $ofx);
70 70
         $this->assertInternalType('array', $ofx->jsonSerialize());
71 71
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function itauIso()
79 79
     {
80
-        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_itau_iso.ofx');
80
+        $ofx = OfxParser::loadOfx(__DIR__.'/fixtures/extrato_itau_iso.ofx');
81 81
         $this->assertInstanceOf(Ofx::class, $ofx);
82 82
         $this->assertInternalType('array', $ofx->jsonSerialize());
83 83
 
Please login to merge, or discard this patch.
src/AbstractParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace Adelarcubs\OFXParser;
4 4
 
5 5
 use SimpleXMLElement;
Please login to merge, or discard this patch.
src/OfxMovement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace Adelarcubs\OFXParser;
4 4
 
5 5
 use DateTime;
Please login to merge, or discard this patch.
src/OfxParser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace Adelarcubs\OFXParser;
4 4
 
5 5
 use Adelarcubs\OFXParser\Parser\BaseParser;
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         if (file_exists($ofx)) {
23 23
             $ofx = file_get_contents($ofx);
24 24
         }
25
-        if (! $parser) {
25
+        if (!$parser) {
26 26
             $parser = new BaseParser();
27 27
         }
28 28
         return OfxParser::loadFromString($ofx, $parser);
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
         libxml_use_internal_errors(true);
37 37
         $xml = simplexml_load_string($xml);
38 38
         $errors = libxml_get_errors();
39
-        if (! empty($errors)) {
40
-            throw new \Exception('Failed to parse OFX: ' . var_export($errors, true));
39
+        if (!empty($errors)) {
40
+            throw new \Exception('Failed to parse OFX: '.var_export($errors, true));
41 41
         }
42 42
         return new Ofx($xml, $parser);
43 43
     }
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
                 $pos = strpos($read, '>');
55 55
                 $tag = substr($read, 1, $pos);
56 56
                 $value = trim(substr($read, $pos + 1));
57
-                $line = '<' . $tag;
57
+                $line = '<'.$tag;
58 58
                 if ($value != '') {
59 59
                     $line .= $value;
60
-                    if (strpos($value, '</' . $tag) === false) {
61
-                        $lastClosedTag = '/' . $tag;
62
-                        $line .= '<' . $lastClosedTag;
60
+                    if (strpos($value, '</'.$tag) === false) {
61
+                        $lastClosedTag = '/'.$tag;
62
+                        $line .= '<'.$lastClosedTag;
63 63
                     }
64 64
                 } else {
65 65
                     if ($lastClosedTag == $tag) {
66 66
                         $line = '';
67 67
                     }
68 68
                 }
69
-                $xml .= $line . "\n";
69
+                $xml .= $line."\n";
70 70
             }
71 71
         }
72 72
         return $xml;
Please login to merge, or discard this patch.
src/Parser/BaseParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace Adelarcubs\OFXParser\Parser;
4 4
 
5 5
 use Adelarcubs\OFXParser\AbstractParser;
Please login to merge, or discard this patch.
src/Ofx.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace Adelarcubs\OFXParser;
4 4
 
5 5
 use JsonSerializable;
Please login to merge, or discard this patch.