<commit_before><?php

Class AssetFactory {
	
	static $store;

	static function &create($file_path) {
    
    # if the file path isn't passed through as a string, return an empty data array
    if(!is_string($file_path)) return array();
    
		# split by file extension
		preg_match('/\.([\w\d]{3,4})$/', $file_path, $split_path);
		
		if(isset($split_path[1])) {
			switch(strtolower($split_path[1])) {
				case 'mov';
				case 'mp4';
				case 'm4v';
				case 'swf';
					# new video asset
					$video = new Video($file_path);
					return $video->data;
					break;
				case 'html';
				case 'htm';
					# new html asset
					$html = new Html($file_path);
					return $html->data;
					break;
				default;
					# new generic asset
					$asset = new Asset($file_path);<commit_msg>The AssetFactory should only treat files as assets if they are not folders<commit_after><?php

Class AssetFactory {
	
	static $store;

	static function &create($file_path) {
    
    # if the file path isn't passed through as a string, return an empty data array
    if(!is_string($file_path)) return array();
    
		# split by file extension
		preg_match('/\.([\w\d]+?)$/', $file_path, $split_path);
		
		if(isset($split_path[1]) && !is_dir($file_path)) {
			switch(strtolower($split_path[1])) {
				case 'mov';
				case 'mp4';
				case 'm4v';
				case 'swf';
					# new video asset
					$video = new Video($file_path);
					return $video->data;
					break;
				case 'html';
				case 'htm';
					# new html asset
					$html = new Html($file_path);
					return $html->data;
					break;
				default;
					# new generic asset
					$asset = new Asset($file_path);
{'fraction_non_alphanumeric': 0.14338010982306285, 'fraction_numerical': 0.006101281269066504, 'mean_word_length': 2.8588235294117648, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7572654', 'n_tokens_mistral': 698, 'n_tokens_neox': 543, 'n_words': 156}