<commit_before><?php namespace SocialEngine\SnifferRules;

use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
use SocialEngine\SnifferRules\Command\SniffCommand;

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

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $app = $this->app;

        if ($app::VERSION > '5.0') {
            $this->publishes([
                __DIR__ . '/config/config.php' => config_path('sniffer-rules.php'),
            ]);
        } else {
            $this->package('socialengine/sniffer-rules', null, __DIR__);
        }
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('command.sniffer-rules', function ($app) {
            return new SniffCommand;
        });

        $this->commands('command.sniffer-rules');
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['command.sniffer-rules.sniff'];
    }
}
<commit_msg>Added lumen support - this is not entirely tested in L5 or L4<commit_after><?php namespace SocialEngine\SnifferRules;

use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
use SocialEngine\SnifferRules\Command\SniffCommand;

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

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $app = $this->app;

        $source = realpath(__DIR__ . '/config/config.php');

        if (class_exists('Illuminate\Foundation\Application', false) && $app->runningInConsole()) {
            // L5
            $this->publishes([$source => config_path('sniffer-rules.php')]);
            $this->mergeConfigFrom($source, 'sniffer-rules');
        } elseif (class_exists('Laravel\Lumen\Application', false)) {
            // Lumen
            $app->configure('sniffer-rules');
            $this->mergeConfigFrom($source, 'sniffer-rules');
        } else {
            // L4
            $this->package('socialengine/sniffer-rules', null, __DIR__);
        }
    }


    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('command.sniffer-rules', function ($app) {
            return new SniffCommand;
        });

        $this->commands('command.sniffer-rules');
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['command.sniffer-rules.sniff'];
    }
}

{'fraction_non_alphanumeric': 0.1299797434166104, 'fraction_numerical': 0.002025658338960162, 'mean_word_length': 2.0609504132231407, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '4733536', 'n_tokens_mistral': 841, 'n_tokens_neox': 830, 'n_words': 180}