original_string: private function parseXmlAttributes(\DOMNode $node, array $context = []): array
      {
          if (!$node->hasAttributes()) {
              return [];
          }
  
          $data = [];
          $typeCastAttributes = (bool) ($context[self::TYPE_CASE_ATTRIBUTES] ?? $this->defaultContext[self::TYPE_CASE_ATTRIBUTES]);
  
          foreach ($node->attributes as $attr) {
              if (!is_numeric($attr->nodeValue) || !$typeCastAttributes) {
                  $data['@'.$attr->nodeName] = $attr->nodeValue;
  
                  continue;
              }
  
              if (false !== $val = filter_var($attr->nodeValue, FILTER_VALIDATE_INT)) {
                  $data['@'.$attr->nodeName] = $val;
  
                  continue;
              }
  
              $data['@'.$attr->nodeName] = (float) $attr->nodeValue;
          }
  
          return $data;
      }
code: private function parseXmlAttributes(\DOMNode $node, array $context = []): array
      {
          if (!$node->hasAttributes()) {
              return [];
          }
  
          $data = [];
          $typeCastAttributes = (bool) ($context[self::TYPE_CASE_ATTRIBUTES] ?? $this->defaultContext[self::TYPE_CASE_ATTRIBUTES]);
  
          foreach ($node->attributes as $attr) {
              if (!is_numeric($attr->nodeValue) || !$typeCastAttributes) {
                  $data['@'.$attr->nodeName] = $attr->nodeValue;
  
                  continue;
              }
  
              if (false !== $val = filter_var($attr->nodeValue, FILTER_VALIDATE_INT)) {
                  $data['@'.$attr->nodeName] = $val;
  
                  continue;
              }
  
              $data['@'.$attr->nodeName] = (float) $attr->nodeValue;
          }
  
          return $data;
      }
code_tokens: private function parseXmlAttributes ( \ DOMNode $ node , array $ context = [ ] ) : array { if ( ! $ node -> hasAttributes ( ) ) { return [ ] ; } $ data = [ ] ; $ typeCastAttributes = ( bool ) ( $ context [ self :: TYPE_CASE_ATTRIBUTES ] ?? $ this -> defaultContext [ self :: TYPE_CASE_ATTRIBUTES ] ) ; foreach ( $ node -> attributes as $ attr ) { if ( ! is_numeric ( $ attr -> nodeValue ) || ! $ typeCastAttributes ) { $ data [ '@' . $ attr -> nodeName ] = $ attr -> nodeValue ; continue ; } if ( false !== $ val = filter_var ( $ attr -> nodeValue , FILTER_VALIDATE_INT ) ) { $ data [ '@' . $ attr -> nodeName ] = $ val ; continue ; } $ data [ '@' . $ attr -> nodeName ] = ( float ) $ attr -> nodeValue ; } return $ data ; }
docstring: Parse the input DOMNode attributes into an array.
docstring_tokens: Parse the input DOMNode attributes into an array .