<commit_before><?php

namespace axis_framework\includes\bootstraps;

use \axis_framework\includes\core;


abstract class Base_Ajax_Callback extends core\Singleton {

    protected $loader;

    protected function __construct() {
        $this->loader = core\Loader::get_instance();
    }

    public abstract function add_ajax_actions();

    protected function accept_wish_list($wish_list) {

        foreach ( $wish_list as $w ) {
            if ( $w->has_priv() ) {
                add_action( $w->get_hook(), $w->get_callback() );
            }

            if ( $w->has_nopriv() ) {
                add_action( $w->get_hook_nopriv(), $w->get_callback() );
            }
        }

    }

}


/**
 * Class Ajax_Action
 */
class Ajax_Action {

    const PRIV   = 0x01;
    const NOPRIV = 0x02;

    private $hook;
    private $callback;
    private $option;

    function __construct( $hook, $callback, $option = Ajax_Action::PRIV ) {

        $this->hook     = $hook;
        $this->callback = $callback;
        $this->option   = $option;
    }

    public function get_hook() {
        return 'wp_ajax_' . $this->hook;
    }

    public function get_hook_nopriv() {
        return 'wp_ajax_nopriv_' . $this->hook;
    }

    public function get_callback() {
        return $this->callback;
    }

    public function has_priv() {
        return $this->option & Ajax_Action::PRIV;
    }

    public function has_nopriv() {
        return $this->option & Ajax_Action::NOPRIV;
    }
}<commit_msg>&! &!<commit_after><?php

namespace axis_framework\includes\bootstraps;

use \axis_framework\includes\core;


abstract class Base_Ajax_Callback extends core\Singleton {

    protected $loader;

    protected function __construct() {
        $this->loader = core\Loader::get_instance();
    }

    public abstract function add_ajax_actions();

    protected function accept_wish_list($wish_list) {

        foreach ( $wish_list as $w ) {
            if ( $w->has_priv() ) {
                add_action( $w->get_hook(), $w->get_callback() );
            }

            if ( $w->has_nopriv() ) {
                add_action( $w->get_hook_nopriv(), $w->get_callback() );
            }
        }

    }

}


/**
 * Class Ajax_Action
 */
class Ajax_Action {

    const PRIV   = 0x01;
    const NOPRIV = 0x02;

    private $hook;
    private $callback;
    private $option;

    function __construct( $hook, $callback, $option = Ajax_Action::PRIV ) {

        $this->hook     = $hook;
        $this->callback = $callback;
        $this->option   = $option;
    }

    public function get_hook() {
        return 'wp_ajax_' . $this->hook;
    }

    public function get_hook_nopriv() {
        return 'wp_ajax_nopriv_' . $this->hook;
    }

    public function get_callback() {
        return $this->callback;
    }

    public function has_priv() {
        return $this->option && Ajax_Action::PRIV;
    }

    public function has_nopriv() {
        return $this->option && Ajax_Action::NOPRIV;
    }
z}
{'fraction_non_alphanumeric': 0.12963581690611425, 'fraction_numerical': 0.004009355162044771, 'mean_word_length': 2.2332613390928726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '5318180', 'n_tokens_mistral': 998, 'n_tokens_neox': 936, 'n_words': 192}