Passed
Branch master (572cb8)
by Giancarlos
03:56
created
src/Greenter/Zip/ZipFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function decompress($zipContent, $fileToExtract)
42 42
     {
43
-        $temp = tempnam(sys_get_temp_dir(),time() . '.zip');
43
+        $temp = tempnam(sys_get_temp_dir(), time() . '.zip');
44 44
         file_put_contents($temp, $zipContent);
45 45
         $zip = new ZipArchive;
46 46
         $output = "";
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function decompressLastFile($zipContent)
63 63
     {
64
-        $temp = tempnam(sys_get_temp_dir(),time() . '.zip');
64
+        $temp = tempnam(sys_get_temp_dir(), time() . '.zip');
65 65
         file_put_contents($temp, $zipContent);
66 66
         $zip = new ZipArchive;
67 67
         $output = "";
Please login to merge, or discard this patch.
src/Greenter/Zip/ZipFile.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
         $name = str_replace('\\', '/', $name);
102 102
         $hexdtime = pack('V', $this->unix2DosTime($time));
103 103
         $frd = "\x50\x4b\x03\x04";
104
-        $frd .= "\x14\x00";            // ver needed to extract
105
-        $frd .= "\x00\x00";            // gen purpose bit flag
106
-        $frd .= "\x08\x00";            // compression method
107
-        $frd .= $hexdtime;             // last mod time and date
104
+        $frd .= "\x14\x00"; // ver needed to extract
105
+        $frd .= "\x00\x00"; // gen purpose bit flag
106
+        $frd .= "\x08\x00"; // compression method
107
+        $frd .= $hexdtime; // last mod time and date
108 108
         // "local file header" segment
109 109
         $unc_len = strlen($data);
110 110
         $crc = crc32($data);
111 111
         $zdata = gzcompress($data);
112 112
         $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
113 113
         $c_len = strlen($zdata);
114
-        $frd .= pack('V', $crc);             // crc32
115
-        $frd .= pack('V', $c_len);           // compressed filesize
116
-        $frd .= pack('V', $unc_len);         // uncompressed filesize
117
-        $frd .= pack('v', strlen($name));    // length of filename
118
-        $frd .= pack('v', 0);                // extra field length
114
+        $frd .= pack('V', $crc); // crc32
115
+        $frd .= pack('V', $c_len); // compressed filesize
116
+        $frd .= pack('V', $unc_len); // uncompressed filesize
117
+        $frd .= pack('v', strlen($name)); // length of filename
118
+        $frd .= pack('v', 0); // extra field length
119 119
         $frd .= $name;
120 120
         // "file data" segment
121 121
         $frd .= $zdata;
@@ -125,20 +125,20 @@  discard block
 block discarded – undo
125 125
         }
126 126
         // now add to central directory record
127 127
         $cdrec = "\x50\x4b\x01\x02";
128
-        $cdrec .= "\x00\x00";                // version made by
129
-        $cdrec .= "\x14\x00";                // version needed to extract
130
-        $cdrec .= "\x00\x00";                // gen purpose bit flag
131
-        $cdrec .= "\x08\x00";                // compression method
132
-        $cdrec .= $hexdtime;                 // last mod time & date
133
-        $cdrec .= pack('V', $crc);           // crc32
134
-        $cdrec .= pack('V', $c_len);         // compressed filesize
135
-        $cdrec .= pack('V', $unc_len);       // uncompressed filesize
128
+        $cdrec .= "\x00\x00"; // version made by
129
+        $cdrec .= "\x14\x00"; // version needed to extract
130
+        $cdrec .= "\x00\x00"; // gen purpose bit flag
131
+        $cdrec .= "\x08\x00"; // compression method
132
+        $cdrec .= $hexdtime; // last mod time & date
133
+        $cdrec .= pack('V', $crc); // crc32
134
+        $cdrec .= pack('V', $c_len); // compressed filesize
135
+        $cdrec .= pack('V', $unc_len); // uncompressed filesize
136 136
         $cdrec .= pack('v', strlen($name)); // length of filename
137
-        $cdrec .= pack('v', 0);             // extra field length
138
-        $cdrec .= pack('v', 0);             // file comment length
139
-        $cdrec .= pack('v', 0);             // disk number start
140
-        $cdrec .= pack('v', 0);             // internal file attributes
141
-        $cdrec .= pack('V', 32);            // external file attributes
137
+        $cdrec .= pack('v', 0); // extra field length
138
+        $cdrec .= pack('v', 0); // file comment length
139
+        $cdrec .= pack('v', 0); // disk number start
140
+        $cdrec .= pack('v', 0); // internal file attributes
141
+        $cdrec .= pack('V', 32); // external file attributes
142 142
         // - 'archive' bit set
143 143
         $cdrec .= pack('V', $this->old_offset); // relative offset of local header
144 144
         $this->old_offset += strlen($frd);
@@ -158,21 +158,21 @@  discard block
 block discarded – undo
158 158
     public function file()
159 159
     {
160 160
         $ctrldir = implode('', $this->ctrl_dir);
161
-        $header = $ctrldir.
162
-            $this->eof_ctrl_dir.
163
-            pack('v', sizeof($this->ctrl_dir)). //total #of entries "on this disk"
164
-            pack('v', sizeof($this->ctrl_dir)). //total #of entries overall
165
-            pack('V', strlen($ctrldir)).          //size of central dir
166
-            pack('V', $this->old_offset).       //offset to start of central dir
167
-            "\x00\x00";                            //.zip file comment length
161
+        $header = $ctrldir .
162
+            $this->eof_ctrl_dir .
163
+            pack('v', sizeof($this->ctrl_dir)) . //total #of entries "on this disk"
164
+            pack('v', sizeof($this->ctrl_dir)) . //total #of entries overall
165
+            pack('V', strlen($ctrldir)) . //size of central dir
166
+            pack('V', $this->old_offset) . //offset to start of central dir
167
+            "\x00\x00"; //.zip file comment length
168 168
         if ($this->doWrite) { // Send central directory & end ctrl dir to STDOUT
169
-            return '';            // Return empty string
169
+            return ''; // Return empty string
170 170
         }
171 171
 
172 172
         // Return entire ZIP archive as string
173 173
         $data = implode('', $this->datasec);
174 174
 
175
-        return $data.$header;
175
+        return $data . $header;
176 176
     }
177 177
 
178 178
  // end of the 'file()' method
Please login to merge, or discard this patch.
src/Greenter/Ws/Reader/DomCdrReader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,9 +69,9 @@
 block discarded – undo
69 69
         $obj = $resp[0];
70 70
 
71 71
         $cdr = new CdrResponse();
72
-        $cdr->setId($this->getValueByName($obj,'ReferenceID'))
73
-            ->setCode($this->getValueByName($obj,'ResponseCode'))
74
-            ->setDescription($this->getValueByName($obj,'Description'));
72
+        $cdr->setId($this->getValueByName($obj, 'ReferenceID'))
73
+            ->setCode($this->getValueByName($obj, 'ResponseCode'))
74
+            ->setDescription($this->getValueByName($obj, 'Description'));
75 75
 
76 76
         return $cdr;
77 77
     }
