Skip to content

Commit

Permalink
refector: Drop usage of xml_set_object()
Browse files Browse the repository at this point in the history
Use proper callables instead.

Related to: php/php-src#12340
  • Loading branch information
Girgias authored Oct 7, 2023
1 parent 8ac880c commit e079f0d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
7 changes: 3 additions & 4 deletions parsers/ARC2_AtomParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,9 @@ public function initXMLParser()
$parser = xml_parser_create($enc);
xml_parser_set_option($parser, \XML_OPTION_SKIP_WHITE, 0);
xml_parser_set_option($parser, \XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($parser, 'open', 'close');
xml_set_character_data_handler($parser, 'cData');
xml_set_start_namespace_decl_handler($parser, 'nsDecl');
xml_set_object($parser, $this);
xml_set_element_handler($parser, [$this, 'open'], [$this, 'close']);
xml_set_character_data_handler($parser, [$this, 'cData']);
xml_set_start_namespace_decl_handler($parser, [$this, 'nsDecl']);
$this->xml_parser = $parser;
}
}
Expand Down
7 changes: 3 additions & 4 deletions parsers/ARC2_LegacyXMLParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,9 @@ public function initXMLParser()
$parser = xml_parser_create_ns($enc, '');
xml_parser_set_option($parser, \XML_OPTION_SKIP_WHITE, 0);
xml_parser_set_option($parser, \XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($parser, 'open', 'close');
xml_set_character_data_handler($parser, 'cData');
xml_set_start_namespace_decl_handler($parser, 'nsDecl');
xml_set_object($parser, $this);
xml_set_element_handler($parser, [$this, 'open'], [$this, 'close']);
xml_set_character_data_handler($parser, [$this, 'cData']);
xml_set_start_namespace_decl_handler($parser, [$this, 'nsDecl']);
$this->xml_parser = $parser;
}
}
Expand Down
7 changes: 3 additions & 4 deletions parsers/ARC2_RDFXMLParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ public function initXMLParser()
$parser = xml_parser_create_ns($enc, '');
xml_parser_set_option($parser, \XML_OPTION_SKIP_WHITE, 0);
xml_parser_set_option($parser, \XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($parser, 'open', 'close');
xml_set_character_data_handler($parser, 'cdata');
xml_set_start_namespace_decl_handler($parser, 'nsDecl');
xml_set_object($parser, $this);
xml_set_element_handler($parser, [$this, 'open'], [$this, 'close']);
xml_set_character_data_handler($parser, [$this, 'cData']);
xml_set_start_namespace_decl_handler($parser, [$this, 'nsDecl']);
$this->xml_parser = $parser;
}
}
Expand Down
7 changes: 3 additions & 4 deletions parsers/ARC2_SPOGParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ public function initXMLParser()
$parser = xml_parser_create($enc);
xml_parser_set_option($parser, \XML_OPTION_SKIP_WHITE, 0);
xml_parser_set_option($parser, \XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($parser, 'open', 'close');
xml_set_character_data_handler($parser, 'cdata');
xml_set_start_namespace_decl_handler($parser, 'nsDecl');
xml_set_object($parser, $this);
xml_set_element_handler($parser, [$this, 'open'], [$this, 'close']);
xml_set_character_data_handler($parser, [$this, 'cdata']);
xml_set_start_namespace_decl_handler($parser, [$this, 'nsDecl']);
$this->xml_parser = $parser;
}
}
Expand Down

0 comments on commit e079f0d

Please sign in to comment.