<commit_before><?php

namespace Benrowe\Laravel\Config;

use Illuminate\Support\Collection;
use Benrowe\Laravel\Config\Modifiers\Modifier;

/**
 *
 */
class ModifierCollection extends Collection
{
    /**
     * Convert the value based on the supplied modifiers
     *
     * @param  string $key       [description]
     * @param  mixed $value     [description]
     * @param  string $direction [description]
     * @return mixed            [description]
     */
    public function convert($key, $value, $direction = Modifier::DIRECTION_TO)
    {
        $method = 'convert'.ucfirst($direction);
        foreach ($this->items as $modifier) {
            if ($modifier->canHandle($value, $direction)) {
                return $modifier->$method($value);
            }
        }
        return $value;
    }
}
<commit_msg>Record modified keys in collection<commit_after><?php

namespace Benrowe\Laravel\Config;

use Illuminate\Support\Collection;
use Benrowe\Laravel\Config\Modifiers\Modifier;

/**
 *
 */
class ModifierCollection extends Collection
{
    private $keys = [];
    /**
     * Convert the value based on the supplied modifiers
     *
     * @param  string $key       [description]
     * @param  mixed $value     [description]
     * @param  string $direction [description]
     * @return mixed            [description]
     */
    public function convert($key, $value, $direction = Modifier::DIRECTION_TO)
    {
        $method = 'convert'.ucfirst($direction);
        foreach ($this->items as $modifier) {
            if ($modifier->canHandle($value, $direction)) {
                $this->keys = $key;
                return $modifier->$method($value);
            }
        }
        return $value;
    }
}

{'fraction_non_alphanumeric': 0.12362159024956472, 'fraction_numerical': 0.0, 'mean_word_length': 2.334622823984526, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '1522894', 'n_tokens_mistral': 487, 'n_tokens_neox': 487, 'n_words': 114}