Passed
Pull Request — master (#119)
by Roberto
02:33
created
src/Soap/SoapClientExtended.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class SoapClientExtended extends SoapClient
8 8
 {
9
-   /**
9
+    /**
10 10
      * __construct
11 11
      * @param mixed $wsdl NULL for non-wsdl mode or URL string for wsdl mode
12 12
      * @param array $options
Please login to merge, or discard this 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
     public function __doRequest($request, $location, $action, $version, $oneWay = 0)
32 32
     {
33
-        $search = [":ns1","ns1:","\n","\r"];
33
+        $search = [":ns1", "ns1:", "\n", "\r"];
34 34
         return parent::__doRequest(
35 35
             str_replace($search, '', $request),
36 36
             $location,
Please login to merge, or discard this patch.
src/Soap/SoapCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 {
23 23
     public static function info($code)
24 24
     {
25
-        $codes = (array) json_decode(file_get_contents(__DIR__.'/httpcodes.json'), true);
25
+        $codes = (array) json_decode(file_get_contents(__DIR__ . '/httpcodes.json'), true);
26 26
         if (array_key_exists($code, $codes)) {
27 27
             return $codes[$code];
28 28
         }
Please login to merge, or discard this patch.
src/Exception/ValidatorException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@
 block discarded – undo
17 17
     {
18 18
         $msg = '';
19 19
         foreach ($errors as $error) {
20
-            $msg .= $error->message."\n";
20
+            $msg .= $error->message . "\n";
21 21
         }
22
-        return new static('This XML is not valid. '.$msg);
22
+        return new static('This XML is not valid. ' . $msg);
23 23
     }
24 24
     
25 25
     public static function isNotXml()
Please login to merge, or discard this patch.
src/Soap/SoapCurl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir . $this->prifile);
98 98
             curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass);
99 99
             curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1);
100
-            if (! empty($envelope)) {
100
+            if (!empty($envelope)) {
101 101
                 curl_setopt($oCurl, CURLOPT_POST, 1);
102 102
                 curl_setopt($oCurl, CURLOPT_POSTFIELDS, $envelope);
103 103
                 curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parameters);
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
         if ($this->proxyIP != '') {
137 137
             curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1);
138 138
             curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
139
-            curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort);
139
+            curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort);
140 140
             if ($this->proxyUser != '') {
141
-                curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass);
141
+                curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass);
142 142
                 curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
143 143
             }
144 144
         }
Please login to merge, or discard this patch.
src/Signer.php 3 patches
Doc Comments   +1 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * Make Signature tag
39 39
      * @param string $content
40 40
      * @param string $tagname
41
-     * @param string $marker for URI
41
+     * @param string $mark for URI
42 42
      * @param string $algorithm
43 43
      * @param array $canonical parameters to format node for signature
44 44
      * @param string $rootname name of tag to insert signature block
@@ -104,7 +104,6 @@  discard block
 block discarded – undo
104 104
     
105 105
     /**
106 106
      * Verify if xml signature is valid
107
-     * @param string $content xml content
108 107
      * @param string $tagname tag for sign
109 108
      * @return boolean
110 109
      */
@@ -241,8 +240,6 @@  discard block
 block discarded – undo
241 240
     /**
242 241
      * digestCheck
243 242
      * Verify digest value
244
-     * @param string $content
245
-     * @param string $tagid
246 243
      * @return boolean
247 244
      * @throws SignerException
248 245
      */
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 use NFePHP\Common\Certificate;
26 26
 use NFePHP\Common\Certificate\PublicKey;
27 27
 use NFePHP\Common\Exception\SignerException;
28
-use NFePHP\Common\Strings;
29 28
 use RuntimeException;
30 29
 use DOMDocument;
31 30
 use DOMElement;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 class Signer
34 34
 {
35
-    private static $canonical = [false,false,null,null];
35
+    private static $canonical = [false, false, null, null];
36 36
     
37 37
     /**
38 38
      * Make Signature tag
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $tagname = '',
52 52
         $mark = 'Id',
53 53
         $algorithm = OPENSSL_ALGO_SHA1,
54
-        $canonical = [false,false,null,null],
54
+        $canonical = [false, false, null, null],
55 55
         $rootname = ''
56 56
     ) {
57 57
         if (!empty($canonical)) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 'Tag not found ' . $tagname . ' ' . $rootname
72 72
             );
73 73
         }
74
-        if (! self::existsSignature($dom)) {
74
+        if (!self::existsSignature($dom)) {
75 75
             $dom = self::createSignature(
76 76
                 $certificate,
77 77
                 $dom,
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         DOMElement $node,
138 138
         $mark,
139 139
         $algorithm = OPENSSL_ALGO_SHA1,
140
-        $canonical = [false,false,null,null]
140
+        $canonical = [false, false, null, null]
141 141
     ) {
142 142
         $nsDSIG = 'http://www.w3.org/2000/09/xmldsig#';
143 143
         $nsCannonMethod = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             $nsSignatureMethod = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256';
150 150
             $nsDigestMethod = 'http://www.w3.org/2001/04/xmlenc#sha256';
151 151
         }
152
-        $nsTransformMethod1 ='http://www.w3.org/2000/09/xmldsig#enveloped-signature';
152
+        $nsTransformMethod1 = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature';
153 153
         $nsTransformMethod2 = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
154 154
         $idSigned = trim($node->getAttribute($mark));
155 155
         $digestValue = self::makeDigest($node, $digestAlgorithm, $canonical);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     {
251 251
         $node = $dom->getElementsByTagName($tagname)->item(0);
252 252
         if (empty($node)) {
253
-            throw new \RuntimeException('Tag not found ' .$tagname);
253
+            throw new \RuntimeException('Tag not found ' . $tagname);
254 254
         }
255 255
         $signature = $dom->getElementsByTagName('Signature')->item(0);
256 256
         if (empty($signature)) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      * @param array $canonical
288 288
      * @return string
289 289
      */
290
-    private static function makeDigest(DOMElement $node, $algorithm, $canonical = [false,false,null,null])
290
+    private static function makeDigest(DOMElement $node, $algorithm, $canonical = [false, false, null, null])
291 291
     {
292 292
         //calcular o hash dos dados
293 293
         $c14n = $node->C14N(
Please login to merge, or discard this patch.
src/Soap/SoapNative.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 use NFePHP\Common\Soap\SoapBase;
20 20
 use NFePHP\Common\Soap\SoapInterface;
21 21
 use NFePHP\Common\Exception\SoapException;
22
-use SoapHeader;
23 22
 use SoapFault;
24 23
 use NFePHP\Common\Certificate;
25 24
 use Psr\Log\LoggerInterface;
Please login to merge, or discard this patch.