Skip to content

Commit

Permalink
use correct case for DOM classes
Browse files Browse the repository at this point in the history
Summary: DOMDocument, DOMXPath, DOMCdataSection

Reviewed By: oulgen

Differential Revision: D37850407

fbshipit-source-id: ad45fc6e6554c3c42107dc7bf082d4cbc1a0cad3
  • Loading branch information
edwinsmith authored and facebook-github-bot committed Jul 14, 2022
1 parent 239493e commit 999edc2
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions hphp/test/slow/dom_document/dom_namespace_node.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function main_dom_namespace_node() {
<media:category label="Music" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Music</media:category>
</entry>';

$doc = new \DomDocument('1.0', 'UTF-8');
$doc = new \DOMDocument('1.0', 'UTF-8');
$doc->loadXML($xml);

$dxp = new \DomXPath($doc);
$dxp = new \DOMXPath($doc);
$query='(//namespace::*[name()="yt"])[last()]';
$out = $dxp->query($query);

Expand Down
2 changes: 1 addition & 1 deletion hphp/test/slow/dom_document/native_magic_props_dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function main_native_magic_props_dom() {

// XPath

$xpath = new DOMXpath($doc);
$xpath = new DOMXPath($doc);
var_dump($xpath->document->doctype->name);
$elements = $xpath->query("//*[@id]");
var_dump($elements->length);
Expand Down
4 changes: 2 additions & 2 deletions hphp/test/slow/ext_domdocument/t86280534.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ function test14() {

function test15() {
$doc = new DOMDocument();
$xpath = new DOMXpath($doc);
$xpath = new DOMXPath($doc);
$xpath->evaluate("abc", new stdClass);
}

function test16() {
$doc = new DOMDocument();
$xpath = new DOMXpath($doc);
$xpath = new DOMXPath($doc);
$xpath->query("abc", new stdClass);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh <<__EntryPoint>> function main(): void {
try
{
$section = new DOMCDataSection();
$section = new DOMCdataSection();

}
catch (Exception $e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?hh
<<__EntryPoint>> function main(): void {
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
$comment->appendData('-more-data');
$dom->appendChild($comment);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh
<<__EntryPoint>> function main(): void {
//correct offset
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
$comment->insertData(4,'-inserted');
$dom->appendChild($comment);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh
<<__EntryPoint>> function main(): void {
//Negative offset
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
try {
$comment->insertData(-1,'-inserted');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh
<<__EntryPoint>> function main(): void {
//offset to large
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
try {
$comment->insertData(999,'-inserted');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?hh
<<__EntryPoint>> function main(): void {
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
$comment->replaceData(4,1,'replaced');
$dom->appendChild($comment);
echo $dom->saveXML();

// Replaces rest of string if count is greater than length of existing string
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
$comment->replaceData(0,50,'replaced');
$dom->appendChild($comment);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh
<<__EntryPoint>> function main(): void {
//Negative offset
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
try {
$comment->replaceData(-1,4,'-inserted');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh
<<__EntryPoint>> function main(): void {
//offset to large
$dom = new DomDocument();
$dom = new DOMDocument();
$comment = $dom->createComment('test-comment');
try {
$comment->replaceData(999,4,'-inserted');
Expand Down
2 changes: 1 addition & 1 deletion hphp/test/zend/good/ext/dom/tests/bug32615.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?hh <<__EntryPoint>> function main(): void {
$dom = new DomDocument;
$dom = new DOMDocument;
$frag = $dom->createDocumentFragment();
$frag->appendChild(new DOMElement('root'));
$dom->appendChild($frag);
Expand Down
4 changes: 2 additions & 2 deletions hphp/test/zend/good/ext/dom/tests/bug37277.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?hh <<__EntryPoint>> function main(): void {
$dom1 = new DomDocument('1.0', 'UTF-8');
$dom1 = new DOMDocument('1.0', 'UTF-8');

$xml = '<foo />';
$dom1->loadXML($xml);

$node = clone $dom1->documentElement;

$dom2 = new DomDocument('1.0', 'UTF-8');
$dom2 = new DOMDocument('1.0', 'UTF-8');
$dom2->appendChild($dom2->importNode($node->cloneNode(true), TRUE));

print $dom2->saveXML();
Expand Down
2 changes: 1 addition & 1 deletion hphp/test/zend/good/ext/dom/tests/bug38474.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$xml = '<node xmlns:pre="http://foo.com/tr/pre"
xmlns:post="http://foo.com/tr/post"
pre:type="bar" type="foo" ><sub /></node>';
$dom = new DomDocument();
$dom = new DOMDocument();
$dom->loadXML($xml);
echo $dom->firstChild->getAttribute('type')."\n";
echo $dom->firstChild->getAttribute('pre:type')."\n";
Expand Down
2 changes: 1 addition & 1 deletion hphp/test/zend/good/ext/dom/tests/bug43364.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function loopElements($nodes)
</root>
DOC;

$doc = new DomDocument();
$doc = new DOMDocument();
$doc->loadXML($xml);
$doc->xinclude();

Expand Down
2 changes: 1 addition & 1 deletion hphp/test/zend/good/ext/dom/tests/bug69373.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$doc = new DOMDocument();
for( $i=0; $i<10; $i++ ) {
$doc->loadXML("<parent><child /><child /></parent>");
$xpath = new DOMXpath($doc);
$xpath = new DOMXPath($doc);
$all = $xpath->query('//*');
if ($i % 2) {
$doc->firstChild->nodeValue = 'text';
Expand Down
4 changes: 2 additions & 2 deletions hphp/test/zend/good/ext/dom/tests/domchardata.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function main_entry(): void {
echo "New Comment Length: ".$comment->length."\n";
echo "New Comment Data: ".$comment->data."\n";

/* DOMCDataSection */
$cdata = new DOMCDataSection('Chars: <>&"');
/* DOMCdataSection */
$cdata = new DOMCdataSection('Chars: <>&"');
$charnode->appendChild($cdata);

echo "Substring: ".$cdata->substringData(7, 4)."\n";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh
<<__EntryPoint>>
function main() {
$x = new DomDocument();
$x = new DOMDocument();
try { $x->createComment(); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
echo "===DONE===\n";
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?hh
<<__EntryPoint>> function main(): void {
$objDoc = new DomDocument();
$objDoc = new DOMDocument();

$objRef = $objDoc->createEntityReference('Test');
echo $objRef->nodeName . "\n";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?hh
<<__EntryPoint>> function main(): void {
$objDoc = new DomDocument();
$objDoc = new DOMDocument();

try { $objRef = $objDoc->createEntityReference(); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
echo "===DONE===\n";
Expand Down
4 changes: 2 additions & 2 deletions hphp/test/zend/good/ext/xsl/tests/bug33853.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?hh

<<__EntryPoint>> function main(): void {
$xsl = new DomDocument();
$xsl = new DOMDocument();
$xsl->loadXML('<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Expand All @@ -10,7 +10,7 @@
<xsl:value-of select="php:function(\'TeSt::dateLang\')" />
</xsl:template>
</xsl:stylesheet>');
$inputdom = new DomDocument();
$inputdom = new DOMDocument();
$inputdom->loadXML('<?xml version="1.0" encoding="iso-8859-1" ?>
<today></today>');

Expand Down
2 changes: 1 addition & 1 deletion hphp/test/zend/good/ext/xsl/tests/xslt010.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$proc = new XSLTProcessor;
$xsl = $proc->importStylesheet($dom);

$xml = new DomDocument();
$xml = new DOMDocument();
$xml->load(dirname(__FILE__)."/exslt.xml");

print $proc->transformToXML($xml);
Expand Down
2 changes: 1 addition & 1 deletion hphp/test/zend/good/ext/xsl/tests/xslt011.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function __toString() { return "not a DomNode object";}
$proc = new XSLTProcessor;
$xsl = $proc->importStylesheet($dom);

$xml = new DomDocument();
$xml = new DOMDocument();
$xml->load(dirname(__FILE__)."/xslt011.xml");
$proc->registerPHPFunctions();
print $proc->transformToXML($xml);
Expand Down

0 comments on commit 999edc2

Please sign in to comment.