<commit_before><?php namespace Barryvdh\Debugbar;


class ServiceProvider extends \Illuminate\Support\ServiceProvider {

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

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $this->package('barryvdh/laravel-debugbar');

        if($this->app['config']->get('laravel-debugbar::config.enabled')){

            /** @var LaravelDebugbar $debugbar */
            $debugbar = $this->app['debugbar'];
            $debugbar->boot();

        }

        $this->commands('command.debugbar.publish');
        $this->commands('command.debugbar.clear');
    }


    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {

        $app = $this->app;
        $this->app['debugbar'] = $this->app->share(function ($app){
                $debugbar = new LaravelDebugBar($app);

                $sessionManager = $app['session'];
                $httpDriver = new SymfonyHttpDriver($sessionManager);
                $debugbar->setHttpDriver($httpDriver);

                return $debugbar;
            });

        $this->app['command.debugbar.publish'] = $this->app->share(function($app)
            {
                //Make sure the asset publisher is registered.
                $app->register('Illuminate\Foundation\Providers\PublisherServiceProvider');
                return new Console\PublishCommand($app['asset.publisher']);
            });

        $this->app['command.debugbar.clear'] = $this->app->share(function($app)
            {
                return new Console\ClearCommand($app['debugbar']);
            });

        if(version_compare($app::VERSION, '4.1', '>=')){
            $app->middleware('Barryvdh\Debugbar\Middleware', array($app));
        }else{
            $app->after(function ($request, $response) use($app)
            {
                $debugbar = $app['debugbar'];
                $debugbar->modifyResponse($request, $response);
            });
        }

        $this->app['router']->get('_debugbar/open', array('as' => 'debugbar.openhandler', function() use($app){

                $debugbar = $app['debugbar'];

                if(!$debugbar->isEnabled()){
                    $this->app->abort('500', 'Debugbar is not enabled');
                }

                $openHandler = new \DebugBar\OpenHandler($debugbar);

                $data = $openHandler->handle(null, false, false);
                return \Response::make($data, 200, array(
                        'Content-Type'=> 'application/json'
                    ));
            }));

    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return array('debugbar', 'command.debugbar.publish', 'command.debugbar.clear');
    }<commit_msg>fix serviceprovider<commit_after><?php namespace Barryvdh\Debugbar;


class ServiceProvider extends \Illuminate\Support\ServiceProvider {

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

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $this->package('barryvdh/laravel-debugbar');

        $app = $this->app;

        if(version_compare($app::VERSION, '4.1', '<')){
            $app->after(function ($request, $response) use($app)
            {
                $debugbar = $app['debugbar'];
                $debugbar->modifyResponse($request, $response);
            });
        }

        $this->app['router']->get('_debugbar/open', array('as' => 'debugbar.openhandler', function() use($app){

            $debugbar = $app['debugbar'];

            if(!$debugbar->isEnabled()){
                $app->abort('500', 'Debugbar is not enabled');
            }

            $openHandler = new \DebugBar\OpenHandler($debugbar);

            $data = $openHandler->handle(null, false, false);
            return \Response::make($data, 200, array(
                'Content-Type'=> 'application/json'
            ));
        }));

        if($this->app['config']->get('laravel-debugbar::config.enabled')){

            /** @var LaravelDebugbar $debugbar */
            $debugbar = $this->app['debugbar'];
            $debugbar->boot();

        }
    }


    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {

        $app = $this->app;
        $this->app['debugbar'] = $this->app->share(function ($app){
                $debugbar = new LaravelDebugBar($app);

                $sessionManager = $app['session'];
                $httpDriver = new SymfonyHttpDriver($sessionManager);
                $debugbar->setHttpDriver($httpDriver);

                return $debugbar;
            });

        $this->app['command.debugbar.publish'] = $this->app->share(function($app)
            {
                //Make sure the asset publisher is registered.
                $app->register('Illuminate\Foundation\Providers\PublisherServiceProvider');
                return new Console\PublishCommand($app['asset.publisher']);
            });

        $this->app['command.debugbar.clear'] = $this->app->share(function($app)
            {
                return new Console\ClearCommand($app['debugbar']);
            });

        $this->commands('command.debugbar.publish');
        $this->commands('command.debugbar.clear');

        if(version_compare($app::VERSION, '4.1', '>=')){
            $app->middleware('Barryvdh\Debugbar\Middleware', array($app));
        }
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return array('debugbar', 'command.debugbar.publish', 'command.debugbar.clear');
    }
{'fraction_non_alphanumeric': 0.15669515669515668, 'fraction_numerical': 0.0030165912518853697, 'mean_word_length': 1.9112195121951219, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 65, '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': '3004963', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1593, 'n_words': 278}