Skip to content

Commit

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

Related to: php/php-src#12340

Co-authored-by: Konrad Abicht <[email protected]>
  • Loading branch information
Girgias and k00ni authored Oct 20, 2023
1 parent 54886d4 commit 3e08bc2
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 3e08bc2

Please sign in to comment.