<commit_before><?php

if (!class_exists('CM_WP_Element_Shortcode')) {

    class CM_WP_Element_Shortcode extends CM_WP_Element {
        
        /***************************************
         * Static factory properties & methods *
         ***************************************/
        
        /**
         * Stores all the registered shortcodes
         * @var array
         */
        static protected $registered_shortcodes = array();

        /**
         * Registers a shorcode with WordPress, returning a CM_WP_Element_Shortcode
         * object for further configuring the shortcode functionality
         *
         * @param CM_WP_Core $owner     Plugin/theme that this shortcode belongs to
         * @param string     $shortcode The string that will be the shortcode
         * 
         * @return CM_WP_Element_Shortcode
         */
        static public function register( CM_WP_Base $owner, $shortcode ) {

            if ( ! isset( self::$registered_shortcodes[$shortcode] ) ) {
                $class = get_called_class();
                self::$registered_shortcodes[$shortcode] = new $class(
                    $owner,
                    $shortcode
                );
            }

            return self::$registered_shortcodes[$shortcode];
        }



        /*******************************
         * Object properties & methods *
         *******************************/

        /**
         * Callback used to return content of the shortcode
         * @var callable
         */
        protected $handler;

        /**
         * Default attributes for the shortcode
         * @var array
         */
        protected $default_attributes = array();

        /**
         * Flag to indicate whether the shortcode has actually been added to
         * WordPress.
         *
         * @var bool
         */
        protected $is_added = false;


        /**
         * Sets the owning plugin/theme that this shortcode belongs to
         */
        public function __construct( CM_WP_Core $owner, $shortcode ) {
            parent::__construct( $owner );

            add_shortcode( $shortcode, array( $this, 'so_shortcode' ) );
        }


        /**
         * Sets the default attributes for the shortcode
         *<commit_msg>Corrected a couple of typos in Shorcode constructor<commit_after><?php

if (!class_exists('CM_WP_Element_Shortcode')) {

    class CM_WP_Element_Shortcode extends CM_WP_Element {
        
        /***************************************
         * Static factory properties & methods *
         ***************************************/
        
        /**
         * Stores all the registered shortcodes
         * @var array
         */
        static protected $registered_shortcodes = array();

        /**
         * Registers a shorcode with WordPress, returning a CM_WP_Element_Shortcode
         * object for further configuring the shortcode functionality
         *
         * @param CM_WP_Core $owner     Plugin/theme that this shortcode belongs to
         * @param string     $shortcode The string that will be the shortcode
         * 
         * @return CM_WP_Element_Shortcode
         */
        static public function register( CM_WP_Base $owner, $shortcode ) {

            if ( ! isset( self::$registered_shortcodes[$shortcode] ) ) {
                $class = get_called_class();
                self::$registered_shortcodes[$shortcode] = new $class(
                    $owner,
                    $shortcode
                );
            }

            return self::$registered_shortcodes[$shortcode];
        }



        /*******************************
         * Object properties & methods *
         *******************************/

        /**
         * Callback used to return content of the shortcode
         * @var callable
         */
        protected $handler;

        /**
         * Default attributes for the shortcode
         * @var array
         */
        protected $default_attributes = array();

        /**
         * Flag to indicate whether the shortcode has actually been added to
         * WordPress.
         *
         * @var bool
         */
        protected $is_added = false;


        /**
         * Sets the owning plugin/theme that this shortcode belongs to
         */
        public function __construct( CM_WP_Base $owner, $shortcode ) {
            parent::__construct( $owner );

            add_shortcode( $shortcode, array( $this, 'do_shortcode' ) );
        }


        /**
         * Sets the default attributes for the shortcode
         *
{'fraction_non_alphanumeric': 0.13737461840383777, 'fraction_numerical': 0.0, 'mean_word_length': 1.7368735083532219, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4417187', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1067, 'n_words': 303}