<commit_before><?php

class Repo extends Eloquent {

	/**
	 * The database table used by the model
	 * @var string
	 */
	protected $table = 'repos';

	/**
	 * Model attributes that can be mass-assigned
	 * @var array
	 */
	protected $fillable = [
		'name',
		'language',
	];

	/**
	 * Model attributes that cannot be mass-assigned
	 * @var array
	 */
	protected $guarded = [
		'id',
	];

	public static function createIfDoesNotExist($name, $options = [])
	{
		// Queries to find existing repo with name
		$repo = self::where('name', '=', $name)->first();

		// If not found, create
		if ( ! $repo)
		{
			$repo = self::create([
				'name'     => $name,
				'language' => isset($options['language']) ? $options['language'] : null,
			]);
		}

		return $repo;
	}

}<commit_msg>Docs for createIfDoesNotExist method, renamed options to params<commit_after><?php

class Repo extends Eloquent {

	/**
	 * The database table used by the model
	 * @var string
	 */
	protected $table = 'repos';

	/**
	 * Model attributes that can be mass-assigned
	 * @var array
	 */
	protected $fillable = [
		'name',
		'language',
	];

	/**
	 * Model attributes that cannot be mass-assigned
	 * @var array
	 */
	protected $guarded = [
		'id',
	];

	/**
	 * Creates model, if model does not already exist
	 * @param  string $name   Repo name to create model with
	 * @param  array  $params Params to create model with
	 * @return Model          Model found to created
	 */
	public static function createIfDoesNotExist($name, $params = [])
	{
		// Queries to find existing repo with name
		$repo = self::where('name', '=', $name)->first();

		// If not found, create
		if ( ! $repo)
		{
			$repo = self::create([
				'name'     => $name,
				'language' => isset($params['language']) ? $params['language'] : null,
			]);
		}

		return $repo;
	}

}
{'fraction_non_alphanumeric': 0.15485996705107083, 'fraction_numerical': 0.0, 'mean_word_length': 2.9098712446351933, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7177631', 'n_tokens_mistral': 661, 'n_tokens_neox': 584, 'n_words': 182}