<commit_before><?php

namespace Wasabi\Core\Routing;

class RouteTypes {

    const TYPE_DEFAULT_ROUTE  = 1;
    const TYPE_REDIRECT_ROUTE = 2;

    /**
     * Determines if the route types singleton has been initialized.
     *
     * @var boolean
     */
    protected static $_initialized = false;

    /**
     * Holds all available route types.
     *
     * @var array
     */
    protected static $_routeTypes = [];

    /**
     * Initialization
     */
    protected static function _init()
    {
        self::$_routeTypes = [
            self::TYPE_DEFAULT_ROUTE => __d('wasabi_core', 'Default Route'),
            self::TYPE_REDIRECT_ROUTE => __d('wasabi_core', 'Redirect Route')
        ];

        self::$_initialized = true;
    }

    /**
     * Get the translated name of a route type with the given $routeTypeId.
     *
     * @param int|string $routeTypeId
     * @return bool|string
     */
    public static function get($routeTypeId)
    {
        if (!self::$_initialized) {
            self::_init();
        }

        $routeTypeId = (int) $routeTypeId;

        if (isset(self::$_routeTypes[$routeTypeId])) {
            return self::$_routeTypes[$routeTypeId];
        }

        return false;
    }
}<commit_msg>add static getter for route types (getForSelect)<commit_after><?php

namespace Wasabi\Core\Routing;

class RouteTypes {

    const TYPE_DEFAULT_ROUTE  = 1;
    const TYPE_REDIRECT_ROUTE = 2;

    /**
     * Determines if the route types singleton has been initialized.
     *
     * @var boolean
     */
    protected static $_initialized = false;

    /**
     * Holds all available route types.
     *
     * @var array
     */
    protected static $_routeTypes = [];

    /**
     * Initialization
     */
    protected static function _init()
    {
        self::$_routeTypes = [
            self::TYPE_DEFAULT_ROUTE => __d('wasabi_core', 'Default Route'),
            self::TYPE_REDIRECT_ROUTE => __d('wasabi_core', 'Redirect Route')
        ];

        self::$_initialized = true;
    }

    /**
     * Get the translated name of a route type with the given $routeTypeId.
     *
     * @param int|string $routeTypeId
     * @return bool|string
     */
    public static function get($routeTypeId)
    {
        if (!self::$_initialized) {
            self::_init();
        }

        $routeTypeId = (int) $routeTypeId;

        if (isset(self::$_routeTypes[$routeTypeId])) {
            return self::$_routeTypes[$routeTypeId];
        }

        return false;
    }

    /**
     * Get all route types for a select.
     *
     * @return array
     */
    public static function getForSelect()
    {
        if (!self::$_initialized) {
            self::_init();
        }

        return self::$_routeTypes;
    }
}
{'fraction_non_alphanumeric': 0.1183068017366136, 'fraction_numerical': 0.001447178002894356, 'mean_word_length': 2.0284775465498357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7119529', 'n_tokens_mistral': 819, 'n_tokens_neox': 814, 'n_words': 194}