Make WordPress Core


Ignore:
Timestamp:
07/01/2019 08:00:12 AM (5 years ago)
Author:
pento
Message:

Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.

See #47632

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/utils.php

    r43653 r45580  
    183183// convert valid xml to an array tree structure
    184184// kinda lame but it works with a default php 4 installation
    185 class testXMLParser {
     185class TestXMLParser {
    186186    var $xml;
    187187    var $data = array();
     
    194194        xml_set_object( $this->xml, $this );
    195195        xml_parser_set_option( $this->xml, XML_OPTION_CASE_FOLDING, 0 );
    196         xml_set_element_handler( $this->xml, array( $this, 'startHandler' ), array( $this, 'endHandler' ) );
    197         xml_set_character_data_handler( $this->xml, array( $this, 'dataHandler' ) );
     196        xml_set_element_handler( $this->xml, array( $this, 'start_handler' ), array( $this, 'end_handler' ) );
     197        xml_set_character_data_handler( $this->xml, array( $this, 'data_handler' ) );
    198198        $this->parse( $in );
    199199    }
     
    215215    }
    216216
    217     function startHandler( $parser, $name, $attributes ) {
     217    function start_handler( $parser, $name, $attributes ) {
    218218        $data['name'] = $name;
    219219        if ( $attributes ) {
     
    222222    }
    223223
    224     function dataHandler( $parser, $data ) {
     224    function data_handler( $parser, $data ) {
    225225        $index                             = count( $this->data ) - 1;
    226226        @$this->data[ $index ]['content'] .= $data;
    227227    }
    228228
    229     function endHandler( $parser, $name ) {
     229    function end_handler( $parser, $name ) {
    230230        if ( count( $this->data ) > 1 ) {
    231231            $data                            = array_pop( $this->data );
     
    237237
    238238function xml_to_array( $in ) {
    239     $p = new testXMLParser( $in );
     239    $p = new TestXMLParser( $in );
    240240    return $p->data;
    241241}
Note: See TracChangeset for help on using the changeset viewer.