Skip to content

Commit

Permalink
adapt namespace changes for new DOM extension classes
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed May 15, 2024
1 parent a797985 commit 7e25a46
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
30 changes: 15 additions & 15 deletions src/Symfony/Component/VarDumper/Caster/DOMCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class DOMCaster
\XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
];

public static function castException(\DOMException|\DOM\Exception $e, array $a, Stub $stub, bool $isNested): array
public static function castException(\DOMException|\Dom\Exception $e, array $a, Stub $stub, bool $isNested): array

Check failure on line 66 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:66:42: UndefinedClass: Class, interface or enum named Dom\Exception does not exist (see https://psalm.dev/019)
{
$k = Caster::PREFIX_PROTECTED.'code';
if (isset($a[$k], self::ERROR_CODES[$a[$k]])) {
Expand All @@ -82,7 +82,7 @@ public static function castLength($dom, array $a, Stub $stub, bool $isNested): a
return $a;
}

public static function castImplementation(\DOMImplementation|\DOM\Implementation $dom, array $a, Stub $stub, bool $isNested): array
public static function castImplementation(\DOMImplementation|\Dom\Implementation $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 85 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:85:47: UndefinedClass: Class, interface or enum named Dom\Implementation does not exist (see https://psalm.dev/019)
{
$a += [
Caster::PREFIX_VIRTUAL.'Core' => '1.0',
Expand All @@ -92,7 +92,7 @@ public static function castImplementation(\DOMImplementation|\DOM\Implementation
return $a;
}

public static function castNode(\DOMNode|\DOM\Node $dom, array $a, Stub $stub, bool $isNested): array
public static function castNode(\DOMNode|\Dom\Node $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 95 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:95:37: UndefinedClass: Class, interface or enum named Dom\Node does not exist (see https://psalm.dev/019)
{
$a += [
'nodeName' => $dom->nodeName,
Expand All @@ -109,7 +109,7 @@ public static function castNode(\DOMNode|\DOM\Node $dom, array $a, Stub $stub, b
'textContent' => new CutStub($dom->textContent),
];

if ($dom instanceof \DOMNode || $dom instanceof \DOM\Element) {
if ($dom instanceof \DOMNode || $dom instanceof \Dom\Element) {
$a += [
'attributes' => $dom->attributes,
'namespaceURI' => $dom->namespaceURI,
Expand Down Expand Up @@ -171,7 +171,7 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo
return $a;
}

public static function castXMLDocument(\DOM\XMLDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0): array
public static function castXMLDocument(\Dom\XMLDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0): array

Check failure on line 174 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:174:44: UndefinedClass: Class, interface or enum named Dom\XMLDocument does not exist (see https://psalm.dev/019)
{
$a += [
'doctype' => $dom->doctype,
Expand All @@ -195,7 +195,7 @@ public static function castXMLDocument(\DOM\XMLDocument $dom, array $a, Stub $st
return $a;
}

public static function castHTMLDocument(\DOM\HTMLDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0): array
public static function castHTMLDocument(\Dom\HTMLDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0): array

Check failure on line 198 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:198:45: UndefinedClass: Class, interface or enum named Dom\HTMLDocument does not exist (see https://psalm.dev/019)
{
$a += [
'doctype' => $dom->doctype,
Expand All @@ -212,7 +212,7 @@ public static function castHTMLDocument(\DOM\HTMLDocument $dom, array $a, Stub $
return $a;
}

public static function castCharacterData(\DOMCharacterData|\DOM\CharacterData $dom, array $a, Stub $stub, bool $isNested): array
public static function castCharacterData(\DOMCharacterData|\Dom\CharacterData $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 215 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:215:46: UndefinedClass: Class, interface or enum named Dom\CharacterData does not exist (see https://psalm.dev/019)
{
$a += [
'data' => $dom->data,
Expand All @@ -222,7 +222,7 @@ public static function castCharacterData(\DOMCharacterData|\DOM\CharacterData $d
return $a;
}

public static function castAttr(\DOMAttr|\DOM\Attr $dom, array $a, Stub $stub, bool $isNested): array
public static function castAttr(\DOMAttr|\Dom\Attr $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 225 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:225:37: UndefinedClass: Class, interface or enum named Dom\Attr does not exist (see https://psalm.dev/019)
{
$a += [
'name' => $dom->name,
Expand All @@ -240,7 +240,7 @@ public static function castAttr(\DOMAttr|\DOM\Attr $dom, array $a, Stub $stub, b
return $a;
}

public static function castElement(\DOMElement|\DOM\Element $dom, array $a, Stub $stub, bool $isNested): array
public static function castElement(\DOMElement|\Dom\Element $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 243 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:243:40: UndefinedClass: Class, interface or enum named Dom\Element does not exist (see https://psalm.dev/019)
{
$a += [
'tagName' => $dom->tagName,
Expand All @@ -255,7 +255,7 @@ public static function castElement(\DOMElement|\DOM\Element $dom, array $a, Stub
return $a;
}

public static function castText(\DOMText|\DOM\Text $dom, array $a, Stub $stub, bool $isNested): array
public static function castText(\DOMText|\Dom\Text $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 258 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:258:37: UndefinedClass: Class, interface or enum named Dom\Text does not exist (see https://psalm.dev/019)
{
$a += [
'wholeText' => $dom->wholeText,
Expand All @@ -264,7 +264,7 @@ public static function castText(\DOMText|\DOM\Text $dom, array $a, Stub $stub, b
return $a;
}

public static function castDocumentType(\DOMDocumentType|\DOM\DocumentType $dom, array $a, Stub $stub, bool $isNested): array
public static function castDocumentType(\DOMDocumentType|\Dom\DocumentType $dom, array $a, Stub $stub, bool $isNested): array

Check failure on line 267 in src/Symfony/Component/VarDumper/Caster/DOMCaster.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Component/VarDumper/Caster/DOMCaster.php:267:45: UndefinedClass: Class, interface or enum named Dom\DocumentType does not exist (see https://psalm.dev/019)
{
$a += [
'name' => $dom->name,
Expand All @@ -278,7 +278,7 @@ public static function castDocumentType(\DOMDocumentType|\DOM\DocumentType $dom,
return $a;
}

public static function castNotation(\DOMNotation|\DOM\Notation $dom, array $a, Stub $stub, bool $isNested): array
public static function castNotation(\DOMNotation|\Dom\Notation $dom, array $a, Stub $stub, bool $isNested): array
{
$a += [
'publicId' => $dom->publicId,
Expand All @@ -288,7 +288,7 @@ public static function castNotation(\DOMNotation|\DOM\Notation $dom, array $a, S
return $a;
}

public static function castEntity(\DOMEntity|\DOM\Entity $dom, array $a, Stub $stub, bool $isNested): array
public static function castEntity(\DOMEntity|\Dom\Entity $dom, array $a, Stub $stub, bool $isNested): array
{
$a += [
'publicId' => $dom->publicId,
Expand All @@ -302,7 +302,7 @@ public static function castEntity(\DOMEntity|\DOM\Entity $dom, array $a, Stub $s
return $a;
}

public static function castProcessingInstruction(\DOMProcessingInstruction|\DOM\ProcessingInstruction $dom, array $a, Stub $stub, bool $isNested): array
public static function castProcessingInstruction(\DOMProcessingInstruction|\Dom\ProcessingInstruction $dom, array $a, Stub $stub, bool $isNested): array
{
$a += [
'target' => $dom->target,
Expand All @@ -312,7 +312,7 @@ public static function castProcessingInstruction(\DOMProcessingInstruction|\DOM\
return $a;
}

public static function castXPath(\DOMXPath|\DOM\XPath $dom, array $a, Stub $stub, bool $isNested): array
public static function castXPath(\DOMXPath|\Dom\XPath $dom, array $a, Stub $stub, bool $isNested): array
{
$a += [
'document' => $dom->document,
Expand Down
30 changes: 15 additions & 15 deletions src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@ abstract class AbstractCloner implements ClonerInterface
'Doctrine\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],

'DOMException' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castException'],
'DOM\Exception' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castException'],
'Dom\Exception' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castException'],
'DOMStringList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOMNameList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOMImplementation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castImplementation'],
'DOM\Implementation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castImplementation'],
'Dom\Implementation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castImplementation'],
'DOMImplementationList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOMNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNode'],
'DOM\Node' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNode'],
'Dom\Node' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNode'],
'DOMNameSpaceNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNameSpaceNode'],
'DOMDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocument'],
'DOM\XMLDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXMLDocument'],
'DOM\HTMLDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castHTMLDocument'],
'Dom\XMLDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXMLDocument'],
'Dom\HTMLDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castHTMLDocument'],
'DOMNodeList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOM\NodeList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'Dom\NodeList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOMNamedNodeMap' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOM\DTDNamedNodeMap' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'Dom\DTDNamedNodeMap' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
'DOMCharacterData' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castCharacterData'],
'DOM\CharacterData' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castCharacterData'],
'Dom\CharacterData' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castCharacterData'],
'DOMAttr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
'DOM\Attr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
'Dom\Attr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
'DOMElement' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
'DOM\Element' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
'Dom\Element' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
'DOMText' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
'DOM\Text' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
'Dom\Text' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
'DOMDocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
'DOM\DocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
'Dom\DocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
'DOMNotation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
'DOM\Notation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
'Dom\Notation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
'DOMEntity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
'DOM\Entity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
'Dom\Entity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
'DOMProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'],
'DOM\ProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'],
'Dom\ProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'],
'DOMXPath' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXPath'],

'XMLReader' => ['Symfony\Component\VarDumper\Caster\XmlReaderCaster', 'castXmlReader'],
Expand Down
50 changes: 25 additions & 25 deletions src/Symfony/Component/VarDumper/Tests/Caster/DOMCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public function testCastImplementation()
*/
public function testCastModernImplementation()
{
$implementation = new \DOM\Implementation();
$implementation = new \Dom\Implementation();

$this->assertDumpEquals(<<<'EODUMP'
DOM\Implementation {
Dom\Implementation {
Core: "1.0"
XML: "2.0"
}
Expand Down Expand Up @@ -72,14 +72,14 @@ public function testCastNode()
*/
public function testCastModernNode()
{
$doc = \DOM\XMLDocument::createFromString('<foo><bar/></foo>');
$doc = \Dom\XMLDocument::createFromString('<foo><bar/></foo>');
$node = $doc->documentElement->firstChild;

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\Element {%A
Dom\Element {%A
+baseURI: ? string
+isConnected: ? bool
+ownerDocument: ? ?DOM\Document
+ownerDocument: ? ?Dom\Document
%A}
EODUMP,
$node
Expand Down Expand Up @@ -110,10 +110,10 @@ public function testCastDocument()
*/
public function testCastXMLDocument()
{
$doc = \DOM\XMLDocument::createFromString('<foo><bar/></foo>');
$doc = \Dom\XMLDocument::createFromString('<foo><bar/></foo>');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\XMLDocument {%A
Dom\XMLDocument {%A
xml: """
<?xml version="1.0" encoding="UTF-8"?>\n
<foo>\n
Expand All @@ -131,10 +131,10 @@ public function testCastXMLDocument()
*/
public function testCastHTMLDocument()
{
$doc = \DOM\HTMLDocument::createFromString('<!DOCTYPE html><html><body><p>foo</p></body></html>');
$doc = \Dom\HTMLDocument::createFromString('<!DOCTYPE html><html><body><p>foo</p></body></html>');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\HTMLDocument {%A
Dom\HTMLDocument {%A
html: "<!DOCTYPE html><html><head></head><body><p>foo</p></body></html>"
}
EODUMP,
Expand All @@ -160,9 +160,9 @@ public function testCastText()
*/
public function testCastModernText()
{
$text = \DOM\HTMLDocument::createEmpty()->createTextNode('foo');
$text = \Dom\HTMLDocument::createEmpty()->createTextNode('foo');
$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\Text {%A
Dom\Text {%A
+wholeText: ? string
}
EODUMP,
Expand Down Expand Up @@ -192,13 +192,13 @@ public function testCastAttr()
*/
public function testCastModernAttr()
{
$attr = \DOM\HTMLDocument::createEmpty()->createAttribute('attr');
$attr = \Dom\HTMLDocument::createEmpty()->createAttribute('attr');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\Attr {%A
Dom\Attr {%A
+name: ? string
+value: ? string
+ownerElement: ? ?DOM\Element
+ownerElement: ? ?Dom\Element
+specified: true
}
EODUMP,
Expand All @@ -224,10 +224,10 @@ public function testCastElement()
*/
public function testCastModernElement()
{
$attr = \DOM\HTMLDocument::createEmpty()->createElement('foo');
$attr = \Dom\HTMLDocument::createEmpty()->createElement('foo');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\Element {%A
Dom\Element {%A
+tagName: ? string
%A}
EODUMP,
Expand Down Expand Up @@ -259,14 +259,14 @@ public function testCastDocumentType()
*/
public function testCastModernDocumentType()
{
$implementation = new \DOM\Implementation();
$implementation = new \Dom\Implementation();
$type = $implementation->createDocumentType('html', 'publicId', 'systemId');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\DocumentType {%A
Dom\DocumentType {%A
+name: ? string
+entities: ? DOM\DTDNamedNodeMap
+notations: ? DOM\DTDNamedNodeMap
+entities: ? Dom\DtdNamedNodeMap
+notations: ? Dom\DtdNamedNodeMap
+publicId: ? string
+systemId: ? string
+internalSubset: ? ?string
Expand Down Expand Up @@ -295,10 +295,10 @@ public function testCastProcessingInstruction()
*/
public function testCastModernProcessingInstruction()
{
$entity = \DOM\HTMLDocument::createEmpty()->createProcessingInstruction('target', 'data');
$entity = \Dom\HTMLDocument::createEmpty()->createProcessingInstruction('target', 'data');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOM\ProcessingInstruction {%A
Dom\ProcessingInstruction {%A
+data: ? string
+length: ? int
+target: ? string
Expand Down Expand Up @@ -327,11 +327,11 @@ public function testCastXPath()
*/
public function testCastModernXPath()
{
$entity = new \DOM\XPath(\DOM\HTMLDocument::createEmpty());
$entity = new \Dom\XPath(\Dom\HTMLDocument::createEmpty());

$this->assertDumpEquals(<<<'EODUMP'
DOM\XPath {
+document: ? DOM\Document
Dom\XPath {
+document: ? Dom\Document
+registerNodeNamespaces: ? bool
}
EODUMP,
Expand Down

0 comments on commit 7e25a46

Please sign in to comment.