<commit_before><?php

namespace werx\Core\Modules;

use werx\Core\Module;
use werx\Core\WerxApp;

class ConsoleDispatcher extends Module
{
	public function handle(WerxApp $app)
	{
		$argv = $app->getArgs();

		$controller = ucfirst($argv[1]);
		$job_name = $argv[2];
		$args = array_slice($argv, 3);

		if (empty($controller)) {
			die("You must pass in a controller to use.\n");
		}

		if (empty($job_name)) {
			die("You must pass in a method to call.\n");
		}

		$class_name = implode("\\", [$app['namespace'], 'Controllers', $controller]);

		if (!class_exists($class_name, true)) {
			die("Controller {$class_name} does not exist.\n");
		}

		$class = new $class_name($app);

		if (!method_exists($class, $job_name)) {
			die("Method {$job_name} does not exist for controller {$class_name}.\n");
		}

		call_user_func_array([$class, $job_name], $args);<commit_msg>Change  to  so there's no confusion between global and local<commit_after><?php

namespace werx\Core\Modules;

use werx\Core\Module;
use werx\Core\WerxApp;

class ConsoleDispatcher extends Module
{
	public function handle(WerxApp $app)
	{
		$args = $app->getArgs();

		$controller = ucfirst($args[1]);
		$job_name = $args[2];
		$args = array_slice($args, 3);

		if (empty($controller)) {
			die("You must pass in a controller to use.\n");
		}

		if (empty($job_name)) {
			die("You must pass in a method to call.\n");
		}

		$class_name = implode("\\", [$app['namespace'], 'Controllers', $controller]);

		if (!class_exists($class_name, true)) {
			die("Controller {$class_name} does not exist.\n");
		}

		$class = new $class_name($app);

		if (!method_exists($class, $job_name)) {
			die("Method {$job_name} does not exist for controller {$class_name}.\n");
		}

		call_user_func_array([$class, $job_name], $args);
{'fraction_non_alphanumeric': 0.17647058823529413, 'fraction_numerical': 0.0033613445378151263, 'mean_word_length': 4.347305389221557, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5429609', 'n_tokens_mistral': 692, 'n_tokens_neox': 624, 'n_words': 156}