<commit_before><?php
/**
 *
 * 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\ClientSide;

use \Gt\Dom\Node;

class PageManifest extends Manifest {

private $fingerprint;

/**
 *
 */
public function __construct(Node $domHead) {
	$this->fingerprint = $this->calculateFingerprint($domHead);
	$this->pathDetails = $this->generatePathArray($domHead);
}

/**
 *
 * @return string MD5 hash representation of current dom head
 */
public function calculateFingerprint(Node $domHead) {

}

/**
 *
 * @return PathDetails A PathDetails object describing current dom head's
 * source paths and representing destination paths
 */
public function generatePathArray(Node $domHead) {

}

/**
 *
 * @return bool True if the files listed within the dom head are valid (having
 * the same filename and content), False if ANY of the files are invalid
 */
public function checkValid() {

}
}#<commit_msg>Start calculateFingerprint function<commit_after><?php
/**
 *
 * 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\ClientSide;

use \Gt\Dom\Node;

class PageManifest extends Manifest {

private $fingerprint;
private $sourceAttributeArray = ["src", "href"];

/**
 *
 */
public function __construct(Node $domHead) {
	$this->fingerprint = $this->calculateFingerprint($domHead);
	$this->pathDetails = $this->generatePathArray($domHead);
}

/**
 * Creates an MD5 hash representing the combined content and filenames of all
 * client side resorces represented in the dom head.
 *
 * @return string MD5 hash representation of current dom head
 */
public function calculateFingerprint(Node $domHead) {
	$nodeList = $domHead->querySelectorAll(
		"script[src], link[rel='stylesheet'][href]");

	foreach ($nodeList as $node) {
		$sourceAttribute = null;

		foreach ($this->sourceAttributeArray as $key => $value) {
			// TODO: Save sourceattr
		}
	}
	var_dump($nodeList);die();
}

/**
 *
 * @return PathDetails A PathDetails object describing current dom head's
 * source paths and representing destination paths
 */
public function generatePathArray(Node $domHead) {

}

/**
 *
 * @return bool True if the files listed within the dom head are valid (having
 * the same filename and content), False if ANY of the files are invalid
 */
public function checkValid() {

}
}#
{'fraction_non_alphanumeric': 0.1261867088607595, 'fraction_numerical': 0.009098101265822785, 'mean_word_length': 4.3808510638297875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '6516878', 'n_tokens_mistral': 784, 'n_tokens_neox': 751, 'n_words': 241}