<commit_before><?php
include 'Explorer/GUI/DocViewer.php';

class InitFuncFilterIterator extends FilterIterator {
	public function current() {
		return parent::current()->getName();
	}
	public function accept() {
		return strpos($this->current(), 'init') === 0;
	}
}

class MainWindowController {
	protected $glade;
	protected $viewer;
	/**
	 *
	 * @var \Explorer\Manual\Manual
	 */
	protected $manual;

	public function __construct($file) {
		$this->loadGlade($file);
		$status = $this->glade->get_widget('loadingprogress');

		$r = new ReflectionObject($this);
		$methods = iterator_to_array(new InitFuncFilterIterator(new ArrayIterator($r->getMethods())));
		$count = count($methods);
		$i = 0;
		foreach ($methods as $method) {
			$this->$method();

			$status->set_pulse_step(++$i/$count);
			while (Gtk::events_pending()) {
				Gtk::main_iteration();
			}
		}

		$this->glade->get_widget('loadingwindow')->set_visible(false);
		$this->glade->get_widget('mainwindow')->set_visible(true);
	}

	public function initFunctionList() {
		$store = new \GtkTreeStore(\GObject::TYPE_STRING, \GObject::TYPE_PHP_VALUE);
		addFunctions($store, NULL, get_defined_functions());
		fillTreeView($this, $this->glade, 'functiontreeview', $store);
	}

	private function class_tree($store, $parent, $all, $items) {
		foreach ($all[$items] as $item) {
			$p = $store->append($parent, array($item, new \ReflectionClass($item)));
			if (!empty($all[$item])) {
				$this->class_tree($store, $p, $all, $item);
			}
		}
		return $store;
	}

	public function initClassTree() {
		$children = array();
		foreach (get_declared_classes() as $c) {
			$children[get_parent_class($c)][] = $c;
		}<commit_msg>Use FQCN there ...while i don't get why the progessbar doesn't work<commit_after><?php
include 'Explorer/GUI/DocViewer.php';

class InitFuncFilterIterator extends FilterIterator {
	public function current() {
		return parent::current()->getName();
	}
	public function accept() {
		return strpos($this->current(), 'init') === 0;
	}
}

class MainWindowController {
	protected $glade;
	protected $viewer;
	/**
	 *
	 * @var \Explorer\Manual\Manual
	 */
	protected $manual;

	public function __construct($file) {
		$this->loadGlade($file);
		$status = $this->glade->get_widget('loadingprogress');

		$r = new \ReflectionObject($this);
		$methods = iterator_to_array(new InitFuncFilterIterator(new ArrayIterator($r->getMethods())));
		$count = count($methods);
		$i = 0;
		foreach ($methods as $method) {
			$this->$method();

			$status->set_pulse_step(++$i/$count);
			while (\Gtk::events_pending()) {
				\Gtk::main_iteration();
			}
		}

		$this->glade->get_widget('loadingwindow')->set_visible(false);
		$this->glade->get_widget('mainwindow')->set_visible(true);
	}

	public function initFunctionList() {
		$store = new \GtkTreeStore(\GObject::TYPE_STRING, \GObject::TYPE_PHP_VALUE);
		addFunctions($store, NULL, get_defined_functions());
		fillTreeView($this, $this->glade, 'functiontreeview', $store);
	}

	private function class_tree($store, $parent, $all, $items) {
		foreach ($all[$items] as $item) {
			$p = $store->append($parent, array($item, new \ReflectionClass($item)));
			if (!empty($all[$item])) {
				$this->class_tree($store, $p, $all, $item);
			}
		}
		return $store;
	}

	public function initClassTree() {
		$children = array();
		foreach (get_declared_classes() as $c) {
			$children[get_parent_class($c)][] = $c;
		}
{'fraction_non_alphanumeric': 0.18272327964860907, 'fraction_numerical': 0.001171303074670571, 'mean_word_length': 4.992982456140351, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '1721376', 'n_tokens_mistral': 1267, 'n_tokens_neox': 1146, 'n_words': 221}