<commit_before><?php
/**
 * HeadingLevelSlider plugin for Craft CMS 3.x
 *
 * Slide level of HTML hx(h1-h6) tag 
 *
 * @link      https://www.anothersky.pw
 * @copyright Copyright (c) 2017 <NAME>
 */

namespace hidekia\headinglevelslider\twigextensions;

use hidekia\headinglevelslider\HeadingLevelSlider;

use Craft;

/**
 * Twig can be extended in many ways; you can add extra tags, filters, tests, operators,
 * global variables, and functions. You can even extend the parser itself with
 * node visitors.
 *
 * http://twig.sensiolabs.org/doc/advanced.html
 *
 * @author    <NAME>
 * @package   HeadingLevelSlider
 * @since     1.0.0
 */
class HeadingLevelSliderTwigExtension extends \Twig_Extension
{
    // Public Methods
    // =========================================================================

    /**
     * Returns the name of the extension.
     *
     * @return string The extension name
     */
    public function getName()
    {
        return 'HeadingLevelSlider';
    }

    /**
     * Returns an array of Twig filters, used in Twig templates via:
     *
     *      {{ 'something' | someFilter }}
     *
     * @return array
     */
    public function getFilters()
    {
        return [
            new \Twig_SimpleFilter('hnSlider', [$this, 'hnSlider'], array(
            'is_safe' => array('html'))),
        ];
    }

    /**
     * Returns an array of Twig functions, used in Twig templates via:
     *
     *      {% set this = someFunction('something') %}
     *
    * @return array
     */
    public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction('hnSlider', [$this, 'hnSlider']),
        ];
    }

    /**
     * 
     *
     * @param string $html
     * @param int $minLevel
     *
     * @return string
     */
    /**
     * @return string
     */
    public function hnSlider($html, $minLevel = 2)
    {
        $meta = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
        $result = \Vikpe\HtmlHeadingNormalizer::min($meta . $html, $minLevel);
        $result = str_replace($meta, '', $result);

        return $result;
    }
}<commit_msg>配列のコーディング方法を変更<commit_after><?php
/**
 * HeadingLevelSlider plugin for Craft CMS 3.x
 *
 * Slide level of HTML hx(h1-h6) tag 
 *
 * @link      https://www.anothersky.pw
 * @copyright Copyright (c) 2017 <NAME>
 */

namespace hidekia\headinglevelslider\twigextensions;

use hidekia\headinglevelslider\HeadingLevelSlider;

use Craft;

/**
 * Twig can be extended in many ways; you can add extra tags, filters, tests, operators,
 * global variables, and functions. You can even extend the parser itself with
 * node visitors.
 *
 * http://twig.sensiolabs.org/doc/advanced.html
 *
 * @author    <NAME>
 * @package   HeadingLevelSlider
 * @since     1.0.0
 */
class HeadingLevelSliderTwigExtension extends \Twig_Extension
{
    // Public Methods
    // =========================================================================

    /**
     * Returns the name of the extension.
     *
     * @return string The extension name
     */
    public function getName()
    {
        return 'HeadingLevelSlider';
    }

    /**
     * Returns an array of Twig filters, used in Twig templates via:
     *
     *      {{ 'something' | someFilter }}
     *
     * @return array
     */
    public function getFilters()
    {
        return [
            new \Twig_SimpleFilter('hnSlider', [$this, 'hnSlider'], [
            'is_safe' => ['html']]),
        ];
    }

    /**
     * Returns an array of Twig functions, used in Twig templates via:
     *
     *      {% set this = someFunction('something') %}
     *
    * @return array
     */
    public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction('hnSlider', [$this, 'hnSlider'], [
            'is_safe' => ['html']]),
        ];
    }

    /**
     * 
     *
     * @param string $html
     * @param int $minLevel
     *
     * @return string
     */
    /**
     * @return string
     */
    public function hnSlider($html, $minLevel = 2)
    {
        $meta = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
        $result = \Vikpe\HtmlHeadingNormalizer::min($meta . $html, $minLevel);
        $result = str_replace($meta, '', $result);

        return $result;
    }
}
{'fraction_non_alphanumeric': 0.16106604866743918, 'fraction_numerical': 0.005561993047508691, 'mean_word_length': 2.2721758908263836, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4736268', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1299, 'n_words': 327}