<commit_before><?php
/**
 * NodeList objects are collections of nodes such as those returned by
 * Node->childNodes and the querySelectorAll method.
 *
 * This class is an extension to the native DOMNodeList present in PHP, aiming
 * to provide a DOM-level-4-capable interface by defining missing methods and
 * properties.
 *
 * PHP.Gt (http://php.gt)
 * @copyright Copyright Ⓒ 2014 Bright Flair Ltd. (http://brightflair.com)
 * @license Apache Version 2.0, January 2004. http://www.apache.org/licenses
 */
namespace Gt\Dom;

/**
 * @property <type> name Description
 *
 * @method <returnType> name(<type> [parameter]) Description
 */
class NodeList implements \Countable, \Iterator, \ArrayAccess {

private $iteratorIndex = 0;
public $nodeArray;

public function __construct($domNodeList) {
	$this->nodeArray = [];

	if($domNodeList instanceof NodeList
	|| $domNodeList instanceof \DOMNodeList
	|| is_array($domNodeList)) {
		foreach($domNodeList as $domNode) {
			// Get reference to current DOMNode's owner document, as this may
			// be different from node to node.
			if($domNode instanceof Node) {
				// Ensure we are working with a native DOMNode.
				$domNode = $domNode->domNode;
			}

			$domDocument = $domNode->ownerDocument;

			// Call getNode to get reference to a Node object representing the
			// given DOMNode, then push it into the nodeArray.
			$node = $domDocument->document->getNode($domNode);<commit_msg>Annotate magic method<commit_after><?php
/**
 * NodeList objects are collections of nodes such as those returned by
 * Node->childNodes and the querySelectorAll method.
 *
 * This class is an extension to the native DOMNodeList present in PHP, aiming
 * to provide a DOM-level-4-capable interface by defining missing methods and
 * properties.
 *
 * PHP.Gt (http://php.gt)
 * @copyright Copyright Ⓒ 2014 Bright Flair Ltd. (http://brightflair.com)
 * @license Apache Version 2.0, January 2004. http://www.apache.org/licenses
 */
namespace Gt\Dom;

/**
 * //property <type> name
 *
 * @method Node item(int $index)
 */
class NodeList implements \Countable, \Iterator, \ArrayAccess {

private $iteratorIndex = 0;
public $nodeArray;

public function __construct($domNodeList) {
	$this->nodeArray = [];

	if($domNodeList instanceof NodeList
	|| $domNodeList instanceof \DOMNodeList
	|| is_array($domNodeList)) {
		foreach($domNodeList as $domNode) {
			// Get reference to current DOMNode's owner document, as this may
			// be different from node to node.
			if($domNode instanceof Node) {
				// Ensure we are working with a native DOMNode.
				$domNode = $domNode->domNode;
			}

			$domDocument = $domNode->ownerDocument;

			// Call getNode to get reference to a Node object representing the
			// given DOMNode, then push it into the nodeArray.
			$node = $domDocument->document->getNode($domNode);
{'fraction_non_alphanumeric': 0.11170024743725698, 'fraction_numerical': 0.008483563096500531, 'mean_word_length': 3.8877374784110534, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2931126', 'n_tokens_mistral': 890, 'n_tokens_neox': 814, 'n_words': 291}