<commit_before><?php

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

namespace CRUDlex;

use Pimple\Container;

/**
 * Provides and setups the Twig extensions like filters.
 */
class TwigExtensions {

    /**
     * Registers all extensions.
     *
     * @param Container $app
     * the current application
     */
    public function registerTwigExtensions(Container $app) {
        $self = $this;
        $app->extend('twig', function($twig, $app) use ($self) {
            $twig->addFilter(new \Twig_SimpleFilter('arrayColumn', [$self, 'arrayColumn']));
            return $twig;
        });
    }
    /**
     * To have array_column available as Twig filter.
     *
     * @param $array
     * the array
     * @param $key
     * the key
     *
     * @return array
     * the resulting array
     */
    public function arrayColumn($array, $key) {
        return array_column($array, $key);
    }

}
<commit_msg>added missing type hints<commit_after><?php

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

namespace CRUDlex;

use Pimple\Container;

/**
 * Provides and setups the Twig extensions like filters.
 */
class TwigExtensions {

    /**
     * Registers all extensions.
     *
     * @param Container $app
     * the current application
     */
    public function registerTwigExtensions(Container $app) {
        $self = $this;
        $app->extend('twig', function(\Twig_Environment $twig, Container $app) use ($self) {
            $twig->addFilter(new \Twig_SimpleFilter('arrayColumn', [$self, 'arrayColumn']));
            return $twig;
        });
    }
    /**
     * To have array_column available as Twig filter.
     *
     * @param $array
     * the array
     * @param $key
     * the key
     *
     * @return array
     * the resulting array
     */
    public function arrayColumn($array, $key) {
        return array_column($array, $key);
    }

}

{'fraction_non_alphanumeric': 0.11938266000907853, 'fraction_numerical': 0.0, 'mean_word_length': 2.3855606758832564, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '1759478', 'n_tokens_mistral': 655, 'n_tokens_neox': 649, 'n_words': 201}