mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
Update to laravel 7
This commit is contained in:
120
vendor/symfony/var-dumper/Caster/DOMCaster.php
vendored
120
vendor/symfony/var-dumper/Caster/DOMCaster.php
vendored
@@ -17,61 +17,63 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
* Casts DOM related classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DOMCaster
|
||||
{
|
||||
private static $errorCodes = [
|
||||
DOM_PHP_ERR => 'DOM_PHP_ERR',
|
||||
DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR',
|
||||
DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR',
|
||||
DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR',
|
||||
DOM_WRONG_DOCUMENT_ERR => 'DOM_WRONG_DOCUMENT_ERR',
|
||||
DOM_INVALID_CHARACTER_ERR => 'DOM_INVALID_CHARACTER_ERR',
|
||||
DOM_NO_DATA_ALLOWED_ERR => 'DOM_NO_DATA_ALLOWED_ERR',
|
||||
DOM_NO_MODIFICATION_ALLOWED_ERR => 'DOM_NO_MODIFICATION_ALLOWED_ERR',
|
||||
DOM_NOT_FOUND_ERR => 'DOM_NOT_FOUND_ERR',
|
||||
DOM_NOT_SUPPORTED_ERR => 'DOM_NOT_SUPPORTED_ERR',
|
||||
DOM_INUSE_ATTRIBUTE_ERR => 'DOM_INUSE_ATTRIBUTE_ERR',
|
||||
DOM_INVALID_STATE_ERR => 'DOM_INVALID_STATE_ERR',
|
||||
DOM_SYNTAX_ERR => 'DOM_SYNTAX_ERR',
|
||||
DOM_INVALID_MODIFICATION_ERR => 'DOM_INVALID_MODIFICATION_ERR',
|
||||
DOM_NAMESPACE_ERR => 'DOM_NAMESPACE_ERR',
|
||||
DOM_INVALID_ACCESS_ERR => 'DOM_INVALID_ACCESS_ERR',
|
||||
DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR',
|
||||
private const ERROR_CODES = [
|
||||
\DOM_PHP_ERR => 'DOM_PHP_ERR',
|
||||
\DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR',
|
||||
\DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR',
|
||||
\DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR',
|
||||
\DOM_WRONG_DOCUMENT_ERR => 'DOM_WRONG_DOCUMENT_ERR',
|
||||
\DOM_INVALID_CHARACTER_ERR => 'DOM_INVALID_CHARACTER_ERR',
|
||||
\DOM_NO_DATA_ALLOWED_ERR => 'DOM_NO_DATA_ALLOWED_ERR',
|
||||
\DOM_NO_MODIFICATION_ALLOWED_ERR => 'DOM_NO_MODIFICATION_ALLOWED_ERR',
|
||||
\DOM_NOT_FOUND_ERR => 'DOM_NOT_FOUND_ERR',
|
||||
\DOM_NOT_SUPPORTED_ERR => 'DOM_NOT_SUPPORTED_ERR',
|
||||
\DOM_INUSE_ATTRIBUTE_ERR => 'DOM_INUSE_ATTRIBUTE_ERR',
|
||||
\DOM_INVALID_STATE_ERR => 'DOM_INVALID_STATE_ERR',
|
||||
\DOM_SYNTAX_ERR => 'DOM_SYNTAX_ERR',
|
||||
\DOM_INVALID_MODIFICATION_ERR => 'DOM_INVALID_MODIFICATION_ERR',
|
||||
\DOM_NAMESPACE_ERR => 'DOM_NAMESPACE_ERR',
|
||||
\DOM_INVALID_ACCESS_ERR => 'DOM_INVALID_ACCESS_ERR',
|
||||
\DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR',
|
||||
];
|
||||
|
||||
private static $nodeTypes = [
|
||||
XML_ELEMENT_NODE => 'XML_ELEMENT_NODE',
|
||||
XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE',
|
||||
XML_TEXT_NODE => 'XML_TEXT_NODE',
|
||||
XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE',
|
||||
XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE',
|
||||
XML_ENTITY_NODE => 'XML_ENTITY_NODE',
|
||||
XML_PI_NODE => 'XML_PI_NODE',
|
||||
XML_COMMENT_NODE => 'XML_COMMENT_NODE',
|
||||
XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE',
|
||||
XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE',
|
||||
XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE',
|
||||
XML_NOTATION_NODE => 'XML_NOTATION_NODE',
|
||||
XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE',
|
||||
XML_DTD_NODE => 'XML_DTD_NODE',
|
||||
XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE',
|
||||
XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE',
|
||||
XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE',
|
||||
XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
|
||||
private const NODE_TYPES = [
|
||||
\XML_ELEMENT_NODE => 'XML_ELEMENT_NODE',
|
||||
\XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE',
|
||||
\XML_TEXT_NODE => 'XML_TEXT_NODE',
|
||||
\XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE',
|
||||
\XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE',
|
||||
\XML_ENTITY_NODE => 'XML_ENTITY_NODE',
|
||||
\XML_PI_NODE => 'XML_PI_NODE',
|
||||
\XML_COMMENT_NODE => 'XML_COMMENT_NODE',
|
||||
\XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE',
|
||||
\XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE',
|
||||
\XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE',
|
||||
\XML_NOTATION_NODE => 'XML_NOTATION_NODE',
|
||||
\XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE',
|
||||
\XML_DTD_NODE => 'XML_DTD_NODE',
|
||||
\XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE',
|
||||
\XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE',
|
||||
\XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE',
|
||||
\XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
|
||||
];
|
||||
|
||||
public static function castException(\DOMException $e, array $a, Stub $stub, $isNested)
|
||||
public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$k = Caster::PREFIX_PROTECTED.'code';
|
||||
if (isset($a[$k], self::$errorCodes[$a[$k]])) {
|
||||
$a[$k] = new ConstStub(self::$errorCodes[$a[$k]], $a[$k]);
|
||||
if (isset($a[$k], self::ERROR_CODES[$a[$k]])) {
|
||||
$a[$k] = new ConstStub(self::ERROR_CODES[$a[$k]], $a[$k]);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castLength($dom, array $a, Stub $stub, $isNested)
|
||||
public static function castLength($dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'length' => $dom->length,
|
||||
@@ -80,7 +82,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castImplementation($dom, array $a, Stub $stub, $isNested)
|
||||
public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'Core' => '1.0',
|
||||
@@ -90,12 +92,12 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castNode(\DOMNode $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'nodeName' => $dom->nodeName,
|
||||
'nodeValue' => new CutStub($dom->nodeValue),
|
||||
'nodeType' => new ConstStub(self::$nodeTypes[$dom->nodeType], $dom->nodeType),
|
||||
'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType),
|
||||
'parentNode' => new CutStub($dom->parentNode),
|
||||
'childNodes' => $dom->childNodes,
|
||||
'firstChild' => new CutStub($dom->firstChild),
|
||||
@@ -114,12 +116,12 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'nodeName' => $dom->nodeName,
|
||||
'nodeValue' => new CutStub($dom->nodeValue),
|
||||
'nodeType' => new ConstStub(self::$nodeTypes[$dom->nodeType], $dom->nodeType),
|
||||
'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType),
|
||||
'prefix' => $dom->prefix,
|
||||
'localName' => $dom->localName,
|
||||
'namespaceURI' => $dom->namespaceURI,
|
||||
@@ -130,7 +132,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, $isNested, $filter = 0)
|
||||
public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$a += [
|
||||
'doctype' => $dom->doctype,
|
||||
@@ -164,7 +166,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'data' => $dom->data,
|
||||
@@ -174,7 +176,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'name' => $dom->name,
|
||||
@@ -187,7 +189,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castElement(\DOMElement $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'tagName' => $dom->tagName,
|
||||
@@ -197,7 +199,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castText(\DOMText $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'wholeText' => $dom->wholeText,
|
||||
@@ -206,7 +208,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'typeName' => $dom->typeName,
|
||||
@@ -216,7 +218,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'severity' => $dom->severity,
|
||||
@@ -230,7 +232,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'lineNumber' => $dom->lineNumber,
|
||||
@@ -243,7 +245,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'name' => $dom->name,
|
||||
@@ -257,7 +259,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'publicId' => $dom->publicId,
|
||||
@@ -267,7 +269,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'publicId' => $dom->publicId,
|
||||
@@ -281,7 +283,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'target' => $dom->target,
|
||||
@@ -291,7 +293,7 @@ class DOMCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, $isNested)
|
||||
public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'document' => $dom->document,
|
||||
|
||||
Reference in New Issue
Block a user