<commit_before><?php
namespace x3\Functional;

class Functional
{
    public static function reverseArgs($method)
    {
        return function() use ($method) {
            return $method(array_reverse(func_get_args()));
        };
    }
    public static function mapMethod($method)
    {
        $args = array_slice(func_get_args(), 1);
        return function($object) use($method, $args) {
            return call_user_func_array(array($object, $method), $args);
        };
    }

    public static function mapAttribute($attribute)
    {
        return function($object) use($attribute) {
            return $object->$attribute;
        };
    }

    public static function groupValues()
    {
        $keys = func_get_args();

        return function($subjects) use ($keys) {<commit_msg>Fix reverseArgs, should use call_user_func_array<commit_after><?php
namespace x3\Functional;

class Functional
{
    public static function reverseArgs($method)
    {
        return function() use ($method) {
            return call_user_func_array($method, array_reverse(func_get_args()));
        };
    }
    public static function mapMethod($method)
    {
        $args = array_slice(func_get_args(), 1);
        return function($object) use($method, $args) {
            return call_user_func_array(array($object, $method), $args);
        };
    }

    public static function mapAttribute($attribute)
    {
        return function($object) use($attribute) {
            return $object->$attribute;
        };
    }

    public static function groupValues()
    {
        $keys = func_get_args();

        return function($subjects) use ($keys) {
{'fraction_non_alphanumeric': 0.11914893617021277, 'fraction_numerical': 0.0024316109422492403, 'mean_word_length': 2.6415929203539825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '600817', 'n_tokens_mistral': 460, 'n_tokens_neox': 451, 'n_words': 103}