<commit_before><?php

/*
 * This file is part of the Cometwpp package.
 *
 * (c) <NAME> [comet.by] <EMAIL>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Cometwpp\Core;

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}

/**
 * Including js files As Is
 * @package Cometwpp
 * @subpackage Core
 * @category Class
 */
class JsProvider extends ResGraber
{
    /**
     * @param string $dirPath : path to target dir, who will be as root for "queries"
     */
    public function __construct($dirPath)
    {
        parent::__construct(['dir_path' => (string)$dirPath, 'ext' => 'js',]);
    }

    /**
     * Try to register script with WP functions
     * @param $name
     * @param array $dependence
     * @return string
     */
    public function registerSript($name, $dependence = [], $bInFooter = true)
    {
        $regName = $this->getClearName($name);
        $version = false; // don't use it yet

        $url = $this->getUrl($name);
        assert(false !== $url);
        if (false !== $url) {
            wp_register_script($regName, $url, $dependence, $version, $bInFooter);
            wp_enqueue_script($regName);
        }<commit_msg>fix registerScript func name<commit_after><?php

/*
 * This file is part of the Cometwpp package.
 *
 * (c) <NAME> [comet.by] <EMAIL>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Cometwpp\Core;

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}

/**
 * Including js files As Is
 * @package Cometwpp
 * @subpackage Core
 * @category Class
 */
class JsProvider extends ResGraber
{
    /**
     * @param string $dirPath : path to target dir, who will be as root for "queries"
     */
    public function __construct($dirPath)
    {
        parent::__construct(['dir_path' => (string)$dirPath, 'ext' => 'js',]);
    }

    /**
     * Try to register script with WP functions
     * @param $name
     * @param array $dependence
     * @return string
     */
    public function registerScript($name, $dependence = [], $bInFooter = true)
    {
        $regName = $this->getClearName($name);
        $version = false; // don't use it yet

        $url = $this->getUrl($name);
        assert(false !== $url);
        if (false !== $url) {
            wp_register_script($regName, $url, $dependence, $version, $bInFooter);
            wp_enqueue_script($regName);
        }
{'fraction_non_alphanumeric': 0.13725490196078433, 'fraction_numerical': 0.0, 'mean_word_length': 2.675792507204611, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '735602', 'n_tokens_mistral': 794, 'n_tokens_neox': 778, 'n_words': 239}