Please login to merge, or discard this patch.
src/Greenter/Ws/Services/FeSunat.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
                 ->setCdrResponse($this->extractResponse($cdrZip))
55 55
                 ->setCdrZip($cdrZip)
56 56
                 ->setSuccess(true);
57
-        }
58
-        catch (\SoapFault $e) {
57
+        } catch (\SoapFault $e) {
59 58
             $result->setError($this->getErrorFromFault($e));
60 59
         }
61 60
 
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
             $result
82 81
                 ->setTicket($response->ticket)
83 82
                 ->setSuccess(true);
84
-        }
85
-        catch (\SoapFault $e) {
83
+        } catch (\SoapFault $e) {
86 84
             $result->setError($this->getErrorFromFault($e));
87 85
         }
88 86
         return $result;
@@ -110,8 +108,7 @@  discard block
 block discarded – undo
110 108
                 ->setCdrResponse($this->extractResponse($cdrZip))
111 109
                 ->setCdrZip($cdrZip)
112 110
                 ->setSuccess(true);
113
-        }
114
-        catch (\SoapFault $e) {
111
+        } catch (\SoapFault $e) {
115 112
             $result->setError($this->getErrorFromFault($e));
116 113
         }
117 114
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 'fileName' => $filename,
50 50
                 'contentFile' => $content,
51 51
             ];
52
-            $response = $client->__soapCall('sendBill', [ 'parameters' => $params ]);
52
+            $response = $client->__soapCall('sendBill', ['parameters' => $params]);
53 53
 
54 54
             $cdrZip = $response->applicationResponse;
55 55
             $result
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 'fileName' => $filename,
80 80
                 'contentFile' => $content,
81 81
             ];
82
-            $response = $client->__soapCall('sendSummary', [ 'parameters' => $params ]);
82
+            $response = $client->__soapCall('sendSummary', ['parameters' => $params]);
83 83
             $result
84 84
                 ->setTicket($response->ticket)
85 85
                 ->setSuccess(true);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $params = [
104 104
                 'ticket' => $ticket,
105 105
             ];
106
-            $response = $client->__soapCall('getStatus', [ 'parameters' => $params ]);
106
+            $response = $client->__soapCall('getStatus', ['parameters' => $params]);
107 107
             $status = $response->status;
108 108
             $cdrZip = $status->content;
109 109
 
