Completed
Pull Request — master (#50)
by
unknown
03:33
created
lib/XML.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -145,20 +145,20 @@
 block discarded – undo
145 145
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
146 146
      * @version 2016-11-21
147 147
      */
148
-     public function loadXML($source, $options = null)
149
-     {
150
-         $tRetorno = $source ? parent::load($this->iso2utf($source), $options) : false;
148
+        public function loadXML($source, $options = null)
149
+        {
150
+            $tRetorno = $source ? parent::load($this->iso2utf($source), $options) : false;
151 151
 
152
-         if (!$tRetorno){
153
-           $tRetorno = parent::loadXML($this->iso2utf($source), $options);
154
-         }
155
-         if(!$tRetorno){
156
-           foreach (libxml_get_errors() as $error) {
157
-               echo "Error: " . $error->message;
158
-           }
159
-         }
160
-         return $tRetorno;
161
-     }
152
+            if (!$tRetorno){
153
+            $tRetorno = parent::loadXML($this->iso2utf($source), $options);
154
+            }
155
+            if(!$tRetorno){
156
+            foreach (libxml_get_errors() as $error) {
157
+                echo "Error: " . $error->message;
158
+            }
159
+            }
160
+            return $tRetorno;
161
+        }
162 162
 
163 163
     /**
164 164
      * Método para realizar consultas XPATH al documento XML
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
      {
150 150
          $tRetorno = $source ? parent::load($this->iso2utf($source), $options) : false;
151 151
 
152
-         if (!$tRetorno){
152
+         if (!$tRetorno) {
153 153
            $tRetorno = parent::loadXML($this->iso2utf($source), $options);
154 154
          }
155
-         if(!$tRetorno){
155
+         if (!$tRetorno) {
156 156
            foreach (libxml_get_errors() as $error) {
157
-               echo "Error: " . $error->message;
157
+               echo "Error: ".$error->message;
158 158
            }
159 159
          }
160 160
          return $tRetorno;
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      */
208 208
     private function utf2iso($string)
209 209
     {
210
-        return mb_detect_encoding($string, ['UTF-8', 'ISO-8859-1']) != 'ISO-8859-1' ? utf8_decode($string) : $string;
210
+        return mb_detect_encoding($string, ['UTF-8', 'ISO-8859-1'])!='ISO-8859-1' ? utf8_decode($string) : $string;
211 211
     }
212 212
 
213 213
     /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         }
248 248
         // agregar nodos hijos
249 249
         if ($dom->hasChildNodes()) {
250
-            foreach($dom->childNodes as $child) {
250
+            foreach ($dom->childNodes as $child) {
251 251
                 if ($child instanceof \DOMText) {
252 252
                     $textContent = trim($child->textContent);
253 253
                     if ($textContent!="") {
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
         $newXML = '';
373 373
         $n_letras = strlen($xml);
374 374
         $convertir = false;
375
-        for ($i=0; $i<$n_letras; ++$i) {
375
+        for ($i = 0; $i<$n_letras; ++$i) {
376 376
             if ($xml[$i]=='>')
377 377
                 $convertir = true;
378 378
             if ($xml[$i]=='<')
Please login to merge, or discard this patch.