Passed
Pull Request — master (#219)
by
unknown
03:00
created
src/DOMImproved.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     /**
56 56
      * Load xml from path
57 57
      * @param string $filename
58
-     * @return bool
58
+     * @return false|null
59 59
      */
60 60
     public function loadXMLFile($filename)
61 61
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
     public function getChave($nodeName = 'infNFe')
126 126
     {
127 127
         $node = $this->getElementsByTagName($nodeName)->item(0);
128
-        if (! empty($node)) {
128
+        if (!empty($node)) {
129 129
             $chaveId = $node->getAttribute("Id");
130
-            $chave =  preg_replace('/[^0-9]/', '', $chaveId);
130
+            $chave = preg_replace('/[^0-9]/', '', $chaveId);
131 131
             return $chave;
132 132
         }
133 133
         return '';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     public function addArrayChild(DOMElement &$parent, $arr)
249 249
     {
250 250
         $num = 0;
251
-        if (! empty($arr) && ! empty($parent)) {
251
+        if (!empty($arr) && !empty($parent)) {
252 252
             foreach ($arr as $node) {
253 253
                 $this->appChild($parent, $node, '');
254 254
                 $num++;
Please login to merge, or discard this patch.
src/Soap/SoapFake.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  */
17 17
 use NFePHP\Common\Soap\SoapBase;
18 18
 use NFePHP\Common\Soap\SoapInterface;
19
-use NFePHP\Common\Exception\SoapException;
20 19
 use NFePHP\Common\Certificate;
21 20
 use Psr\Log\LoggerInterface;
22 21
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         switch ($soapver) {
54 54
             case SOAP_1_1:
55 55
                 $parameters[] = "Content-Type: text/xml;charset=UTF-8;";
56
-                if(!empty($action)) $parameters[] = "SOAPAction: \"$action\"";
56
+                if (!empty($action)) $parameters[] = "SOAPAction: \"$action\"";
57 57
                 $parameters[] = "Content-length: $msgSize";
58 58
                 break;
59 59
             case SOAP_1_2:
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
                     "Content-Type: application/soap+xml;charset=utf-8;",
62 62
                     "Content-length: $msgSize"
63 63
                 ];
64
-                if(!empty($action)) $parameter[0] .= "action=$action";
64
+                if (!empty($action)) $parameter[0] .= "action=$action";
65 65
                 break;
66 66
             default:
67 67
                 $parameters = [
68 68
                     "Content-Type: application/soap+xml;charset=utf-8;",
69 69
                     "Content-length: $msgSize"
70 70
                 ];
71
-                if(!empty($action)) $parameter[0] .= "action=$action";
71
+                if (!empty($action)) $parameter[0] .= "action=$action";
72 72
                 break;
73 73
         }
74 74
         
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@  discard block
 block discarded – undo
53 53
         switch ($soapver) {
54 54
             case SOAP_1_1:
55 55
                 $parameters[] = "Content-Type: text/xml;charset=UTF-8;";
56
-                if(!empty($action)) $parameters[] = "SOAPAction: \"$action\"";
56
+                if(!empty($action)) {
57
+                    $parameters[] = "SOAPAction: \"$action\"";
58
+                }
57 59
                 $parameters[] = "Content-length: $msgSize";
58 60
                 break;
59 61
             case SOAP_1_2:
@@ -61,14 +63,18 @@  discard block
 block discarded – undo
61 63
                     "Content-Type: application/soap+xml;charset=utf-8;",
62 64
                     "Content-length: $msgSize"
63 65
                 ];
64
-                if(!empty($action)) $parameter[0] .= "action=$action";
66
+                if(!empty($action)) {
67
+                    $parameter[0] .= "action=$action";
68
+                }
65 69
                 break;
66 70
             default:
67 71
                 $parameters = [
68 72
                     "Content-Type: application/soap+xml;charset=utf-8;",
69 73
                     "Content-length: $msgSize"
70 74
                 ];
71
-                if(!empty($action)) $parameter[0] .= "action=$action";
75
+                if(!empty($action)) {
76
+                    $parameter[0] .= "action=$action";
77
+                }
72 78
                 break;
73 79
         }
74 80
         
Please login to merge, or discard this patch.
src/Certificate/Oids.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     private static function loadOids()
53 53
     {
54
-        $json = file_get_contents(__DIR__ .'/oids.json');
54
+        $json = file_get_contents(__DIR__ . '/oids.json');
55 55
         self::$oidsTable = (array) json_decode($json, true);
56 56
     }
57 57
 }
Please login to merge, or discard this patch.
src/Soap/SoapClientExtended.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
     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/ExceptionCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
      */
88 88
     public function __toString()
89 89
     {
90
-        $messages = array_map(function (\Exception $exception) {
90
+        $messages = array_map(function(\Exception $exception) {
91 91
             return $exception->getMessage();
92 92
         }, $this->exceptions);
93 93
         return implode(PHP_EOL, $messages);
Please login to merge, or discard this patch.
src/Exception/SignerException.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
20 20
     public static function digestComparisonFailed()
21 21
     {
22 22
         return new static('The XML content does not match the Digest Value. '
23
-           . 'Probably modified after it was signed');
23
+            . 'Probably modified after it was signed');
24 24
     }
25 25
     
26 26
     public static function signatureComparisonFailed()
27 27
     {
28 28
         return new static('The XML SIGNATURE does not match. '
29
-           . 'Probably modified after it was signed.');
29
+            . 'Probably modified after it was signed.');
30 30
     }
31 31
     
32 32
     
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."\n";
20
+            $msg .= $error . "\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/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $dom->formatOutput = false;
40 40
         $dom->loadXML($xml, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG);
41 41
         libxml_clear_errors();
42
-        if (! $dom->schemaValidate($xsd)) {
42
+        if (!$dom->schemaValidate($xsd)) {
43 43
             $errors = [];
44 44
             foreach (libxml_get_errors() as $error) {
45 45
                 $errors[] = $error->message;
Please login to merge, or discard this patch.