<commit_before><?php

namespace Ammezie\Paystack;

use Illuminate\Support\ServiceProvider;
use MAbiola\Paystack\Paystack;

class PaystackServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        $this->publishes([
            __DIR__.'/../config/paystack.php' => config_path('paystack-laravel.php'),
        ]);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('paystack-laravel', function($app) {
            $config = $app['config']->get('paystack');
            
            if(!$config){
                throw new \RuntimeException('Missing Paystack configuration. Please run `php artisan vendor:publish`');
            }

            return Paystack::make($config['secret_key']);
        });

    }

     /**
    * Get the services provided by the provider
    * @return array
    */
    public function provides()
    {
        return ['paystack-laravel'];
    }
}
<commit_msg>use paystack mode in ServiceProvider<commit_after><?php

namespace Ammezie\Paystack;

use Illuminate\Support\ServiceProvider;
use MAbiola\Paystack\Paystack;

class PaystackServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        $this->publishes([
            __DIR__.'/../config/paystack.php' => config_path('paystack-laravel.php'),
        ]);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('paystack-laravel', function($app) {
            $config = $app['config']->get('paystack');
            
            if (! $config) {
                throw new \RuntimeException('Missing Paystack configuration.');
            }

            if ($config['paystack_mode'] == 'test') {
                return Paystack::make($config['test_secret_key']);
            }

            return Paystack::make($config['live_secret_key']);
        });

    }

     /**
    * Get the services provided by the provider
    * @return array
    */
    public function provides()
    {
        return ['paystack-laravel'];
    }
}

{'fraction_non_alphanumeric': 0.13190578158458244, 'fraction_numerical': 0.0, 'mean_word_length': 2.0416666666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2207646', 'n_tokens_mistral': 648, 'n_tokens_neox': 638, 'n_words': 131}