<commit_before><?php namespace XdroidTeam\XTrust;

use Illuminate\Support\ServiceProvider;

class XTrustServiceProvider extends ServiceProvider
{

    public function boot()
    {
        // Register blade directives
        $this->bladeDirectives();

        $this->publishes([
            __DIR__.'/../database/migrations' => base_path('database/migrations'),
        ], 'xdroidteam-xtrust');
    }

    public function register()
    {
        //
    }

    private function bladeDirectives()
    {
            // Laravel 5.5 compatibility
            // \Blade::if('permission', function($expression) {
            //     return XTrust::hasPermission($expression);
            // });
            //
            // \Blade::if('permissions', function($expression) {
            //     return XTrust::hasPermissions($expression);
            // });
            //
            // \Blade::if('oneofpermissions', function($expression) {
            //     return XTrust::hasOneOfPermissions($expression);
            // });


            // Laravel 5.5> compatibility
            \Blade::directive('permission', function($expression) {
                return "<?php if (\\XTrust::hasPermission{$expression}) : ?>";
            });

            \Blade::directive('endpermission', function($expression) {
                return "<?php endif; // XTrust::hasPermission ?>";
            });

            \Blade::directive('permissions', function($expression) {
                return "<?php if (\\XTrust::hasPermissions{$expression}) : ?>";
            });

            \Blade::directive('endpermissions', function($expression) {
                return "<?php endif; // XTrust::hasPermissions ?>";
            });


            \Blade::directive('oneofpermissions', function($expression) {
                return "<?php if (\\XTrust::hasOneOfPermissions{$expression}) : ?>";
            });

            \Blade::directive('endoneofpermissions', function($expression) {
                return "<?php endif; // XTrust::hasOneOfPermissions ?>";
            });

    }

}
<commit_msg>5.5 compatibility fix dev<commit_after><?php namespace XdroidTeam\XTrust;

use Illuminate\Support\ServiceProvider;

class XTrustServiceProvider extends ServiceProvider
{

    public function boot()
    {
        // Register blade directives
        $this->bladeDirectives();

        $this->publishes([
            __DIR__.'/../database/migrations' => base_path('database/migrations'),
        ], 'xdroidteam-xtrust');
    }

    public function register()
    {
        //
    }

    private function bladeDirectives()
    {
            // Laravel 5.5 compatibility
            \Blade::if('permission', function($expression) {
                return XTrust::hasPermission($expression);
            });

            \Blade::if('permissions', function($expression) {
                return XTrust::hasPermissions($expression);
            });

            \Blade::if('oneofpermissions', function($expression) {
                return XTrust::hasOneOfPermissions($expression);
            });


            // Laravel 5.5> compatibility
            /*
            \Blade::directive('permission', function($expression) {
                return "<?php if (\\XTrust::hasPermission{$expression}) : ?>";
            });

            \Blade::directive('endpermission', function($expression) {
                return "<?php endif; // XTrust::hasPermission ?>";
            });

            \Blade::directive('permissions', function($expression) {
                return "<?php if (\\XTrust::hasPermissions{$expression}) : ?>";
            });

            \Blade::directive('endpermissions', function($expression) {
                return "<?php endif; // XTrust::hasPermissions ?>";
            });


            \Blade::directive('oneofpermissions', function($expression) {
                return "<?php if (\\XTrust::hasOneOfPermissions{$expression}) : ?>";
            });

            \Blade::directive('endoneofpermissions', function($expression) {
                return "<?php endif; // XTrust::hasOneOfPermissions ?>";
            });
            */

    }

}

{'fraction_non_alphanumeric': 0.14687280393534785, 'fraction_numerical': 0.0023424689622862497, 'mean_word_length': 1.7727272727272727, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '3077017', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1042, 'n_words': 163}