Completed
Push — master ( e6fe6f...a29d2d )
by Hannes
09:33
created
spec/Exception/ParserExceptionSpec.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 
7 7
 use byrokrat\autogiro\Exception\ParserException;
8 8
 use PhpSpec\ObjectBehavior;
9
-use Prophecy\Argument;
10 9
 
11 10
 class ParserExceptionSpec extends ObjectBehavior
12 11
 {
Please login to merge, or discard this patch.
spec/ParserSpec.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use byrokrat\autogiro\Tree\Node;
11 11
 use byrokrat\autogiro\Exception\ParserException;
12 12
 use PhpSpec\ObjectBehavior;
13
-use Prophecy\Argument;
14 13
 
15 14
 class ParserSpec extends ObjectBehavior
16 15
 {
Please login to merge, or discard this patch.
spec/Processor/BankgiroProcessorSpec.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,7 @@  discard block
 block discarded – undo
5 5
 namespace spec\byrokrat\autogiro\Processor;
6 6
 
7 7
 use byrokrat\autogiro\Processor\BankgiroProcessor;
8
-use byrokrat\autogiro\Exception;
9 8
 use byrokrat\autogiro\Tree\OpeningNode;
10
-use byrokrat\autogiro\Tree\ClosingNode;
11 9
 use byrokrat\autogiro\Tree\RequestMandateCreationNode;
12 10
 use byrokrat\autogiro\Tree\RequestMandateAcceptanceNode;
13 11
 use byrokrat\autogiro\Tree\RequestMandateRejectionNode;
@@ -16,7 +14,6 @@  discard block
 block discarded – undo
16 14
 use byrokrat\autogiro\Tree\MandateResponseNode;
17 15
 use byrokrat\autogiro\Tree\BankgiroNode;
18 16
 use PhpSpec\ObjectBehavior;
19
-use Prophecy\Argument;
20 17
 
21 18
 class BankgiroProcessorSpec extends ObjectBehavior
22 19
 {
Please login to merge, or discard this patch.
spec/Processor/FileProcessorSpec.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use byrokrat\autogiro\Tree\OpeningNode;
11 11
 use byrokrat\autogiro\Tree\BankgiroNode;
12 12
 use PhpSpec\ObjectBehavior;
13
-use Prophecy\Argument;
14 13
 
15 14
 class FileProcessorSpec extends ObjectBehavior
16 15
 {
Please login to merge, or discard this patch.
spec/Tree/MandateResponseNodeSpec.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 use byrokrat\autogiro\Tree\IdNode;
13 13
 use byrokrat\autogiro\Tree\MessageNode;
14 14
 use PhpSpec\ObjectBehavior;
15
-use Prophecy\Argument;
16 15
 
17 16
 class MandateResponseNodeSpec extends ObjectBehavior
18 17
 {
Please login to merge, or discard this patch.
src/Grammar.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -3022,6 +3022,9 @@  discard block
 block discarded – undo
3022 3022
         return '"' . substr($this->string, $this->position) . '"';
3023 3023
     }
3024 3024
 
3025
+    /**
3026
+     * @param string $expecting
3027
+     */
3025 3028
     protected function report($position, $expecting)
3026 3029
     {
3027 3030
         if ($this->cut) {
@@ -3044,6 +3047,9 @@  discard block
 block discarded – undo
3044 3047
         return implode(', ', end($this->warnings));
3045 3048
     }
3046 3049
 
3050
+    /**
3051
+     * @param string $_string
3052
+     */
3047 3053
     public function parse($_string)
3048 3054
     {
3049 3055
         $this->string = $_string;
Please login to merge, or discard this patch.
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -11,14 +11,9 @@
 block discarded – undo
11 11
 use byrokrat\autogiro\Tree\RequestMandateRejectionNode;
12 12
 use byrokrat\autogiro\Tree\RequestMandateUpdateNode;
13 13
 use byrokrat\autogiro\Tree\RequestMandateDeletionNode;
14
-use byrokrat\autogiro\Tree\RequestIncomingTransactionNode;
15
-use byrokrat\autogiro\Tree\RequestOutgoingTransactionNode;
16
-use byrokrat\autogiro\Tree\RequestTransactionDeletionNode;
17
-use byrokrat\autogiro\Tree\RequestTransactionUpdateNode;
18 14
 use byrokrat\autogiro\Tree\MandateResponseNode;
19 15
 use byrokrat\autogiro\Tree\PersonalIdNode;
20 16
 use byrokrat\autogiro\Tree\OrganizationIdNode;
21
-use byrokrat\autogiro\Tree\AmountNode;
22 17
 use byrokrat\autogiro\Tree\AccountNode;
23 18
 use byrokrat\autogiro\Tree\BankgiroNode;
24 19
 use byrokrat\autogiro\Tree\MessageNode;
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         }
80 80
 
81 81
         if ($_success) {
82
-            $this->value = call_user_func(function () use (&$layout) {
82
+            $this->value = call_user_func(function() use (&$layout) {
83 83
                 return $layout;
84 84
             });
85 85
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         }
121 121
 
122 122
         if ($_success) {
123
-            $this->value = call_user_func(function () {
123
+            $this->value = call_user_func(function() {
124 124
                 $this->currentLineNr = 0;
125 125
             });
126 126
         }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         }
278 278
 
279 279
         if ($_success) {
280
-            $this->value = call_user_func(function () use (&$date, &$layout, &$custNr, &$bg) {
280
+            $this->value = call_user_func(function() use (&$date, &$layout, &$custNr, &$bg) {
281 281
                 return new OpeningNode(rtrim($layout), $date, $custNr, $bg, $this->currentLineNr);
282 282
             });
283 283
         }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
         }
377 377
 
378 378
         if ($_success) {
379
-            $this->value = call_user_func(function () use (&$layouts) {
379
+            $this->value = call_user_func(function() use (&$layouts) {
380 380
                 return new FileNode(...$layouts);
381 381
             });
382 382
         }
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
         }
512 512
 
513 513
         if ($_success) {
514
-            $this->value = call_user_func(function () use (&$date, &$custNr, &$bg) {
514
+            $this->value = call_user_func(function() use (&$date, &$custNr, &$bg) {
515 515
                 // TODO layout_request kan vara ''
516 516
                     // kanske lägga in ett test i visitor som kontrollerar att layoutId är ett känt värde... ??
517 517
                 return new OpeningNode('', $date, $custNr, $bg, $this->currentLineNr);
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         }
643 643
 
644 644
         if ($_success) {
645
-            $this->value = call_user_func(function () use (&$opening, &$records) {
645
+            $this->value = call_user_func(function() use (&$opening, &$records) {
646 646
                 $opening->setAttribute('layout_name', Layouts::LAYOUT_MANDATE_REQUEST);
647 647
 
648 648
                 return new LayoutNode(
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
         }
782 782
 
783 783
         if ($_success) {
784
-            $this->value = call_user_func(function () use (&$bg, &$payerNr, &$account, &$id) {
784
+            $this->value = call_user_func(function() use (&$bg, &$payerNr, &$account, &$id) {
785 785
                 return new RequestMandateCreationNode($bg, $payerNr, $account, $id, $this->currentLineNr);
786 786
             });
787 787
         }
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
         }
925 925
 
926 926
         if ($_success) {
927
-            $this->value = call_user_func(function () use (&$bg, &$payerNr, &$reject) {
927
+            $this->value = call_user_func(function() use (&$bg, &$payerNr, &$reject) {
928 928
                 return $reject == 'AV'
929 929
                     ? new RequestMandateRejectionNode($bg, $payerNr, $this->currentLineNr)
930 930
                     : new RequestMandateAcceptanceNode($bg, $payerNr, $this->currentLineNr);
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
         }
1022 1022
 
1023 1023
         if ($_success) {
1024
-            $this->value = call_user_func(function () use (&$oldBg, &$oldPayerNr, &$newBg, &$newPayerNr) {
1024
+            $this->value = call_user_func(function() use (&$oldBg, &$oldPayerNr, &$newBg, &$newPayerNr) {
1025 1025
                 return new RequestMandateUpdateNode($oldBg, $oldPayerNr, $newBg, $newPayerNr, $this->currentLineNr);
1026 1026
             });
1027 1027
         }
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
         }
1097 1097
 
1098 1098
         if ($_success) {
1099
-            $this->value = call_user_func(function () use (&$bg, &$payerNr) {
1099
+            $this->value = call_user_func(function() use (&$bg, &$payerNr) {
1100 1100
                 return new RequestMandateDeletionNode($bg, $payerNr, $this->currentLineNr);
1101 1101
             });
1102 1102
         }
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
         }
1194 1194
 
1195 1195
         if ($_success) {
1196
-            $this->value = call_user_func(function () use (&$opening, &$records) {
1196
+            $this->value = call_user_func(function() use (&$opening, &$records) {
1197 1197
                 $opening->setAttribute('layout_name', Layouts::LAYOUT_PAYMENT_REQUEST);
1198 1198
 
1199 1199
                 return new LayoutNode(
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
         }
1297 1297
 
1298 1298
         if ($_success) {
1299
-            $this->value = call_user_func(function () use (&$opening, &$records) {
1299
+            $this->value = call_user_func(function() use (&$opening, &$records) {
1300 1300
                 $opening->setAttribute('layout_name', Layouts::LAYOUT_AMENDMENT_REQUEST);
1301 1301
 
1302 1302
                 return new LayoutNode(
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
         }
1402 1402
 
1403 1403
         if ($_success) {
1404
-            $this->value = call_user_func(function () use (&$opening, &$mandates, &$closing) {
1404
+            $this->value = call_user_func(function() use (&$opening, &$mandates, &$closing) {
1405 1405
                 return new FileNode(new LayoutNode($opening, $closing, ...$mandates));
1406 1406
             });
1407 1407
         }
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
         }
1497 1497
 
1498 1498
         if ($_success) {
1499
-            $this->value = call_user_func(function () use (&$date, &$bg) {
1499
+            $this->value = call_user_func(function() use (&$date, &$bg) {
1500 1500
                 return new OpeningNode('AG-MEDAVI', $date, '', $bg, $this->currentLineNr);
1501 1501
             });
1502 1502
         }
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
         }
1706 1706
 
1707 1707
         if ($_success) {
1708
-            $this->value = call_user_func(function () use (&$bg, &$payerNr, &$accountNr, &$id, &$info, &$comment, &$date) {
1708
+            $this->value = call_user_func(function() use (&$bg, &$payerNr, &$accountNr, &$id, &$info, &$comment, &$date) {
1709 1709
                 // TODO fundera om jag kan dela upp denna i flera R_ så att jag kan använda ACCOUNT ...
1710 1710
                 $accountNr = trim(ltrim($accountNr, '0'));
1711 1711
 
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
         }
1825 1825
 
1826 1826
         if ($_success) {
1827
-            $this->value = call_user_func(function () use (&$date, &$nrOfPosts) {
1827
+            $this->value = call_user_func(function() use (&$date, &$nrOfPosts) {
1828 1828
                 return new ClosingNode($date, intval($nrOfPosts), $this->currentLineNr);
1829 1829
             });
1830 1830
         }
@@ -1887,7 +1887,7 @@  discard block
 block discarded – undo
1887 1887
         }
1888 1888
 
1889 1889
         if ($_success) {
1890
-            $this->value = call_user_func(function () use (&$number) {
1890
+            $this->value = call_user_func(function() use (&$number) {
1891 1891
                 return new AccountNode($this->currentLineNr, ltrim($number, '0'));
1892 1892
             });
1893 1893
         }
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
         }
1925 1925
 
1926 1926
         if ($_success) {
1927
-            $this->value = call_user_func(function () use (&$number) {
1927
+            $this->value = call_user_func(function() use (&$number) {
1928 1928
                 return new BankgiroNode($this->currentLineNr, ltrim($number, '0'));
1929 1929
             });
1930 1930
         }
@@ -2016,7 +2016,7 @@  discard block
 block discarded – undo
2016 2016
         }
2017 2017
 
2018 2018
         if ($_success) {
2019
-            $this->value = call_user_func(function () use (&$nr) {
2019
+            $this->value = call_user_func(function() use (&$nr) {
2020 2020
                 return ltrim($nr, '0');
2021 2021
             });
2022 2022
         }
@@ -2085,7 +2085,7 @@  discard block
 block discarded – undo
2085 2085
         }
2086 2086
 
2087 2087
         if ($_success) {
2088
-            $this->value = call_user_func(function () use (&$date) {
2088
+            $this->value = call_user_func(function() use (&$date) {
2089 2089
                 return new \DateTimeImmutable($date . '000000');
2090 2090
             });
2091 2091
         }
@@ -2160,10 +2160,10 @@  discard block
 block discarded – undo
2160 2160
         }
2161 2161
 
2162 2162
         if ($_success) {
2163
-            $this->value = call_user_func(function () use (&$century, &$number) {
2163
+            $this->value = call_user_func(function() use (&$century, &$number) {
2164 2164
                 return in_array($century, ['00', '99'])
2165 2165
                     ? new OrganizationIdNode($this->currentLineNr, $number)
2166
-                    : new PersonalIdNode($this->currentLineNr, $century.$number);
2166
+                    : new PersonalIdNode($this->currentLineNr, $century . $number);
2167 2167
             });
2168 2168
         }
2169 2169
 
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
         }
2226 2226
 
2227 2227
         if ($_success) {
2228
-            $this->value = call_user_func(function () use (&$nr) {
2228
+            $this->value = call_user_func(function() use (&$nr) {
2229 2229
                 return new PayerNumberNode($this->currentLineNr, ltrim($nr, '0'));
2230 2230
             });
2231 2231
         }
@@ -2925,7 +2925,7 @@  discard block
 block discarded – undo
2925 2925
         }
2926 2926
 
2927 2927
         if ($_success) {
2928
-            $this->value = call_user_func(function () {
2928
+            $this->value = call_user_func(function() {
2929 2929
                 $this->currentLineNr++;
2930 2930
             });
2931 2931
         }
Please login to merge, or discard this patch.
spec/GrammarSpec.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     {
15 15
         return array_reduce(
16 16
             explode("\n", $content),
17
-            function ($carry, $line) {
17
+            function($carry, $line) {
18 18
                 if (empty(trim($line))) {
19 19
                     return $carry;
20 20
                 }
Please login to merge, or discard this patch.
src/ParserFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
      */
67 67
     public function createParser(int $flags = 0): Parser
68 68
     {
69
-        $flag = function (int $needle) use ($flags) {
69
+        $flag = function(int $needle) use ($flags) {
70 70
             return ($needle & $flags) == $needle;
71 71
         };
72 72
 
Please login to merge, or discard this patch.
src/Tree/LayoutNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
         $this->setChild('opening', $opening);
33 33
 
34 34
         foreach ($content as $key => $node) {
35
-            $this->setChild('content_'.++$key, $node);
35
+            $this->setChild('content_' . ++$key, $node);
36 36
         }
37 37
 
38 38
         $this->setChild('closing', $closing);
Please login to merge, or discard this patch.