diff --git a/build/bootstrap.php b/build/bootstrap.php index 579c73a7..3529ce98 100644 --- a/build/bootstrap.php +++ b/build/bootstrap.php @@ -47,16 +47,22 @@ static function (SplFileInfo $file) use ($tab): string { $function = $file->getFilenameWithoutExtension(); $namespace = str_replace('/', '\\', $file->getRelativePath()); - return sprintf($tab.'$functions[\'%s\'] = __DIR__.\'/%s\';', $namespace.'\\'.$function, $path); + return sprintf($tab.$tab.'\'%s\' => __DIR__.\'/%s\',', $namespace.'\\'.$function, $path); } ), - static fn (iterable $codeLines): iterable => concat([ - ' $functions */', - $tab . '$functions = [];', - ], $codeLines), + static fn (iterable $codeLines): iterable => concat( + [ + ' $functions */', + $tab . '$functions = [', + ], + $codeLines, + [ + $tab.'];' + ] + ), static fn (iterable $codeLines): iterable => concat($codeLines, ['', $autoload, '})();', '']), static fn (iterable $codeLines): string => join($codeLines, PHP_EOL) ); diff --git a/docs/reader.md b/docs/reader.md index c002595b..32635e8f 100644 --- a/docs/reader.md +++ b/docs/reader.md @@ -15,8 +15,8 @@ use VeeWee\Xml\Reader\Matcher; $reader = Reader::fromXmlFile('large-data.xml'); $provider = $reader->provide( $matcher = Matcher\all( - Matcher\node_name('item'), - Matcher\node_attribute('locale', 'nl-BE') + Matcher\element_name('item'), + Matcher\attribute_value('locale', 'nl-BE') ), // Optionally, you can provide a signal to stop reading at a given point: $signal = new Signal() @@ -220,8 +220,8 @@ All provided matchers need to match in order for this matcher to succeed: use \VeeWee\Xml\Reader\Matcher; Matcher\all( - Matcher\node_name('item'), - Matcher\node_attribute('locale', 'nl-BE') + Matcher\element_name('item'), + Matcher\attribute_value('locale', 'nl-BE') ); ``` @@ -235,8 +235,8 @@ One of the provided matchers need to match in order for this matcher to succeed: use \VeeWee\Xml\Reader\Matcher; Matcher\any( - Matcher\node_name('item'), - Matcher\node_name('product'), + Matcher\element_name('item'), + Matcher\element_name('product'), ); ``` diff --git a/src/Xml/Reader/Matcher/node_attribute.php b/src/Xml/Reader/Matcher/node_attribute.php deleted file mode 100644 index 8d9062f1..00000000 --- a/src/Xml/Reader/Matcher/node_attribute.php +++ /dev/null @@ -1,24 +0,0 @@ -current()->attributes(), - static fn (AttributeNode $attribute): bool => $attribute->name() === $key && $attribute->value() === $value - ); - }; -} diff --git a/src/Xml/Reader/Matcher/node_name.php b/src/Xml/Reader/Matcher/node_name.php deleted file mode 100644 index 6e68546c..00000000 --- a/src/Xml/Reader/Matcher/node_name.php +++ /dev/null @@ -1,19 +0,0 @@ -current()->name() === $name; - }; -} diff --git a/src/bootstrap.php b/src/bootstrap.php index c2de312b..a6e0898a 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -2,179 +2,178 @@ (static function (): void { /** @var array $functions */ - $functions = []; - $functions['Xml\Dom\Assert\assert_attribute'] = __DIR__.'/Xml/Dom/Assert/assert_attribute.php'; - $functions['Xml\Dom\Assert\assert_cdata'] = __DIR__.'/Xml/Dom/Assert/assert_cdata.php'; - $functions['Xml\Dom\Assert\assert_document'] = __DIR__.'/Xml/Dom/Assert/assert_document.php'; - $functions['Xml\Dom\Assert\assert_dom_node_list'] = __DIR__.'/Xml/Dom/Assert/assert_dom_node_list.php'; - $functions['Xml\Dom\Assert\assert_element'] = __DIR__.'/Xml/Dom/Assert/assert_element.php'; - $functions['Xml\Dom\Builder\attribute'] = __DIR__.'/Xml/Dom/Builder/attribute.php'; - $functions['Xml\Dom\Builder\attributes'] = __DIR__.'/Xml/Dom/Builder/attributes.php'; - $functions['Xml\Dom\Builder\cdata'] = __DIR__.'/Xml/Dom/Builder/cdata.php'; - $functions['Xml\Dom\Builder\children'] = __DIR__.'/Xml/Dom/Builder/children.php'; - $functions['Xml\Dom\Builder\element'] = __DIR__.'/Xml/Dom/Builder/element.php'; - $functions['Xml\Dom\Builder\escaped_value'] = __DIR__.'/Xml/Dom/Builder/escaped_value.php'; - $functions['Xml\Dom\Builder\namespaced_attribute'] = __DIR__.'/Xml/Dom/Builder/namespaced_attribute.php'; - $functions['Xml\Dom\Builder\namespaced_attributes'] = __DIR__.'/Xml/Dom/Builder/namespaced_attributes.php'; - $functions['Xml\Dom\Builder\namespaced_element'] = __DIR__.'/Xml/Dom/Builder/namespaced_element.php'; - $functions['Xml\Dom\Builder\nodes'] = __DIR__.'/Xml/Dom/Builder/nodes.php'; - $functions['Xml\Dom\Builder\value'] = __DIR__.'/Xml/Dom/Builder/value.php'; - $functions['Xml\Dom\Builder\xmlns_attribute'] = __DIR__.'/Xml/Dom/Builder/xmlns_attribute.php'; - $functions['Xml\Dom\Builder\xmlns_attributes'] = __DIR__.'/Xml/Dom/Builder/xmlns_attributes.php'; - $functions['Xml\Dom\Configurator\canonicalize'] = __DIR__.'/Xml/Dom/Configurator/canonicalize.php'; - $functions['Xml\Dom\Configurator\comparable'] = __DIR__.'/Xml/Dom/Configurator/comparable.php'; - $functions['Xml\Dom\Configurator\document_uri'] = __DIR__.'/Xml/Dom/Configurator/document_uri.php'; - $functions['Xml\Dom\Configurator\loader'] = __DIR__.'/Xml/Dom/Configurator/loader.php'; - $functions['Xml\Dom\Configurator\normalize'] = __DIR__.'/Xml/Dom/Configurator/normalize.php'; - $functions['Xml\Dom\Configurator\optimize_namespaces'] = __DIR__.'/Xml/Dom/Configurator/optimize_namespaces.php'; - $functions['Xml\Dom\Configurator\pretty_print'] = __DIR__.'/Xml/Dom/Configurator/pretty_print.php'; - $functions['Xml\Dom\Configurator\traverse'] = __DIR__.'/Xml/Dom/Configurator/traverse.php'; - $functions['Xml\Dom\Configurator\trim_spaces'] = __DIR__.'/Xml/Dom/Configurator/trim_spaces.php'; - $functions['Xml\Dom\Configurator\utf8'] = __DIR__.'/Xml/Dom/Configurator/utf8.php'; - $functions['Xml\Dom\Configurator\validator'] = __DIR__.'/Xml/Dom/Configurator/validator.php'; - $functions['Xml\Dom\Loader\load'] = __DIR__.'/Xml/Dom/Loader/load.php'; - $functions['Xml\Dom\Loader\xml_file_loader'] = __DIR__.'/Xml/Dom/Loader/xml_file_loader.php'; - $functions['Xml\Dom\Loader\xml_node_loader'] = __DIR__.'/Xml/Dom/Loader/xml_node_loader.php'; - $functions['Xml\Dom\Loader\xml_string_loader'] = __DIR__.'/Xml/Dom/Loader/xml_string_loader.php'; - $functions['Xml\Dom\Locator\Attribute\attributes_list'] = __DIR__.'/Xml/Dom/Locator/Attribute/attributes_list.php'; - $functions['Xml\Dom\Locator\Attribute\xmlns_attributes_list'] = __DIR__.'/Xml/Dom/Locator/Attribute/xmlns_attributes_list.php'; - $functions['Xml\Dom\Locator\Element\ancestors'] = __DIR__.'/Xml/Dom/Locator/Element/ancestors.php'; - $functions['Xml\Dom\Locator\Element\children'] = __DIR__.'/Xml/Dom/Locator/Element/children.php'; - $functions['Xml\Dom\Locator\Element\locate_by_namespaced_tag_name'] = __DIR__.'/Xml/Dom/Locator/Element/locate_by_namespaced_tag_name.php'; - $functions['Xml\Dom\Locator\Element\locate_by_tag_name'] = __DIR__.'/Xml/Dom/Locator/Element/locate_by_tag_name.php'; - $functions['Xml\Dom\Locator\Element\parent_element'] = __DIR__.'/Xml/Dom/Locator/Element/parent_element.php'; - $functions['Xml\Dom\Locator\Element\siblings'] = __DIR__.'/Xml/Dom/Locator/Element/siblings.php'; - $functions['Xml\Dom\Locator\Node\children'] = __DIR__.'/Xml/Dom/Locator/Node/children.php'; - $functions['Xml\Dom\Locator\Node\detect_document'] = __DIR__.'/Xml/Dom/Locator/Node/detect_document.php'; - $functions['Xml\Dom\Locator\Node\value'] = __DIR__.'/Xml/Dom/Locator/Node/value.php'; - $functions['Xml\Dom\Locator\Xmlns\linked_namespaces'] = __DIR__.'/Xml/Dom/Locator/Xmlns/linked_namespaces.php'; - $functions['Xml\Dom\Locator\Xmlns\recursive_linked_namespaces'] = __DIR__.'/Xml/Dom/Locator/Xmlns/recursive_linked_namespaces.php'; - $functions['Xml\Dom\Locator\Xsd\locate_all_xsd_schemas'] = __DIR__.'/Xml/Dom/Locator/Xsd/locate_all_xsd_schemas.php'; - $functions['Xml\Dom\Locator\Xsd\locate_namespaced_xsd_schemas'] = __DIR__.'/Xml/Dom/Locator/Xsd/locate_namespaced_xsd_schemas.php'; - $functions['Xml\Dom\Locator\Xsd\locate_no_namespaced_xsd_schemas'] = __DIR__.'/Xml/Dom/Locator/Xsd/locate_no_namespaced_xsd_schemas.php'; - $functions['Xml\Dom\Locator\document_element'] = __DIR__.'/Xml/Dom/Locator/document_element.php'; - $functions['Xml\Dom\Locator\elements_with_namespaced_tagname'] = __DIR__.'/Xml/Dom/Locator/elements_with_namespaced_tagname.php'; - $functions['Xml\Dom\Locator\elements_with_tagname'] = __DIR__.'/Xml/Dom/Locator/elements_with_tagname.php'; - $functions['Xml\Dom\Locator\root_namespace'] = __DIR__.'/Xml/Dom/Locator/root_namespace.php'; - $functions['Xml\Dom\Manipulator\Attribute\rename'] = __DIR__.'/Xml/Dom/Manipulator/Attribute/rename.php'; - $functions['Xml\Dom\Manipulator\Document\optimize_namespaces'] = __DIR__.'/Xml/Dom/Manipulator/Document/optimize_namespaces.php'; - $functions['Xml\Dom\Manipulator\Element\copy_named_xmlns_attributes'] = __DIR__.'/Xml/Dom/Manipulator/Element/copy_named_xmlns_attributes.php'; - $functions['Xml\Dom\Manipulator\Element\rename'] = __DIR__.'/Xml/Dom/Manipulator/Element/rename.php'; - $functions['Xml\Dom\Manipulator\Node\append_external_node'] = __DIR__.'/Xml/Dom/Manipulator/Node/append_external_node.php'; - $functions['Xml\Dom\Manipulator\Node\import_node_deeply'] = __DIR__.'/Xml/Dom/Manipulator/Node/import_node_deeply.php'; - $functions['Xml\Dom\Manipulator\Node\remove'] = __DIR__.'/Xml/Dom/Manipulator/Node/remove.php'; - $functions['Xml\Dom\Manipulator\Node\remove_namespace'] = __DIR__.'/Xml/Dom/Manipulator/Node/remove_namespace.php'; - $functions['Xml\Dom\Manipulator\Node\rename'] = __DIR__.'/Xml/Dom/Manipulator/Node/rename.php'; - $functions['Xml\Dom\Manipulator\Node\replace_by_external_node'] = __DIR__.'/Xml/Dom/Manipulator/Node/replace_by_external_node.php'; - $functions['Xml\Dom\Manipulator\Node\replace_by_external_nodes'] = __DIR__.'/Xml/Dom/Manipulator/Node/replace_by_external_nodes.php'; - $functions['Xml\Dom\Manipulator\Xmlns\rename'] = __DIR__.'/Xml/Dom/Manipulator/Xmlns/rename.php'; - $functions['Xml\Dom\Manipulator\append'] = __DIR__.'/Xml/Dom/Manipulator/append.php'; - $functions['Xml\Dom\Mapper\xml_string'] = __DIR__.'/Xml/Dom/Mapper/xml_string.php'; - $functions['Xml\Dom\Mapper\xslt_template'] = __DIR__.'/Xml/Dom/Mapper/xslt_template.php'; - $functions['Xml\Dom\Predicate\is_attribute'] = __DIR__.'/Xml/Dom/Predicate/is_attribute.php'; - $functions['Xml\Dom\Predicate\is_cdata'] = __DIR__.'/Xml/Dom/Predicate/is_cdata.php'; - $functions['Xml\Dom\Predicate\is_default_xmlns_attribute'] = __DIR__.'/Xml/Dom/Predicate/is_default_xmlns_attribute.php'; - $functions['Xml\Dom\Predicate\is_document'] = __DIR__.'/Xml/Dom/Predicate/is_document.php'; - $functions['Xml\Dom\Predicate\is_document_element'] = __DIR__.'/Xml/Dom/Predicate/is_document_element.php'; - $functions['Xml\Dom\Predicate\is_element'] = __DIR__.'/Xml/Dom/Predicate/is_element.php'; - $functions['Xml\Dom\Predicate\is_non_empty_text'] = __DIR__.'/Xml/Dom/Predicate/is_non_empty_text.php'; - $functions['Xml\Dom\Predicate\is_text'] = __DIR__.'/Xml/Dom/Predicate/is_text.php'; - $functions['Xml\Dom\Predicate\is_whitespace'] = __DIR__.'/Xml/Dom/Predicate/is_whitespace.php'; - $functions['Xml\Dom\Predicate\is_xmlns_attribute'] = __DIR__.'/Xml/Dom/Predicate/is_xmlns_attribute.php'; - $functions['Xml\Dom\Validator\internal_xsd_validator'] = __DIR__.'/Xml/Dom/Validator/internal_xsd_validator.php'; - $functions['Xml\Dom\Validator\validator_chain'] = __DIR__.'/Xml/Dom/Validator/validator_chain.php'; - $functions['Xml\Dom\Validator\xsd_validator'] = __DIR__.'/Xml/Dom/Validator/xsd_validator.php'; - $functions['Xml\Dom\Xpath\Configurator\all_functions'] = __DIR__.'/Xml/Dom/Xpath/Configurator/all_functions.php'; - $functions['Xml\Dom\Xpath\Configurator\functions'] = __DIR__.'/Xml/Dom/Xpath/Configurator/functions.php'; - $functions['Xml\Dom\Xpath\Configurator\namespaces'] = __DIR__.'/Xml/Dom/Xpath/Configurator/namespaces.php'; - $functions['Xml\Dom\Xpath\Configurator\php_namespace'] = __DIR__.'/Xml/Dom/Xpath/Configurator/php_namespace.php'; - $functions['Xml\Dom\Xpath\Locator\evaluate'] = __DIR__.'/Xml/Dom/Xpath/Locator/evaluate.php'; - $functions['Xml\Dom\Xpath\Locator\query'] = __DIR__.'/Xml/Dom/Xpath/Locator/query.php'; - $functions['Xml\Dom\Xpath\Locator\query_single'] = __DIR__.'/Xml/Dom/Xpath/Locator/query_single.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\attribute'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/attribute.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\attributes'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/attributes.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\element'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/element.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\group_child_elements'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/group_child_elements.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\grouped_children'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/grouped_children.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\name'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/name.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\namespaces'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/namespaces.php'; - $functions['Xml\Encoding\Internal\Decoder\Builder\unwrap_element'] = __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/unwrap_element.php'; - $functions['Xml\Encoding\Internal\Encoder\Builder\children'] = __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/children.php'; - $functions['Xml\Encoding\Internal\Encoder\Builder\element'] = __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/element.php'; - $functions['Xml\Encoding\Internal\Encoder\Builder\is_node_list'] = __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/is_node_list.php'; - $functions['Xml\Encoding\Internal\Encoder\Builder\normalize_data'] = __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/normalize_data.php'; - $functions['Xml\Encoding\Internal\Encoder\Builder\parent_node'] = __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/parent_node.php'; - $functions['Xml\Encoding\Internal\Encoder\Builder\root'] = __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/root.php'; - $functions['Xml\Encoding\Internal\wrap_exception'] = __DIR__.'/Xml/Encoding/Internal/wrap_exception.php'; - $functions['Xml\Encoding\document_encode'] = __DIR__.'/Xml/Encoding/document_encode.php'; - $functions['Xml\Encoding\element_decode'] = __DIR__.'/Xml/Encoding/element_decode.php'; - $functions['Xml\Encoding\element_encode'] = __DIR__.'/Xml/Encoding/element_encode.php'; - $functions['Xml\Encoding\typed'] = __DIR__.'/Xml/Encoding/typed.php'; - $functions['Xml\Encoding\xml_decode'] = __DIR__.'/Xml/Encoding/xml_decode.php'; - $functions['Xml\Encoding\xml_encode'] = __DIR__.'/Xml/Encoding/xml_encode.php'; - $functions['Xml\ErrorHandling\Assertion\assert_strict_prefixed_name'] = __DIR__.'/Xml/ErrorHandling/Assertion/assert_strict_prefixed_name.php'; - $functions['Xml\ErrorHandling\detect_issues'] = __DIR__.'/Xml/ErrorHandling/detect_issues.php'; - $functions['Xml\ErrorHandling\disallow_issues'] = __DIR__.'/Xml/ErrorHandling/disallow_issues.php'; - $functions['Xml\ErrorHandling\disallow_libxml_false_returns'] = __DIR__.'/Xml/ErrorHandling/disallow_libxml_false_returns.php'; - $functions['Xml\ErrorHandling\issue_collection_from_xml_errors'] = __DIR__.'/Xml/ErrorHandling/issue_collection_from_xml_errors.php'; - $functions['Xml\ErrorHandling\issue_from_xml_error'] = __DIR__.'/Xml/ErrorHandling/issue_from_xml_error.php'; - $functions['Xml\ErrorHandling\issue_level_from_xml_error'] = __DIR__.'/Xml/ErrorHandling/issue_level_from_xml_error.php'; - $functions['Xml\ErrorHandling\stop_on_first_issue'] = __DIR__.'/Xml/ErrorHandling/stop_on_first_issue.php'; - $functions['Xml\Internal\configure'] = __DIR__.'/Xml/Internal/configure.php'; - $functions['Xml\Reader\Configurator\parser_options'] = __DIR__.'/Xml/Reader/Configurator/parser_options.php'; - $functions['Xml\Reader\Configurator\substitute_entities'] = __DIR__.'/Xml/Reader/Configurator/substitute_entities.php'; - $functions['Xml\Reader\Configurator\xsd_schema'] = __DIR__.'/Xml/Reader/Configurator/xsd_schema.php'; - $functions['Xml\Reader\Loader\xml_file_loader'] = __DIR__.'/Xml/Reader/Loader/xml_file_loader.php'; - $functions['Xml\Reader\Loader\xml_string_loader'] = __DIR__.'/Xml/Reader/Loader/xml_string_loader.php'; - $functions['Xml\Reader\Matcher\all'] = __DIR__.'/Xml/Reader/Matcher/all.php'; - $functions['Xml\Reader\Matcher\any'] = __DIR__.'/Xml/Reader/Matcher/any.php'; - $functions['Xml\Reader\Matcher\attribute_local_name'] = __DIR__.'/Xml/Reader/Matcher/attribute_local_name.php'; - $functions['Xml\Reader\Matcher\attribute_local_value'] = __DIR__.'/Xml/Reader/Matcher/attribute_local_value.php'; - $functions['Xml\Reader\Matcher\attribute_name'] = __DIR__.'/Xml/Reader/Matcher/attribute_name.php'; - $functions['Xml\Reader\Matcher\attribute_value'] = __DIR__.'/Xml/Reader/Matcher/attribute_value.php'; - $functions['Xml\Reader\Matcher\document_element'] = __DIR__.'/Xml/Reader/Matcher/document_element.php'; - $functions['Xml\Reader\Matcher\element_local_name'] = __DIR__.'/Xml/Reader/Matcher/element_local_name.php'; - $functions['Xml\Reader\Matcher\element_name'] = __DIR__.'/Xml/Reader/Matcher/element_name.php'; - $functions['Xml\Reader\Matcher\element_position'] = __DIR__.'/Xml/Reader/Matcher/element_position.php'; - $functions['Xml\Reader\Matcher\namespaced_attribute'] = __DIR__.'/Xml/Reader/Matcher/namespaced_attribute.php'; - $functions['Xml\Reader\Matcher\namespaced_attribute_value'] = __DIR__.'/Xml/Reader/Matcher/namespaced_attribute_value.php'; - $functions['Xml\Reader\Matcher\namespaced_element'] = __DIR__.'/Xml/Reader/Matcher/namespaced_element.php'; - $functions['Xml\Reader\Matcher\nested'] = __DIR__.'/Xml/Reader/Matcher/nested.php'; - $functions['Xml\Reader\Matcher\node_attribute'] = __DIR__.'/Xml/Reader/Matcher/node_attribute.php'; - $functions['Xml\Reader\Matcher\node_name'] = __DIR__.'/Xml/Reader/Matcher/node_name.php'; - $functions['Xml\Reader\Matcher\not'] = __DIR__.'/Xml/Reader/Matcher/not.php'; - $functions['Xml\Reader\Matcher\sequence'] = __DIR__.'/Xml/Reader/Matcher/sequence.php'; - $functions['Xml\Writer\Builder\attribute'] = __DIR__.'/Xml/Writer/Builder/attribute.php'; - $functions['Xml\Writer\Builder\attributes'] = __DIR__.'/Xml/Writer/Builder/attributes.php'; - $functions['Xml\Writer\Builder\cdata'] = __DIR__.'/Xml/Writer/Builder/cdata.php'; - $functions['Xml\Writer\Builder\children'] = __DIR__.'/Xml/Writer/Builder/children.php'; - $functions['Xml\Writer\Builder\comment'] = __DIR__.'/Xml/Writer/Builder/comment.php'; - $functions['Xml\Writer\Builder\document'] = __DIR__.'/Xml/Writer/Builder/document.php'; - $functions['Xml\Writer\Builder\element'] = __DIR__.'/Xml/Writer/Builder/element.php'; - $functions['Xml\Writer\Builder\namespace_attribute'] = __DIR__.'/Xml/Writer/Builder/namespace_attribute.php'; - $functions['Xml\Writer\Builder\namespaced_attribute'] = __DIR__.'/Xml/Writer/Builder/namespaced_attribute.php'; - $functions['Xml\Writer\Builder\namespaced_attributes'] = __DIR__.'/Xml/Writer/Builder/namespaced_attributes.php'; - $functions['Xml\Writer\Builder\namespaced_element'] = __DIR__.'/Xml/Writer/Builder/namespaced_element.php'; - $functions['Xml\Writer\Builder\prefixed_attribute'] = __DIR__.'/Xml/Writer/Builder/prefixed_attribute.php'; - $functions['Xml\Writer\Builder\prefixed_attributes'] = __DIR__.'/Xml/Writer/Builder/prefixed_attributes.php'; - $functions['Xml\Writer\Builder\prefixed_element'] = __DIR__.'/Xml/Writer/Builder/prefixed_element.php'; - $functions['Xml\Writer\Builder\raw'] = __DIR__.'/Xml/Writer/Builder/raw.php'; - $functions['Xml\Writer\Builder\value'] = __DIR__.'/Xml/Writer/Builder/value.php'; - $functions['Xml\Writer\Configurator\indentation'] = __DIR__.'/Xml/Writer/Configurator/indentation.php'; - $functions['Xml\Writer\Configurator\open'] = __DIR__.'/Xml/Writer/Configurator/open.php'; - $functions['Xml\Writer\Mapper\memory_output'] = __DIR__.'/Xml/Writer/Mapper/memory_output.php'; - $functions['Xml\Writer\Opener\memory_opener'] = __DIR__.'/Xml/Writer/Opener/memory_opener.php'; - $functions['Xml\Writer\Opener\xml_file_opener'] = __DIR__.'/Xml/Writer/Opener/xml_file_opener.php'; - $functions['Xml\Xsd\Schema\Manipulator\base_path'] = __DIR__.'/Xml/Xsd/Schema/Manipulator/base_path.php'; - $functions['Xml\Xsd\Schema\Manipulator\overwrite_with_local_files'] = __DIR__.'/Xml/Xsd/Schema/Manipulator/overwrite_with_local_files.php'; - $functions['Xml\Xslt\Configurator\all_functions'] = __DIR__.'/Xml/Xslt/Configurator/all_functions.php'; - $functions['Xml\Xslt\Configurator\functions'] = __DIR__.'/Xml/Xslt/Configurator/functions.php'; - $functions['Xml\Xslt\Configurator\loader'] = __DIR__.'/Xml/Xslt/Configurator/loader.php'; - $functions['Xml\Xslt\Configurator\parameters'] = __DIR__.'/Xml/Xslt/Configurator/parameters.php'; - $functions['Xml\Xslt\Configurator\profiler'] = __DIR__.'/Xml/Xslt/Configurator/profiler.php'; - $functions['Xml\Xslt\Configurator\security_preferences'] = __DIR__.'/Xml/Xslt/Configurator/security_preferences.php'; - $functions['Xml\Xslt\Loader\from_template_document'] = __DIR__.'/Xml/Xslt/Loader/from_template_document.php'; - $functions['Xml\Xslt\Transformer\document_to_string'] = __DIR__.'/Xml/Xslt/Transformer/document_to_string.php'; + $functions = [ + 'Xml\Dom\Assert\assert_attribute' => __DIR__.'/Xml/Dom/Assert/assert_attribute.php', + 'Xml\Dom\Assert\assert_cdata' => __DIR__.'/Xml/Dom/Assert/assert_cdata.php', + 'Xml\Dom\Assert\assert_document' => __DIR__.'/Xml/Dom/Assert/assert_document.php', + 'Xml\Dom\Assert\assert_dom_node_list' => __DIR__.'/Xml/Dom/Assert/assert_dom_node_list.php', + 'Xml\Dom\Assert\assert_element' => __DIR__.'/Xml/Dom/Assert/assert_element.php', + 'Xml\Dom\Builder\attribute' => __DIR__.'/Xml/Dom/Builder/attribute.php', + 'Xml\Dom\Builder\attributes' => __DIR__.'/Xml/Dom/Builder/attributes.php', + 'Xml\Dom\Builder\cdata' => __DIR__.'/Xml/Dom/Builder/cdata.php', + 'Xml\Dom\Builder\children' => __DIR__.'/Xml/Dom/Builder/children.php', + 'Xml\Dom\Builder\element' => __DIR__.'/Xml/Dom/Builder/element.php', + 'Xml\Dom\Builder\escaped_value' => __DIR__.'/Xml/Dom/Builder/escaped_value.php', + 'Xml\Dom\Builder\namespaced_attribute' => __DIR__.'/Xml/Dom/Builder/namespaced_attribute.php', + 'Xml\Dom\Builder\namespaced_attributes' => __DIR__.'/Xml/Dom/Builder/namespaced_attributes.php', + 'Xml\Dom\Builder\namespaced_element' => __DIR__.'/Xml/Dom/Builder/namespaced_element.php', + 'Xml\Dom\Builder\nodes' => __DIR__.'/Xml/Dom/Builder/nodes.php', + 'Xml\Dom\Builder\value' => __DIR__.'/Xml/Dom/Builder/value.php', + 'Xml\Dom\Builder\xmlns_attribute' => __DIR__.'/Xml/Dom/Builder/xmlns_attribute.php', + 'Xml\Dom\Builder\xmlns_attributes' => __DIR__.'/Xml/Dom/Builder/xmlns_attributes.php', + 'Xml\Dom\Configurator\canonicalize' => __DIR__.'/Xml/Dom/Configurator/canonicalize.php', + 'Xml\Dom\Configurator\comparable' => __DIR__.'/Xml/Dom/Configurator/comparable.php', + 'Xml\Dom\Configurator\document_uri' => __DIR__.'/Xml/Dom/Configurator/document_uri.php', + 'Xml\Dom\Configurator\loader' => __DIR__.'/Xml/Dom/Configurator/loader.php', + 'Xml\Dom\Configurator\normalize' => __DIR__.'/Xml/Dom/Configurator/normalize.php', + 'Xml\Dom\Configurator\optimize_namespaces' => __DIR__.'/Xml/Dom/Configurator/optimize_namespaces.php', + 'Xml\Dom\Configurator\pretty_print' => __DIR__.'/Xml/Dom/Configurator/pretty_print.php', + 'Xml\Dom\Configurator\traverse' => __DIR__.'/Xml/Dom/Configurator/traverse.php', + 'Xml\Dom\Configurator\trim_spaces' => __DIR__.'/Xml/Dom/Configurator/trim_spaces.php', + 'Xml\Dom\Configurator\utf8' => __DIR__.'/Xml/Dom/Configurator/utf8.php', + 'Xml\Dom\Configurator\validator' => __DIR__.'/Xml/Dom/Configurator/validator.php', + 'Xml\Dom\Loader\load' => __DIR__.'/Xml/Dom/Loader/load.php', + 'Xml\Dom\Loader\xml_file_loader' => __DIR__.'/Xml/Dom/Loader/xml_file_loader.php', + 'Xml\Dom\Loader\xml_node_loader' => __DIR__.'/Xml/Dom/Loader/xml_node_loader.php', + 'Xml\Dom\Loader\xml_string_loader' => __DIR__.'/Xml/Dom/Loader/xml_string_loader.php', + 'Xml\Dom\Locator\Attribute\attributes_list' => __DIR__.'/Xml/Dom/Locator/Attribute/attributes_list.php', + 'Xml\Dom\Locator\Attribute\xmlns_attributes_list' => __DIR__.'/Xml/Dom/Locator/Attribute/xmlns_attributes_list.php', + 'Xml\Dom\Locator\Element\ancestors' => __DIR__.'/Xml/Dom/Locator/Element/ancestors.php', + 'Xml\Dom\Locator\Element\children' => __DIR__.'/Xml/Dom/Locator/Element/children.php', + 'Xml\Dom\Locator\Element\locate_by_namespaced_tag_name' => __DIR__.'/Xml/Dom/Locator/Element/locate_by_namespaced_tag_name.php', + 'Xml\Dom\Locator\Element\locate_by_tag_name' => __DIR__.'/Xml/Dom/Locator/Element/locate_by_tag_name.php', + 'Xml\Dom\Locator\Element\parent_element' => __DIR__.'/Xml/Dom/Locator/Element/parent_element.php', + 'Xml\Dom\Locator\Element\siblings' => __DIR__.'/Xml/Dom/Locator/Element/siblings.php', + 'Xml\Dom\Locator\Node\children' => __DIR__.'/Xml/Dom/Locator/Node/children.php', + 'Xml\Dom\Locator\Node\detect_document' => __DIR__.'/Xml/Dom/Locator/Node/detect_document.php', + 'Xml\Dom\Locator\Node\value' => __DIR__.'/Xml/Dom/Locator/Node/value.php', + 'Xml\Dom\Locator\Xmlns\linked_namespaces' => __DIR__.'/Xml/Dom/Locator/Xmlns/linked_namespaces.php', + 'Xml\Dom\Locator\Xmlns\recursive_linked_namespaces' => __DIR__.'/Xml/Dom/Locator/Xmlns/recursive_linked_namespaces.php', + 'Xml\Dom\Locator\Xsd\locate_all_xsd_schemas' => __DIR__.'/Xml/Dom/Locator/Xsd/locate_all_xsd_schemas.php', + 'Xml\Dom\Locator\Xsd\locate_namespaced_xsd_schemas' => __DIR__.'/Xml/Dom/Locator/Xsd/locate_namespaced_xsd_schemas.php', + 'Xml\Dom\Locator\Xsd\locate_no_namespaced_xsd_schemas' => __DIR__.'/Xml/Dom/Locator/Xsd/locate_no_namespaced_xsd_schemas.php', + 'Xml\Dom\Locator\document_element' => __DIR__.'/Xml/Dom/Locator/document_element.php', + 'Xml\Dom\Locator\elements_with_namespaced_tagname' => __DIR__.'/Xml/Dom/Locator/elements_with_namespaced_tagname.php', + 'Xml\Dom\Locator\elements_with_tagname' => __DIR__.'/Xml/Dom/Locator/elements_with_tagname.php', + 'Xml\Dom\Locator\root_namespace' => __DIR__.'/Xml/Dom/Locator/root_namespace.php', + 'Xml\Dom\Manipulator\Attribute\rename' => __DIR__.'/Xml/Dom/Manipulator/Attribute/rename.php', + 'Xml\Dom\Manipulator\Document\optimize_namespaces' => __DIR__.'/Xml/Dom/Manipulator/Document/optimize_namespaces.php', + 'Xml\Dom\Manipulator\Element\copy_named_xmlns_attributes' => __DIR__.'/Xml/Dom/Manipulator/Element/copy_named_xmlns_attributes.php', + 'Xml\Dom\Manipulator\Element\rename' => __DIR__.'/Xml/Dom/Manipulator/Element/rename.php', + 'Xml\Dom\Manipulator\Node\append_external_node' => __DIR__.'/Xml/Dom/Manipulator/Node/append_external_node.php', + 'Xml\Dom\Manipulator\Node\import_node_deeply' => __DIR__.'/Xml/Dom/Manipulator/Node/import_node_deeply.php', + 'Xml\Dom\Manipulator\Node\remove' => __DIR__.'/Xml/Dom/Manipulator/Node/remove.php', + 'Xml\Dom\Manipulator\Node\remove_namespace' => __DIR__.'/Xml/Dom/Manipulator/Node/remove_namespace.php', + 'Xml\Dom\Manipulator\Node\rename' => __DIR__.'/Xml/Dom/Manipulator/Node/rename.php', + 'Xml\Dom\Manipulator\Node\replace_by_external_node' => __DIR__.'/Xml/Dom/Manipulator/Node/replace_by_external_node.php', + 'Xml\Dom\Manipulator\Node\replace_by_external_nodes' => __DIR__.'/Xml/Dom/Manipulator/Node/replace_by_external_nodes.php', + 'Xml\Dom\Manipulator\Xmlns\rename' => __DIR__.'/Xml/Dom/Manipulator/Xmlns/rename.php', + 'Xml\Dom\Manipulator\append' => __DIR__.'/Xml/Dom/Manipulator/append.php', + 'Xml\Dom\Mapper\xml_string' => __DIR__.'/Xml/Dom/Mapper/xml_string.php', + 'Xml\Dom\Mapper\xslt_template' => __DIR__.'/Xml/Dom/Mapper/xslt_template.php', + 'Xml\Dom\Predicate\is_attribute' => __DIR__.'/Xml/Dom/Predicate/is_attribute.php', + 'Xml\Dom\Predicate\is_cdata' => __DIR__.'/Xml/Dom/Predicate/is_cdata.php', + 'Xml\Dom\Predicate\is_default_xmlns_attribute' => __DIR__.'/Xml/Dom/Predicate/is_default_xmlns_attribute.php', + 'Xml\Dom\Predicate\is_document' => __DIR__.'/Xml/Dom/Predicate/is_document.php', + 'Xml\Dom\Predicate\is_document_element' => __DIR__.'/Xml/Dom/Predicate/is_document_element.php', + 'Xml\Dom\Predicate\is_element' => __DIR__.'/Xml/Dom/Predicate/is_element.php', + 'Xml\Dom\Predicate\is_non_empty_text' => __DIR__.'/Xml/Dom/Predicate/is_non_empty_text.php', + 'Xml\Dom\Predicate\is_text' => __DIR__.'/Xml/Dom/Predicate/is_text.php', + 'Xml\Dom\Predicate\is_whitespace' => __DIR__.'/Xml/Dom/Predicate/is_whitespace.php', + 'Xml\Dom\Predicate\is_xmlns_attribute' => __DIR__.'/Xml/Dom/Predicate/is_xmlns_attribute.php', + 'Xml\Dom\Validator\internal_xsd_validator' => __DIR__.'/Xml/Dom/Validator/internal_xsd_validator.php', + 'Xml\Dom\Validator\validator_chain' => __DIR__.'/Xml/Dom/Validator/validator_chain.php', + 'Xml\Dom\Validator\xsd_validator' => __DIR__.'/Xml/Dom/Validator/xsd_validator.php', + 'Xml\Dom\Xpath\Configurator\all_functions' => __DIR__.'/Xml/Dom/Xpath/Configurator/all_functions.php', + 'Xml\Dom\Xpath\Configurator\functions' => __DIR__.'/Xml/Dom/Xpath/Configurator/functions.php', + 'Xml\Dom\Xpath\Configurator\namespaces' => __DIR__.'/Xml/Dom/Xpath/Configurator/namespaces.php', + 'Xml\Dom\Xpath\Configurator\php_namespace' => __DIR__.'/Xml/Dom/Xpath/Configurator/php_namespace.php', + 'Xml\Dom\Xpath\Locator\evaluate' => __DIR__.'/Xml/Dom/Xpath/Locator/evaluate.php', + 'Xml\Dom\Xpath\Locator\query' => __DIR__.'/Xml/Dom/Xpath/Locator/query.php', + 'Xml\Dom\Xpath\Locator\query_single' => __DIR__.'/Xml/Dom/Xpath/Locator/query_single.php', + 'Xml\Encoding\Internal\Decoder\Builder\attribute' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/attribute.php', + 'Xml\Encoding\Internal\Decoder\Builder\attributes' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/attributes.php', + 'Xml\Encoding\Internal\Decoder\Builder\element' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/element.php', + 'Xml\Encoding\Internal\Decoder\Builder\group_child_elements' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/group_child_elements.php', + 'Xml\Encoding\Internal\Decoder\Builder\grouped_children' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/grouped_children.php', + 'Xml\Encoding\Internal\Decoder\Builder\name' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/name.php', + 'Xml\Encoding\Internal\Decoder\Builder\namespaces' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/namespaces.php', + 'Xml\Encoding\Internal\Decoder\Builder\unwrap_element' => __DIR__.'/Xml/Encoding/Internal/Decoder/Builder/unwrap_element.php', + 'Xml\Encoding\Internal\Encoder\Builder\children' => __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/children.php', + 'Xml\Encoding\Internal\Encoder\Builder\element' => __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/element.php', + 'Xml\Encoding\Internal\Encoder\Builder\is_node_list' => __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/is_node_list.php', + 'Xml\Encoding\Internal\Encoder\Builder\normalize_data' => __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/normalize_data.php', + 'Xml\Encoding\Internal\Encoder\Builder\parent_node' => __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/parent_node.php', + 'Xml\Encoding\Internal\Encoder\Builder\root' => __DIR__.'/Xml/Encoding/Internal/Encoder/Builder/root.php', + 'Xml\Encoding\Internal\wrap_exception' => __DIR__.'/Xml/Encoding/Internal/wrap_exception.php', + 'Xml\Encoding\document_encode' => __DIR__.'/Xml/Encoding/document_encode.php', + 'Xml\Encoding\element_decode' => __DIR__.'/Xml/Encoding/element_decode.php', + 'Xml\Encoding\element_encode' => __DIR__.'/Xml/Encoding/element_encode.php', + 'Xml\Encoding\typed' => __DIR__.'/Xml/Encoding/typed.php', + 'Xml\Encoding\xml_decode' => __DIR__.'/Xml/Encoding/xml_decode.php', + 'Xml\Encoding\xml_encode' => __DIR__.'/Xml/Encoding/xml_encode.php', + 'Xml\ErrorHandling\Assertion\assert_strict_prefixed_name' => __DIR__.'/Xml/ErrorHandling/Assertion/assert_strict_prefixed_name.php', + 'Xml\ErrorHandling\detect_issues' => __DIR__.'/Xml/ErrorHandling/detect_issues.php', + 'Xml\ErrorHandling\disallow_issues' => __DIR__.'/Xml/ErrorHandling/disallow_issues.php', + 'Xml\ErrorHandling\disallow_libxml_false_returns' => __DIR__.'/Xml/ErrorHandling/disallow_libxml_false_returns.php', + 'Xml\ErrorHandling\issue_collection_from_xml_errors' => __DIR__.'/Xml/ErrorHandling/issue_collection_from_xml_errors.php', + 'Xml\ErrorHandling\issue_from_xml_error' => __DIR__.'/Xml/ErrorHandling/issue_from_xml_error.php', + 'Xml\ErrorHandling\issue_level_from_xml_error' => __DIR__.'/Xml/ErrorHandling/issue_level_from_xml_error.php', + 'Xml\ErrorHandling\stop_on_first_issue' => __DIR__.'/Xml/ErrorHandling/stop_on_first_issue.php', + 'Xml\Internal\configure' => __DIR__.'/Xml/Internal/configure.php', + 'Xml\Reader\Configurator\parser_options' => __DIR__.'/Xml/Reader/Configurator/parser_options.php', + 'Xml\Reader\Configurator\substitute_entities' => __DIR__.'/Xml/Reader/Configurator/substitute_entities.php', + 'Xml\Reader\Configurator\xsd_schema' => __DIR__.'/Xml/Reader/Configurator/xsd_schema.php', + 'Xml\Reader\Loader\xml_file_loader' => __DIR__.'/Xml/Reader/Loader/xml_file_loader.php', + 'Xml\Reader\Loader\xml_string_loader' => __DIR__.'/Xml/Reader/Loader/xml_string_loader.php', + 'Xml\Reader\Matcher\all' => __DIR__.'/Xml/Reader/Matcher/all.php', + 'Xml\Reader\Matcher\any' => __DIR__.'/Xml/Reader/Matcher/any.php', + 'Xml\Reader\Matcher\attribute_local_name' => __DIR__.'/Xml/Reader/Matcher/attribute_local_name.php', + 'Xml\Reader\Matcher\attribute_local_value' => __DIR__.'/Xml/Reader/Matcher/attribute_local_value.php', + 'Xml\Reader\Matcher\attribute_name' => __DIR__.'/Xml/Reader/Matcher/attribute_name.php', + 'Xml\Reader\Matcher\attribute_value' => __DIR__.'/Xml/Reader/Matcher/attribute_value.php', + 'Xml\Reader\Matcher\document_element' => __DIR__.'/Xml/Reader/Matcher/document_element.php', + 'Xml\Reader\Matcher\element_local_name' => __DIR__.'/Xml/Reader/Matcher/element_local_name.php', + 'Xml\Reader\Matcher\element_name' => __DIR__.'/Xml/Reader/Matcher/element_name.php', + 'Xml\Reader\Matcher\element_position' => __DIR__.'/Xml/Reader/Matcher/element_position.php', + 'Xml\Reader\Matcher\namespaced_attribute' => __DIR__.'/Xml/Reader/Matcher/namespaced_attribute.php', + 'Xml\Reader\Matcher\namespaced_attribute_value' => __DIR__.'/Xml/Reader/Matcher/namespaced_attribute_value.php', + 'Xml\Reader\Matcher\namespaced_element' => __DIR__.'/Xml/Reader/Matcher/namespaced_element.php', + 'Xml\Reader\Matcher\nested' => __DIR__.'/Xml/Reader/Matcher/nested.php', + 'Xml\Reader\Matcher\not' => __DIR__.'/Xml/Reader/Matcher/not.php', + 'Xml\Reader\Matcher\sequence' => __DIR__.'/Xml/Reader/Matcher/sequence.php', + 'Xml\Writer\Builder\attribute' => __DIR__.'/Xml/Writer/Builder/attribute.php', + 'Xml\Writer\Builder\attributes' => __DIR__.'/Xml/Writer/Builder/attributes.php', + 'Xml\Writer\Builder\cdata' => __DIR__.'/Xml/Writer/Builder/cdata.php', + 'Xml\Writer\Builder\children' => __DIR__.'/Xml/Writer/Builder/children.php', + 'Xml\Writer\Builder\comment' => __DIR__.'/Xml/Writer/Builder/comment.php', + 'Xml\Writer\Builder\document' => __DIR__.'/Xml/Writer/Builder/document.php', + 'Xml\Writer\Builder\element' => __DIR__.'/Xml/Writer/Builder/element.php', + 'Xml\Writer\Builder\namespace_attribute' => __DIR__.'/Xml/Writer/Builder/namespace_attribute.php', + 'Xml\Writer\Builder\namespaced_attribute' => __DIR__.'/Xml/Writer/Builder/namespaced_attribute.php', + 'Xml\Writer\Builder\namespaced_attributes' => __DIR__.'/Xml/Writer/Builder/namespaced_attributes.php', + 'Xml\Writer\Builder\namespaced_element' => __DIR__.'/Xml/Writer/Builder/namespaced_element.php', + 'Xml\Writer\Builder\prefixed_attribute' => __DIR__.'/Xml/Writer/Builder/prefixed_attribute.php', + 'Xml\Writer\Builder\prefixed_attributes' => __DIR__.'/Xml/Writer/Builder/prefixed_attributes.php', + 'Xml\Writer\Builder\prefixed_element' => __DIR__.'/Xml/Writer/Builder/prefixed_element.php', + 'Xml\Writer\Builder\raw' => __DIR__.'/Xml/Writer/Builder/raw.php', + 'Xml\Writer\Builder\value' => __DIR__.'/Xml/Writer/Builder/value.php', + 'Xml\Writer\Configurator\indentation' => __DIR__.'/Xml/Writer/Configurator/indentation.php', + 'Xml\Writer\Configurator\open' => __DIR__.'/Xml/Writer/Configurator/open.php', + 'Xml\Writer\Mapper\memory_output' => __DIR__.'/Xml/Writer/Mapper/memory_output.php', + 'Xml\Writer\Opener\memory_opener' => __DIR__.'/Xml/Writer/Opener/memory_opener.php', + 'Xml\Writer\Opener\xml_file_opener' => __DIR__.'/Xml/Writer/Opener/xml_file_opener.php', + 'Xml\Xsd\Schema\Manipulator\base_path' => __DIR__.'/Xml/Xsd/Schema/Manipulator/base_path.php', + 'Xml\Xsd\Schema\Manipulator\overwrite_with_local_files' => __DIR__.'/Xml/Xsd/Schema/Manipulator/overwrite_with_local_files.php', + 'Xml\Xslt\Configurator\all_functions' => __DIR__.'/Xml/Xslt/Configurator/all_functions.php', + 'Xml\Xslt\Configurator\functions' => __DIR__.'/Xml/Xslt/Configurator/functions.php', + 'Xml\Xslt\Configurator\loader' => __DIR__.'/Xml/Xslt/Configurator/loader.php', + 'Xml\Xslt\Configurator\parameters' => __DIR__.'/Xml/Xslt/Configurator/parameters.php', + 'Xml\Xslt\Configurator\profiler' => __DIR__.'/Xml/Xslt/Configurator/profiler.php', + 'Xml\Xslt\Configurator\security_preferences' => __DIR__.'/Xml/Xslt/Configurator/security_preferences.php', + 'Xml\Xslt\Loader\from_template_document' => __DIR__.'/Xml/Xslt/Loader/from_template_document.php', + 'Xml\Xslt\Transformer\document_to_string' => __DIR__.'/Xml/Xslt/Transformer/document_to_string.php', + ]; foreach ($functions as $function => $file) { if (!\function_exists($function)) { diff --git a/tests/Stress/Memory/ReadWriteTest.php b/tests/Stress/Memory/ReadWriteTest.php index c206afc3..92ccb10f 100644 --- a/tests/Stress/Memory/ReadWriteTest.php +++ b/tests/Stress/Memory/ReadWriteTest.php @@ -9,7 +9,7 @@ use VeeWee\Tests\Xml\Helper\TmpFileTrait; use VeeWee\Xml\Reader\Reader; use VeeWee\Xml\Writer\Writer; -use function VeeWee\Xml\Reader\Matcher\node_name; +use function VeeWee\Xml\Reader\Matcher\element_name; use function VeeWee\Xml\Writer\Builder\children; use function VeeWee\Xml\Writer\Builder\document; use function VeeWee\Xml\Writer\Builder\element; @@ -81,7 +81,7 @@ private function readALot(): int return $this->time( function () { $reader = Reader::fromXmlFile($this->file); - $cursor = $reader->provide(node_name('FizzBuzz')); + $cursor = $reader->provide(element_name('FizzBuzz')); $counter = 0; foreach ($cursor as $item) { $counter++; @@ -99,6 +99,7 @@ private function time(callable $run) $stop = hrtime(true); $this->logLine('Action took: '.(($stop-$start)/1e+6).'ms'); + $this->logLine('Peak Memory usage: '.(memory_get_peak_usage(true)/1024/1024).'Mb'); return $result; } diff --git a/tests/Xml/Reader/Configurator/ParserOptionsTest.php b/tests/Xml/Reader/Configurator/ParserOptionsTest.php index 4626ae10..5437b452 100644 --- a/tests/Xml/Reader/Configurator/ParserOptionsTest.php +++ b/tests/Xml/Reader/Configurator/ParserOptionsTest.php @@ -9,7 +9,7 @@ use VeeWee\Xml\Reader\Reader; use XMLReader; use function VeeWee\Xml\Reader\Configurator\parser_options; -use function VeeWee\Xml\Reader\Matcher\node_name; +use function VeeWee\Xml\Reader\Matcher\element_name; final class ParserOptionsTest extends TestCase { @@ -17,14 +17,14 @@ public function test_it_throws_when_you_provide_an_invalid_option(): void { $xml = ''; $reader = Reader::fromXmlString($xml, parser_options([9019203 => true])); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); $this->expectException(RuntimeException::class); [...$iterator]; } - + public function test_it_does_not_throw_exceptions_when_called_after_read_has_been_called(): void { $xml = ''; diff --git a/tests/Xml/Reader/Configurator/SubstituteEntitiesTest.php b/tests/Xml/Reader/Configurator/SubstituteEntitiesTest.php index 37e33e92..823fffdd 100644 --- a/tests/Xml/Reader/Configurator/SubstituteEntitiesTest.php +++ b/tests/Xml/Reader/Configurator/SubstituteEntitiesTest.php @@ -9,7 +9,7 @@ use VeeWee\Xml\Reader\Reader; use function Psl\Vec\map; use function VeeWee\Xml\Reader\Configurator\substitute_entities; -use function VeeWee\Xml\Reader\Matcher\node_name; +use function VeeWee\Xml\Reader\Matcher\element_name; final class SubstituteEntitiesTest extends TestCase { @@ -17,7 +17,7 @@ public function test_it_can_substitute_entities(): void { $xml = $this->buildXml(); $reader = Reader::fromXmlString($xml, substitute_entities(true)); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); static::assertSame( [ @@ -32,7 +32,7 @@ public function test_it_can_skip_substituting_entities(): void { $xml = $this->buildXml(); $reader = Reader::fromXmlString($xml, substitute_entities(false)); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); static::assertSame( [ diff --git a/tests/Xml/Reader/Configurator/XsdSchemaTest.php b/tests/Xml/Reader/Configurator/XsdSchemaTest.php index 86df9a32..98bd3238 100644 --- a/tests/Xml/Reader/Configurator/XsdSchemaTest.php +++ b/tests/Xml/Reader/Configurator/XsdSchemaTest.php @@ -12,7 +12,7 @@ use XMLReader; use function Psl\Vec\map; use function VeeWee\Xml\Reader\Configurator\xsd_schema; -use function VeeWee\Xml\Reader\Matcher\node_name; +use function VeeWee\Xml\Reader\Matcher\element_name; final class XsdSchemaTest extends TestCase { @@ -31,7 +31,7 @@ public function test_it_can_iterate_if_the_schema_matches(): void EOXML; $reader = Reader::fromXmlString($xml, xsd_schema($xsdFile)); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); static::assertSame( [ @@ -58,7 +58,7 @@ public function test_it_triggers_an_error_on_invalid_schema(): void EOXML; $reader = Reader::fromXmlString($xml, xsd_schema($xsdFile)); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Detected issues during the parsing of the XML Stream'); @@ -73,7 +73,7 @@ public function test_it_triggers_an_error_if_schema_file_does_not_exist(): void $xml = ''; $reader = Reader::fromXmlString($xml, xsd_schema('unkown-file')); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); $this->expectException(RuntimeException::class); $this->expectExceptionMessage('The file "unkown-file" does not exist.'); @@ -102,7 +102,7 @@ public function test_it_can_not_set_a_schema_if_the_schema_is_invalid(): void $xml = ''; $reader = Reader::fromXmlString($xml, xsd_schema($xsdFile)); - $iterator = $reader->provide(node_name('user')); + $iterator = $reader->provide(element_name('user')); $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Schema contains errors'); diff --git a/tests/Xml/Reader/Matcher/NodeAttributeTest.php b/tests/Xml/Reader/Matcher/NodeAttributeTest.php deleted file mode 100644 index 63a92fc2..00000000 --- a/tests/Xml/Reader/Matcher/NodeAttributeTest.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - node_attribute('country', 'BE'), - <<<'EOXML' - - Jos - Bos - Mos - - EOXML, - [ - 'Jos', - 'Mos', - ] - ]; - yield 'namespaced' => [ - node_attribute('u:country', 'BE'), - <<<'EOXML' - - Jos - Bos - Mos - - EOXML, - [ - 'Jos', - 'Mos' - ] - ]; - } - - public static function provideMatcherCases(): Generator - { - $sequence = new NodeSequence( - new ElementNode(1, 'item', 'item', '', '', [ - new AttributeNode('locale', 'locale', '', '', 'nl') - ]) - ); - - yield 'it_returns_true_if_node_attribute_matches' => [ - node_attribute('locale', 'nl'), - $sequence, - true - ]; - - yield 'it_returns_false_if_node_attribute_does_not_match' => [ - node_attribute('locale', 'en'), - $sequence, - false - ]; - - yield 'it_returns_false_if_node_attribute_is_not_available' => [ - node_attribute('unkown', 'en'), - $sequence, - false - ]; - } -} diff --git a/tests/Xml/Reader/Matcher/NodeNameTest.php b/tests/Xml/Reader/Matcher/NodeNameTest.php deleted file mode 100644 index f98b69c6..00000000 --- a/tests/Xml/Reader/Matcher/NodeNameTest.php +++ /dev/null @@ -1,69 +0,0 @@ - [ - node_name('user'), - <<<'EOXML' - - Jos - Bos - Mos - - EOXML, - [ - 'Jos', - 'Bos', - 'Mos' - ] - ]; - yield 'namespaced' => [ - node_name('u:user'), - <<<'EOXML' - - Jos - Bos - Mos - - EOXML, - [ - 'Jos', - 'Bos', - 'Mos' - ] - ]; - } - - public static function provideMatcherCases(): Generator - { - $sequence = new NodeSequence( - new ElementNode(1, 'item', 'item', '', '', []) - ); - - yield 'it_returns_true_if_element_name_matches' => [ - node_name('item'), - $sequence, - true - ]; - - yield 'it_returns_false_if_element_name_does_not_match' => [ - node_name('other'), - $sequence, - false - ]; - } -} diff --git a/tests/Xml/Reader/ReaderTest.php b/tests/Xml/Reader/ReaderTest.php index 70125d2e..baf6e5ed 100644 --- a/tests/Xml/Reader/ReaderTest.php +++ b/tests/Xml/Reader/ReaderTest.php @@ -15,9 +15,8 @@ use function Psl\Vec\map; use function VeeWee\Xml\Reader\Loader\xml_string_loader; use function VeeWee\Xml\Reader\Matcher\all; +use function VeeWee\Xml\Reader\Matcher\attribute_value; use function VeeWee\Xml\Reader\Matcher\element_name; -use function VeeWee\Xml\Reader\Matcher\node_attribute; -use function VeeWee\Xml\Reader\Matcher\node_name; final class ReaderTest extends TestCase { @@ -101,7 +100,7 @@ public function provideXmlExpectations() Mos EOXML, - node_name('user'), + element_name('user'), [ 'Jos', 'Bos', @@ -118,8 +117,8 @@ public function provideXmlExpectations() EOXML, all( - node_name('user'), - node_attribute('locale', 'nl') + element_name('user'), + attribute_value('locale', 'nl') ), [ 'Jos', @@ -137,9 +136,9 @@ public function provideXmlExpectations() EOXML, all( - node_name('user'), - node_attribute('locale', 'nl'), - node_attribute('dialect', 'kempisch'), + element_name('user'), + attribute_value('locale', 'nl'), + attribute_value('dialect', 'kempisch'), ), [ 'Jos', @@ -156,7 +155,7 @@ public function provideXmlExpectations() EOXML, all( - node_name('user'), + element_name('user'), static fn (NodeSequence $sequence): bool => ($sequence->current()->position() % 2 === 0), ), [ @@ -177,7 +176,7 @@ public function provideXmlExpectations() EOXML, all( - node_name('user'), + element_name('user'), static fn (NodeSequence $sequence): bool => ($sequence->current()->position() % 2 === 0), ), [ @@ -200,7 +199,7 @@ public function provideXmlExpectations() EOXML, all( - node_name('item'), + element_name('item'), ), [ '