<commit_before><?php

namespace Phuby\Enumerable;

class InstanceMethods {
    static function initialized($self) {
        $self->alias_method('all?', 'all_query');
        $self->alias_method('any?', 'any_query');
        $self->alias_method('collect', 'map');
        $self->alias_method('find', 'detect');
        $self->alias_method('find_all', 'select');
        $self->alias_method('include?', 'include_query');
        $self->alias_method('member_query', 'include_query');
        $self->alias_method('member?', 'member_query');
        $self->alias_method('none?', 'none_query');
        $self->alias_method('one?', 'one_query');
        $self->alias_method('reduce', 'inject');
    }

    function initialize($native = []) {
        $this->{'@native'} = $native;
    }

    function all_query($block) {
        return $this->{'none?'}(function($object, $key) use ($block) {
            return !$block($object, $key);
        });
    }

    function any_query($block) {
        return !$this->{'none?'}($block);
    }

    function count() {
        return count($this->{'@native'});
    }
<commit_msg>Add Enumerable#entries<commit_after><?php

namespace Phuby\Enumerable;

class InstanceMethods {
    static function initialized($self) {
        $self->alias_method('all?', 'all_query');
        $self->alias_method('any?', 'any_query');
        $self->alias_method('collect', 'map');
        $self->alias_method('entries', 'to_a');
        $self->alias_method('find', 'detect');
        $self->alias_method('find_all', 'select');
        $self->alias_method('include?', 'include_query');
        $self->alias_method('member_query', 'include_query');
        $self->alias_method('member?', 'member_query');
        $self->alias_method('none?', 'none_query');
        $self->alias_method('one?', 'one_query');
        $self->alias_method('reduce', 'inject');
    }

    function initialize($native = []) {
        $this->{'@native'} = $native;
    }

    function all_query($block) {
        return $this->{'none?'}(function($object, $key) use ($block) {
            return !$block($object, $key);
        });
    }

    function any_query($block) {
        return !$this->{'none?'}($block);
    }

    function count() {
        return count($this->{'@native'});
    }

{'fraction_non_alphanumeric': 0.20359806932865293, 'fraction_numerical': 0.0, 'mean_word_length': 3.122965641952984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '3820226', 'n_tokens_mistral': 708, 'n_tokens_neox': 702, 'n_words': 107}