Please login to merge, or discard this patch.
src/Greenter/Factory/BaseFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         $this->signer = new SignedXml();
58 58
         $this->sender = new FeSunat();
59 59
         $this->zipper = new ZipFactory();
60
-        $this->sender->setUrlWsdl(__DIR__.'/../Resources/wsdl/billService.wsdl');
60
+        $this->sender->setUrlWsdl(__DIR__ . '/../Resources/wsdl/billService.wsdl');
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
src/Greenter/Xml/Validator/InvoiceValidator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         ]);
29 29
         $metadata->addPropertyConstraints('serie', [
30 30
             new Assert\NotBlank(),
31
-            new Assert\Length([ 'max' => 4]),
31
+            new Assert\Length(['max' => 4]),
32 32
         ]);
33 33
         $metadata->addPropertyConstraints('correlativo', [
34 34
             new Assert\NotBlank(),
@@ -42,19 +42,19 @@  discard block
 block discarded – undo
42 42
             new Assert\NotBlank(),
43 43
             new Assert\Length(['max' => 3]),
44 44
         ]);
45
-        $metadata->addPropertyConstraints('mtoOperGravadas',[
45
+        $metadata->addPropertyConstraints('mtoOperGravadas', [
46 46
             new Assert\NotBlank(),
47 47
             new Assert\Type(['type' => 'numeric']),
48 48
         ]);
49
-        $metadata->addPropertyConstraints('mtoOperInafectas',[
49
+        $metadata->addPropertyConstraints('mtoOperInafectas', [
50 50
             new Assert\NotBlank(),
51 51
             new Assert\Type(['type' => 'numeric']),
52 52
         ]);
53
-        $metadata->addPropertyConstraints('mtoOperExoneradas',[
53
+        $metadata->addPropertyConstraints('mtoOperExoneradas', [
54 54
             new Assert\NotBlank(),
55 55
             new Assert\Type(['type' => 'numeric']),
56 56
         ]);
57
-        $metadata->addPropertyConstraints('mtoImpVenta',[
57
+        $metadata->addPropertyConstraints('mtoImpVenta', [
58 58
             new Assert\NotBlank(),
59 59
             new Assert\Type(['type' => 'numeric']),
60 60
         ]);
Please login to merge, or discard this patch.
src/Greenter/Xml/Validator/NoteValidator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         ]);
29 29
         $metadata->addPropertyConstraints('serie', [
30 30
             new Assert\NotBlank(),
31
-            new Assert\Length([ 'max' => 4]),
31
+            new Assert\Length(['max' => 4]),
32 32
         ]);
33 33
         $metadata->addPropertyConstraints('correlativo', [
34 34
             new Assert\NotBlank(),
@@ -42,19 +42,19 @@  discard block
 block discarded – undo
42 42
             new Assert\NotBlank(),
43 43
             new Assert\Length(['max' => 3]),
44 44
         ]);
45
-        $metadata->addPropertyConstraints('mtoOperGravadas',[
45
+        $metadata->addPropertyConstraints('mtoOperGravadas', [
46 46
             new Assert\NotBlank(),
47 47
             new Assert\Type(['type' => 'numeric']),
48 48
         ]);
49
-        $metadata->addPropertyConstraints('mtoOperInafectas',[
49
+        $metadata->addPropertyConstraints('mtoOperInafectas', [
50 50
             new Assert\NotBlank(),
51 51
             new Assert\Type(['type' => 'numeric']),
52 52
         ]);
53
-        $metadata->addPropertyConstraints('mtoOperExoneradas',[
53
+        $metadata->addPropertyConstraints('mtoOperExoneradas', [
54 54
             new Assert\NotBlank(),
55 55
             new Assert\Type(['type' => 'numeric']),
56 56
         ]);
57
-        $metadata->addPropertyConstraints('mtoImpVenta',[
57
+        $metadata->addPropertyConstraints('mtoImpVenta', [
58 58
             new Assert\NotBlank(),
59 59
             new Assert\Type(['type' => 'numeric']),
60 60
         ]);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         ]);
76 76
         $metadata->addPropertyConstraints('desMotivo', [
77 77
             new Assert\NotBlank(),
78
-            new Assert\Length([ 'max' => 250]),
78
+            new Assert\Length(['max' => 250]),
79 79
         ]);
80 80
         $metadata->addPropertyConstraints('tipDocAfectado', [
81 81
             new Assert\NotBlank(),
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         ]);
87 87
         $metadata->addPropertyConstraints('numDocfectado', [
88 88
             new Assert\NotBlank(),
89
-            new Assert\Length([ 'max' => 13]),
89
+            new Assert\Length(['max' => 13]),
90 90
         ]);
91 91
     }
92 92
 }
93 93
\ No newline at end of file
Please login to merge, or discard this patch.