<commit_before><?php
/**
 * Part of the CSCMS package by Coder Studios.
 *
 * NOTICE OF LICENSE
 *
 * Licensed under the terms of the MIT license https://opensource.org/licenses/MIT
 *
 * @package    CSCMS
 * @version    1.0.0
 * @author     Coder Studios Ltd
 * @license    MIT https://opensource.org/licenses/MIT
 * @copyright  (c) 2017, Coder Studios Ltd
 * @link       https://www.coderstudios.com
 */
 
namespace CoderStudios\CSCMS\Library;

use CoderStudios\CSCMS\Models\Upload as Model;
use Illuminate\Contracts\Cache\Factory as Cache;

class Upload extends BaseLibrary {

	public function __construct(Model $model, Cache $cache)
	{
		$this->model = $model;
        $this->cache = $cache->store('models');
	}

	public function get($id)
	{
		$key = 'upload-' . $id;
		if ($this->cache->has($key)) {
			$upload = $this->cache->get($key);
		} else {
			$upload = $this->model->where('id',$id)->first();
			$this->cache->add($key, $upload, config('cscms.coderstudios.cache_duration'));
		}
		return $upload;
	}

	public function getAll($limit = 0, $page = 1)
	{
		$upload = $this->model;
		$key = md5(snake_case(str_replace('\\','',__namespace__) . class_basename($this) . '_' .  __function__ . '_' . $limit . '_' . $page));
		if ($this->cache->has($key)) {
			$upoad = $this->cache->get($key);
		} else {
			if (!$limit) {
				$upload_count = $upload->count() > 0 ? $upload->count() : 1;
				$upoad = $upoad->paginate($upload_count);
			} else {
				$upoad = $upoad->paginate($limit);
			}
			$this->cache->add($key, $upoad, config('cscms.coderstudios.cache_duration'));
		}
		return $upoad;
	}
}<commit_msg>Fix typos in variable name<commit_after><?php
/**
 * Part of the CSCMS package by Coder Studios.
 *
 * NOTICE OF LICENSE
 *
 * Licensed under the terms of the MIT license https://opensource.org/licenses/MIT
 *
 * @package    CSCMS
 * @version    1.0.0
 * @author     Coder Studios Ltd
 * @license    MIT https://opensource.org/licenses/MIT
 * @copyright  (c) 2017, Coder Studios Ltd
 * @link       https://www.coderstudios.com
 */
 
namespace CoderStudios\CSCMS\Library;

use CoderStudios\CSCMS\Models\Upload as Model;
use Illuminate\Contracts\Cache\Factory as Cache;

class Upload extends BaseLibrary {

	public function __construct(Model $model, Cache $cache)
	{
		$this->model = $model;
        $this->cache = $cache->store('models');
	}

	public function get($id)
	{
		$key = 'upload-' . $id;
		if ($this->cache->has($key)) {
			$upload = $this->cache->get($key);
		} else {
			$upload = $this->model->where('id',$id)->first();
			$this->cache->add($key, $upload, config('cscms.coderstudios.cache_duration'));
		}
		return $upload;
	}

	public function getAll($limit = 0, $page = 1)
	{
		$upload = $this->model;
		$key = md5(snake_case(str_replace('\\','',__namespace__) . class_basename($this) . '_' .  __function__ . '_' . $limit . '_' . $page));
		if ($this->cache->has($key)) {
			$upload = $this->cache->get($key);
		} else {
			if (!$limit) {
				$upload_count = $upload->count() > 0 ? $upload->count() : 1;
				$upload = $upload->paginate($upload_count);
			} else {
				$upload = $upload->paginate($limit);
			}
			$this->cache->add($key, $upload, config('cscms.coderstudios.cache_duration'));
		}
		return $upload;
	}
}
{'fraction_non_alphanumeric': 0.18618988902589395, 'fraction_numerical': 0.007398273736128237, 'mean_word_length': 3.4635488308115545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '120320', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1151, 'n_words': 240}