<commit_before><?php

class CM_Response_Resource_JS extends CM_Response_Resource_Abstract {

	public function process() {
		$this->setHeader('Content-Type', 'application/x-javascript');
		$this->enableCache();

		if ($this->_getFilename() == 'internal.js') {
			$content = new CM_File(DIR_PUBLIC . 'static/js/interface.js') . ';' . PHP_EOL;

			$classes = array();
			foreach (self::getSite()->getNamespaces() as $namespace) {
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/Renderable/'));
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/Component/'));
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/FormField/'));
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/Form/'));
			}

			foreach ($this->_getClasses($classes) as $class) {
				$jsPath = preg_replace('/\.php$/', '.js', $class['path']);
				$properties = file_exists($jsPath) ? new CM_File($jsPath) : null;
				$content .= $this->_printClass($class['name'], $class['parent'], $properties);
			}<commit_msg>t8: JS refactoring<commit_after><?php

class CM_Response_Resource_JS extends CM_Response_Resource_Abstract {

	public function process() {
		$this->setHeader('Content-Type', 'application/x-javascript');
		$this->enableCache();

		if ($this->_getFilename() == 'internal.js') {
			$content = '';
			$content .= new CM_File(DIR_PUBLIC . 'static/js/interface.js') . ';' . PHP_EOL;
			$content .= new CM_File(DIR_PUBLIC . 'static/js/sk.js') . ';' . PHP_EOL;

			$classes = array();
			foreach (self::getSite()->getNamespaces() as $namespace) {
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/Renderable/'));
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/Component/'));
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/FormField/'));
				$classes = array_merge($classes, CM_Util::rglob('*.php', DIR_LIBRARY . $namespace . '/Form/'));
			}

			foreach ($this->_getClasses($classes) as $class) {
				$jsPath = preg_replace('/\.php$/', '.js', $class['path']);
				$properties = file_exists($jsPath) ? new CM_File($jsPath) : null;
				$content .= $this->_printClass($class['name'], $class['parent'], $properties);
			}
{'fraction_non_alphanumeric': 0.20759493670886076, 'fraction_numerical': 0.0004219409282700422, 'mean_word_length': 4.618483412322274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3850387', 'n_tokens_mistral': 878, 'n_tokens_neox': 781, 'n_words': 140}