Passed
Push — main ( 5636f4...c78718 )
by Daniel
03:33
created
source/ClassElectronicInvoiceUserInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     private function getButtonForLocalisation(string $strLanguageCountry): string
32 32
     {
33
-        $arrayMapFlags  = [
33
+        $arrayMapFlags = [
34 34
             'ro_RO' => 'ro',
35 35
             'it_IT' => 'it',
36 36
             'en_US' => 'us',
Please login to merge, or discard this patch.
source/ClassElectronicInvoiceRead.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         return $arrayDocument;
102 102
     }
103 103
 
104
-    private function getHeaderComponents(array $arrayParams, string $key, string $value): array|string
104
+    private function getHeaderComponents(array $arrayParams, string $key, string $value): array | string
105 105
     {
106 106
         $arrayDocument = [];
107 107
         if ($value === 'SingleCompany') {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                 ])
114 114
             ];
115 115
         } else {
116
-            $arrayMapping  = [
116
+            $arrayMapping = [
117 117
                 'Multiple'                  => [
118 118
                     'getMultipleElementsByKey'
119 119
                     , $arrayParams['data']->children('cac', true)->$key
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             'data'          => $objFile->children($strMap['cbc'], true),
159 159
             'namespace_cbc' => $arrayDocument['DocumentNameSpaces'][$strMap['cbc']],
160 160
         ]);
161
-        $arrayAggregates         = $this->getHeader([
161
+        $arrayAggregates = $this->getHeader([
162 162
             'CAC'  => $objFile->children($strMap['cac'], true),
163 163
             'data' => $objFile,
164 164
         ]);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $this->getBasicOrAggregateKey($arrayDocument['DocumentNameSpaces'], $strMap['cbc']) => $arrayBasics,
167 167
             $this->getBasicOrAggregateKey($arrayDocument['DocumentNameSpaces'], $strMap['cac']) => $arrayAggregates,
168 168
         ];
169
-        $arrayDocument['Lines']  = $this->getDocumentLines($objFile, $arrayDocument['DocumentTagName']);
169
+        $arrayDocument['Lines'] = $this->getDocumentLines($objFile, $arrayDocument['DocumentTagName']);
170 170
         return $arrayDocument;
171 171
     }
172 172
 
Please login to merge, or discard this patch.
source/TraitLines.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $arrayOutput = [];
41 41
         foreach ($this->arrayProcessing['Lines@Read'] as $strElement => $strType) {
42
-            switch($strType) {
42
+            switch ($strType) {
43 43
                 case 'Item':
44 44
                     $arrayOutput[$strElement] = $this->getLineItem($child->children($this->arrayProcessing['mapping']['cac'], true)->$strElement);
45 45
                     break;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $arrayOutput = [];
67 67
         foreach ($this->arrayProcessing['Lines_Item@Read'] as $key => $value) {
68
-            switch($value) {
68
+            switch ($value) {
69 69
                 case 'Multiple':
70 70
                     if (isset($child3->children($this->arrayProcessing['mapping']['cac'], true)->$key)) {
71 71
                         $arrayOutput[$key] = $this->getMultipleElementsByKey($child3->children($this->arrayProcessing['mapping']['cac'], true)->$key);
Please login to merge, or discard this patch.
source/TraitBackEndRomania.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     use \danielgp\io_operations\InputOutputCurl;
25 25
     use \danielgp\efactura\TraitBasic;
26 26
 
27
-    private array $arraystandardMesageFilters    = [
27
+    private array $arraystandardMesageFilters = [
28 28
         [
29 29
             'Code'   => 'E',
30 30
             'Detail' => 'raspuns cu erorile si semnatura MF, livrat in urma transmiterii unei facturi'
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     {
105 105
         $arrayErrorMessages = [];
106 106
         foreach ($arrayAssignedChecks as $strLabelCheck => $elementChecked) {
107
-            switch($strLabelCheck) {
107
+            switch ($strLabelCheck) {
108 108
                 case 'Empty Environment':
109 109
                     if ($elementChecked == '') {
110 110
                         $arrayErrorMessages[] = 'Environment is NOT allowed to be empty'
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         $strContentBranch          = '';
211 211
         $arrayFinalParameterValues = [];
212 212
         $strFilter                 = '';
213
-        switch($strType) {
213
+        switch ($strType) {
214 214
             case 'ListAll':
215 215
                 $strContentBranch            = 'ListAllMessages';
216 216
                 $arrayFinalParameterValues[] = $arrayParameters['Days'];
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             $strRelevantUrl,
238 238
         ]));
239 239
         // sent XML content using CURL and capture feedback
240
-        $arrayFeedback  = $this->getContentFromUrlThroughCurl($strRelevantUrl, [
240
+        $arrayFeedback = $this->getContentFromUrlThroughCurl($strRelevantUrl, [
241 241
             'HttpHeader' => $this->buildHeaderAsArray(),
242 242
         ]);
243 243
         if ($arrayFeedback['errNo'] === 0) {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             'Empty Environment'              => $this->arraySolutionCustomSettings['StringElectronicInvoiceEnvironment'],
317 317
             'Non-Standard Environment Value' => $this->arraySolutionCustomSettings['StringElectronicInvoiceEnvironment'],
318 318
         ];
319
-        $arrayValidations          = $arrayUniversalValidations;
319
+        $arrayValidations = $arrayUniversalValidations;
320 320
         if ($arrayAdditionalValidations != []) {
321 321
             $arrayValidations = array_merge($arrayValidations, $arrayAdditionalValidations);
322 322
         }
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
                 'Mandatory' => ['LoadingId'],
339 339
             ],
340 340
         };
341
-        $arrayAllowedCombined   = $arrayAllowedParameters['Mandatory'];
341
+        $arrayAllowedCombined = $arrayAllowedParameters['Mandatory'];
342 342
         if (array_key_exists('Optional', $arrayAllowedParameters)) {
343 343
             $arrayAllowedCombined = array_merge($arrayAllowedParameters['Mandatory'], $arrayAllowedParameters['Optional']);
344 344
         }
345 345
         $arrayGivenKeys = array_keys($arrayParameters);
346
-        $arrayErrors      = [];
346
+        $arrayErrors = [];
347 347
         if (array_diff($arrayAllowedParameters['Mandatory'], $arrayGivenKeys) != []) {
348 348
             $arrayErrors[] = vsprintf('Provided parameters %s does contain all mandatory ones: %s...', [
349 349
                 json_encode($arrayGivenKeys),
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
         } else {
358 358
             // here we have to validate actual value passed as parameters
359 359
             foreach ($arrayParameters as $strParameterKey => $strParameterValue) {
360
-                switch($strParameterKey) {
360
+                switch ($strParameterKey) {
361 361
                     case 'Days':
362 362
                     case 'LoadingId':
363 363
                     case 'Page':
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                             'LoadingId' => '1-' . strval(9 * pow(10, 10)),
367 367
                             'Page'      => '0-' . strval(9 * pow(10, 6)),
368 368
                         });
369
-                        $regs                    = null;
369
+                        $regs = null;
370 370
                         preg_match('/[0-9]{1,20}/', $strParameterValue, $regs, PREG_UNMATCHED_AS_NULL);
371 371
                         if (is_array($regs) && ($regs !== []) && ($regs[0] != $strParameterValue)) {
372 372
                             $arrayErrors[] = vsprintf('Parameter "%s" is expected to be of integer type'
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                             . '|' . strval((new \DateTime('now', new \DateTimeZone('UTC')))->format('U') * 1000));
401 401
                         $arrayRangeAllowedPiecesForHumans = explode('|', (\DateTime::createFromFormat('U', intval(($arrayRangeAllowedPieces[0] / 1000)), new \DateTimeZone('UTC')))->format('Y-m-d H:i:s')
402 402
                             . '|' . (\DateTime::createFromFormat('U', intval(($arrayRangeAllowedPieces[1] / 1000)), new \DateTimeZone('UTC')))->format('Y-m-d H:i:s'));
403
-                        $arrayErrors                        = [];
403
+                        $arrayErrors = [];
404 404
                         if (is_integer($strParameterValue) && (($strParameterValue < $arrayRangeAllowedPieces[0]) || ($strParameterValue > $arrayRangeAllowedPieces[1]))) {
405 405
                             $arrayErrors[] = vsprintf('Parameter "%s" is given as an integer value %s (which translate in %s) '
406 406
                                 . ' but that is NOT within allowed range, which is between %s and %s...', [
@@ -443,10 +443,10 @@  discard block
 block discarded – undo
443 443
             'File base name end with',
444 444
             'File base name starts with',
445 445
         ];
446
-        $strLabel         = '';
446
+        $strLabel = '';
447 447
         foreach ($arrayKnownLabels as $strCurrentLabel) {
448 448
             $arrayPieces = explode('|', $this->arraySolutionCustomSettings['ArrayStrategyForUpload'][$strCurrentLabel]);
449
-            switch($arrayPieces[0]) {
449
+            switch ($arrayPieces[0]) {
450 450
                 case 'File base name end with':
451 451
                     if (str_ends_with($strFileName, $arrayPieces[1])) {
452 452
                         $strLabel = $strCurrentLabel;
Please login to merge, or discard this patch.
source/TraitUserInterfaceLogic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $arrayToReturn = [];
132 132
         $strFileMime   = mime_content_type($strFile->getRealPath());
133
-        switch($strFileMime) {
133
+        switch ($strFileMime) {
134 134
             case 'application/json':
135 135
                 $arrayError    = $this->getArrayFromJsonFile($strFile->getPath(), $strFile->getFilename());
136 136
                 $arrayToReturn = $this->setStandardizedFeedbackArray([
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
             $appR              = new \danielgp\efactura\ClassElectronicInvoiceRead();
268 268
             $objFile           = $appR->readElectronicXmlHeader(filter_var($arrayData['strInvoiceContent'], FILTER_FLAG_ENCODE_HIGH));
269 269
             $documentHeaderTag = $appR->getDocumentRoot($objFile);
270
-            switch($documentHeaderTag['DocumentTagName']) {
270
+            switch ($documentHeaderTag['DocumentTagName']) {
271 271
                 case 'header':
272
-                    switch($documentHeaderTag['DocumentNameSpaces']['']) {
272
+                    switch ($documentHeaderTag['DocumentNameSpaces']['']) {
273 273
                         case 'mfp:anaf:dgti:efactura:mesajEroriFactuta:v1':
274 274
                             $arrayTemp     = $this->setErrorsFromExtendedMarkupLaguage($arrayData, $strErrorTag);
275 275
                             $arrayToReturn = array_merge($arrayToReturn, $arrayTemp);
Please login to merge, or discard this patch.