<commit_before><?php

namespace Sober\Intervention\Admin\Support;

use Sober\Intervention\Admin\Support\Maps;
use Sober\Intervention\Admin\Support\Menu;

/**
 * Support/Router
 *
 * @package WordPress
 * @subpackage Intervention
 * @since 2.0.0
 *
 * @link https://developer.wordpress.org/reference/hooks/admin_init/
 * @link https://developer.wordpress.org/reference/functions/wp_redirect/
 */
class Router
{
    protected $routes;
    protected $route = false;

    /**
     * Interface
     *
     * @param string $key
     * @return Sober\Intervention\Admin\Support\Router
     */
    public static function set($key = '')
    {
        return new self($key);
    }

    /**
     * Initialize
     *
     * @param string $key
     */
    public function __construct($key = false)
    {
        $this->key = $key;
    }

    /**
     * Route
     *
     * @param string $str
     */
    public function route($str)
    {
        // Support for shorthand/true
        $value = $str === true ? 'posts' : $str;

        if (!Maps::set('screens')->get($value)) {
            return;
        }

        $this->route = Maps::set('screens')->get($value);

        // Route
        add_action('admin_init', function () {
            if (Maps::set('screens')->get($this->key) === $GLOBALS['pagenow']) {<commit_msg>Update Router.php<commit_after><?php

namespace Sober\Intervention\Admin\Support;

use Sober\Intervention\Admin\Support\Maps;
use Sober\Intervention\Admin\Support\Menu;

/**
 * Support/Router
 *
 * @package WordPress
 * @subpackage Intervention
 * @since 2.0.0
 *
 * @link https://developer.wordpress.org/reference/hooks/admin_init/
 * @link https://developer.wordpress.org/reference/functions/wp_redirect/
 */
class Router
{
    protected $routes;
    protected $route = false;

    /**
     * Interface
     *
     * @param string $key
     * @return Sober\Intervention\Admin\Support\Router
     */
    public static function set($key = '')
    {
        return new self($key);
    }

    /**
     * Initialize
     *
     * @param string $key
     */
    public function __construct($key = false)
    {
        $this->key = $key;
    }

    /**
     * Route
     *
     * @param string $str
     */
    public function route($str)
    {
        // Support for shorthand/true
        $value = $str === true ? 'posts' : $str;

        if (!Maps::set('screens')->get($value)) {
            return;
        }

        $this->route = Maps::set('screens')->get($value);

        if (wp_doing_ajax()) {
            return;
        }

        // Route
        add_action('admin_init', function () {
            if (Maps::set('screens')->get($this->key) === $GLOBALS['pagenow']) {
{'fraction_non_alphanumeric': 0.15883668903803133, 'fraction_numerical': 0.0022371364653243847, 'mean_word_length': 2.1527614571092832, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 4, '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': '2461848', 'n_tokens_mistral': 855, 'n_tokens_neox': 830, 'n_words': 152}