<commit_before><?php

class GithubController extends BaseController {

	/*
	|--------------------------------------------------------------------------
	| Github Controller
	|--------------------------------------------------------------------------
	|
	| Controller to update database using Github API
	|
	*/

	public function update()
	{
		// Base github url
		$github_url = 'https://api.github.com/users/';

		// List of users to index
		$users = [
			'40thieves',
			'edpoole',
			'rmlewisuk',
			'danharper',
		];

		foreach($users as $user)
		{
			// Uses Requests library to make http request for user data
			$user_response = Requests::get($github_url . $user);
			$user_json = json_decode($user_response->body);

			// Updates user model
			$user_model = User::createIfDoesNotExist($user_json->login);

			// Uses Requests library to make http request for user's starred data
			$stars_response = Requests::get($github_url . $user . '/starred');
			$stars_json = json_decode($stars_response->body);

			foreach($stars_json as $star)
			{
				// Updates repo model
				$repo_model = Repo::createIfDoesNotExist($star->name, ['language' => $star->language]);

				// Updates star model
				$star_model = Star::createIfDoesNotExist(['user_id' => $user_model->id, 'repo_id' => $repo->id]);
			}
		}
	}<commit_msg>Fixes bug on github controller with mis-named var<commit_after><?php

class GithubController extends BaseController {

	/*
	|--------------------------------------------------------------------------
	| Github Controller
	|--------------------------------------------------------------------------
	|
	| Controller to update database using Github API
	|
	*/

	public function update()
	{
		// Base github url
		$github_url = 'https://api.github.com/users/';

		// List of users to index
		$users = [
			'40thieves',
			'edpoole',
			'rmlewisuk',
			'danharper',
		];

		foreach($users as $user)
		{
			// Uses Requests library to make http request for user data
			$user_response = Requests::get($github_url . $user);
			$user_json = json_decode($user_response->body);

			// Updates user model
			$user_model = User::createIfDoesNotExist($user_json->login);

			// Uses Requests library to make http request for user's starred data
			$stars_response = Requests::get($github_url . $user . '/starred');
			$stars_json = json_decode($stars_response->body);

			foreach($stars_json as $star)
			{
				// Updates repo model
				$repo_model = Repo::createIfDoesNotExist($star->name, ['language' => $star->language]);

				// Updates star model
				$star_model = Star::createIfDoesNotExist(['user_id' => $user_model->id, 'repo_id' => $repo_model->id]);
			}
		}
	}
{'fraction_non_alphanumeric': 0.23804185351270554, 'fraction_numerical': 0.0014947683109118087, 'mean_word_length': 2.260657734470158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 2, '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': '1867212', 'n_tokens_mistral': 932, 'n_tokens_neox': 791, 'n_words': 187}