<commit_before><?php namespace TypiCMS\Repositories;

use Config;

use Illuminate\Support\ServiceProvider;

use TypiCMS\Models\Setting;

// Cache
use TypiCMS\Repositories\Setting\CacheDecorator;
use TypiCMS\Services\Cache\LaravelCache;

use TypiCMS\Repositories\Dashboard\EloquentDashboard;
use TypiCMS\Repositories\Setting\EloquentSetting;

class RepositoriesServiceProvider extends ServiceProvider {

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$app = $this->app;

		$app->bind('TypiCMS\Repositories\Dashboard\DashboardInterface', function($app)
		{
			return new EloquentDashboard(
				new LaravelCache($app['cache'], 'Dashboard', 10)
			);
		});

		$app->bind('TypiCMS\Repositories\Setting\SettingInterface', function($app)
		{
			$repository = new EloquentSetting(new Setting);
			if ( ! Config::get('app.cache')) {
				return $repository;
			}
			$laravelCache = new LaravelCache($app['cache'], 'Settings', 10);
			return new CacheDecorator($repository, $laravelCache);
		});

	}

}<commit_msg>cacheDecorator for Dashboard<commit_after><?php namespace TypiCMS\Repositories;

use Config;

use Illuminate\Support\ServiceProvider;

use TypiCMS\Models\Setting;

// Cache
use TypiCMS\Repositories\Dashboard\CacheDecorator as DashboardCacheDecorator;
use TypiCMS\Repositories\Setting\CacheDecorator;
use TypiCMS\Services\Cache\LaravelCache;

use TypiCMS\Repositories\Dashboard\EloquentDashboard;
use TypiCMS\Repositories\Setting\EloquentSetting;

class RepositoriesServiceProvider extends ServiceProvider {

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$app = $this->app;

		$app->bind('TypiCMS\Repositories\Dashboard\DashboardInterface', function($app)
		{
			$repository = new EloquentDashboard();
			if ( ! Config::get('app.cache')) {
				return $repository;
			}
			$laravelCache = new LaravelCache($app['cache'], 'Dashboard', 10);
			return new DashboardCacheDecorator($repository, $laravelCache);
		});

		$app->bind('TypiCMS\Repositories\Setting\SettingInterface', function($app)
		{
			$repository = new EloquentSetting(new Setting);
			if ( ! Config::get('app.cache')) {
				return $repository;
			}
			$laravelCache = new LaravelCache($app['cache'], 'Settings', 10);
			return new CacheDecorator($repository, $laravelCache);
		});

	}

}
{'fraction_non_alphanumeric': 0.13200339558573854, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 4.982233502538071, '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': '673987', 'n_tokens_mistral': 864, 'n_tokens_neox': 774, 'n_words': 137}