<commit_before><?php namespace Cornford\Googlmapper;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;

class MapperServiceProvider extends ServiceProvider {

	/**
	 * Indicates if loading of the provider is deferred.
	 *
	 * @var bool
	 */
	protected $defer = false;

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		$this->loadViewsFrom(base_path('resources/views/cornford/googlmapper'), 'googlmapper');

		$this->publishes(
			[
				__DIR__ . '/../../config/config.php' => config_path('googlmapper.php'),
				__DIR__ . '/../../views' => base_path('resources/views/cornford/googlmapper')
			],
			'googlmapper'
		);
	}

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$configPath = __DIR__ . '/../../config/config.php';
		$this->mergeConfigFrom($configPath, 'googlmapper');

		$this->app['mapper'] = $this->app->share(function($app)
		{
			return new Mapper(
				$this->app->view,
				$app['config']->get('googlmapper')
			);
		});
	}

	/**
	 * Get the services provided by the provider.
	 *
	 * @return array
	 */
	public function provides()
	{
		return array('mapper');
	}

}<commit_msg>Updating service provider to utilise app singleton method as app share method has been removed in Laravel 5.4.<commit_after><?php namespace Cornford\Googlmapper;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;

class MapperServiceProvider extends ServiceProvider {

	/**
	 * Indicates if loading of the provider is deferred.
	 *
	 * @var bool
	 */
	protected $defer = false;

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		$this->loadViewsFrom(base_path('resources/views/cornford/googlmapper'), 'googlmapper');

		$this->publishes(
			[
				__DIR__ . '/../../config/config.php' => config_path('googlmapper.php'),
				__DIR__ . '/../../views' => base_path('resources/views/cornford/googlmapper')
			],
			'googlmapper'
		);
	}

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$configPath = __DIR__ . '/../../config/config.php';
		$this->mergeConfigFrom($configPath, 'googlmapper');

        $this->app->singleton(
            'mapper',
            function($app)
            {
                return new Mapper($this->app->view, $app['config']->get('googlmapper'));
            }
        );
	}

	/**
	 * Get the services provided by the provider.
	 *
	 * @return array
	 */
	public function provides()
	{
		return array('mapper');
	}

}
{'fraction_non_alphanumeric': 0.15945945945945947, 'fraction_numerical': 0.0007722007722007722, 'mean_word_length': 2.998456790123457, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '3625977', 'n_tokens_mistral': 932, 'n_tokens_neox': 817, 'n_words': 173}