original_string: protected function cleaningHtml($html)
      {
          $xml = false;
          $childrens = null;
  
          try {
              $xml = @simplexml_load_string($html);
          } catch (\Exception $e) {
              // ignore
          }
  
          if ($xml !== false) {
              if (!$this->hasHead && $xml->getName() === 'head') {
                  $childrens = $xml->xpath('//head/child::*');
              }
              if (!$this->hasBody && $xml->getName() === 'body') {
                  $childrens = $xml->xpath('//body/child::*');
              }
  
              if ($childrens !== null) {
                  $temp = '';
                  foreach ($childrens as $children) {
                      $temp .= $children->saveXML();
                  }
                  $html = html_entity_decode($temp);
              }
          }
  
          if ($this->hasHtml) {
              $html = $this->htmlMatches['before'].$html.$this->htmlMatches['after'];
          }
          if ($this->hasDoctype) {
              $html = $this->doctypeMatches['content'].$html;
          }
  
          return $html;
      }
code: protected function cleaningHtml($html)
      {
          $xml = false;
          $childrens = null;
  
          try {
              $xml = @simplexml_load_string($html);
          } catch (\Exception $e) {
              // ignore
          }
  
          if ($xml !== false) {
              if (!$this->hasHead && $xml->getName() === 'head') {
                  $childrens = $xml->xpath('//head/child::*');
              }
              if (!$this->hasBody && $xml->getName() === 'body') {
                  $childrens = $xml->xpath('//body/child::*');
              }
  
              if ($childrens !== null) {
                  $temp = '';
                  foreach ($childrens as $children) {
                      $temp .= $children->saveXML();
                  }
                  $html = html_entity_decode($temp);
              }
          }
  
          if ($this->hasHtml) {
              $html = $this->htmlMatches['before'].$html.$this->htmlMatches['after'];
          }
          if ($this->hasDoctype) {
              $html = $this->doctypeMatches['content'].$html;
          }
  
          return $html;
      }
code_tokens: protected function cleaningHtml ( $ html ) { $ xml = false ; $ childrens = null ; try { $ xml = @ simplexml_load_string ( $ html ) ; } catch ( \ Exception $ e ) { // ignore } if ( $ xml !== false ) { if ( ! $ this -> hasHead && $ xml -> getName ( ) === 'head' ) { $ childrens = $ xml -> xpath ( '//head/child::*' ) ; } if ( ! $ this -> hasBody && $ xml -> getName ( ) === 'body' ) { $ childrens = $ xml -> xpath ( '//body/child::*' ) ; } if ( $ childrens !== null ) { $ temp = '' ; foreach ( $ childrens as $ children ) { $ temp .= $ children -> saveXML ( ) ; } $ html = html_entity_decode ( $ temp ) ; } } if ( $ this -> hasHtml ) { $ html = $ this -> htmlMatches [ 'before' ] . $ html . $ this -> htmlMatches [ 'after' ] ; } if ( $ this -> hasDoctype ) { $ html = $ this -> doctypeMatches [ 'content' ] . $ html ; } return $ html ; }
docstring: Cleaning HTML from parts it should not contains
  
  @param string $html
  
  @return string
docstring_tokens: Cleaning HTML from parts it should not contains