<commit_before><?php

namespace Flynt;

use RecursiveDirectoryIterator;

class Bootstrap
{

    public static function setTemplateDirectory()
    {

        add_action('after_switch_theme', function () {
            $stylesheet = get_option('stylesheet');

            if (basename($stylesheet) !== 'templates') {
                update_option('stylesheet', $stylesheet . '/templates');
            }
        });

        add_filter('stylesheet', function ($stylesheet) {
            return dirname($stylesheet);
        });
    }

    public static function checkPlugin()
    {

        $pluginActive = class_exists('\\Flynt\\Render');

        if (!$pluginActive) {
            add_action('admin_notices', function () {
                echo '<div class="error"><p>Flynt Core Plugin not activated. Make sure you activate the plugin in <a href="'
                . esc_url(admin_url('plugins.php#flynt')) . '">'
                . esc_url(admin_url('plugins.php')) . '</a></p></div>';
            });

            add_filter('template_include', function () {
                $newTemplate = locate_template(array('plugin-inactive.php'));
                if ('' != $newTemplate) {
                    return $newTemplate;
                } else {
                    return 'Flynt Core Plugin not activated! Please <a href="'
                    . esc_url(admin_url('plugins.php'))
                    . '">activate the plugin</a> and reload the page.';
                }
            });
        }

        return $pluginActive;
    }
}<commit_msg>style(lib/Bootstrap): fix code style<commit_after><?php

namespace Flynt;

class Bootstrap
{
    public static function setTemplateDirectory()
    {
        add_action('after_switch_theme', function () {
            $stylesheet = get_option('stylesheet');

            if (basename($stylesheet) !== 'templates') {
                update_option('stylesheet', $stylesheet . '/templates');
            }
        });

        add_filter('stylesheet', function ($stylesheet) {
            return dirname($stylesheet);
        });
    }

    public static function checkPlugin()
    {
        $pluginActive = class_exists('\\Flynt\\Render');

        if (!$pluginActive) {
            add_action('admin_notices', function () {
                echo '<div class="error"><p>Flynt Core Plugin not activated. Make sure you activate the plugin in <a href="'
                    . esc_url(admin_url('plugins.php#flynt')) . '">'
                    . esc_url(admin_url('plugins.php')) . '</a></p></div>';
            });

            add_filter('template_include', function () {
                $newTemplate = locate_template(['plugin-inactive.php']);
                if ('' != $newTemplate) {
                    return $newTemplate;
                } else {
                    return 'Flynt Core Plugin not activated! Please <a href="'
                        . esc_url(admin_url('plugins.php'))
                        . '">activate the plugin</a> and reload the page.';
                }
            });
        }

        return $pluginActive;
    }
}
{'fraction_non_alphanumeric': 0.13503886010362695, 'fraction_numerical': 0.0, 'mean_word_length': 1.7803780378037803, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '5854852', 'n_tokens_mistral': 814, 'n_tokens_neox': 759, 'n_words': 167}