<commit_before><?php
/*
 * This file was delivered to you as part of the Yucca package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Yucca\Component\Selector;

class Ids implements SelectorInterface {
    /**
     * @var array
     */
    protected $ids;

    protected $keyName;

    /**
     * @param array $ids
     * @param string $keyName
     */
    public function __construct(array $ids, $keyName = null) {
        $this->ids = $ids;
        $this->keyName = $keyName ;
    }

    /**
     * @return mixed
     */
    public function current()
    {
        if(isset($this->keyName)) {
            return array($this->keyName => current($this->ids));
        } else {
            return current($this->ids);
        }
    }

    /**
     *
     */
    public function next()
    {
        next($this->ids);
    }

    /**
     *
     */
    public function key()
    {
        return key($this->ids);
    }

    /**
     *
     */
    public function valid()
    {
        return ( false !== current($this->ids) );
    }

    /**
     *
     */
    public function rewind()
    {
        reset($this->ids);
    }

    /**
     *
     */
    public function count()
    {
        count($this->ids);
    }

    /**
     * @return null
     */
    public function currentShardingKey()
    {
        return null;
    }
}
<commit_msg>[IDS] Fix IDs selector count result<commit_after><?php
/*
 * This file was delivered to you as part of the Yucca package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Yucca\Component\Selector;

class Ids implements SelectorInterface {
    /**
     * @var array
     */
    protected $ids;

    protected $keyName;

    /**
     * @param array $ids
     * @param string $keyName
     */
    public function __construct(array $ids, $keyName = null) {
        $this->ids = $ids;
        $this->keyName = $keyName ;
    }

    /**
     * @return mixed
     */
    public function current()
    {
        if(isset($this->keyName)) {
            return array($this->keyName => current($this->ids));
        } else {
            return current($this->ids);
        }
    }

    /**
     *
     */
    public function next()
    {
        next($this->ids);
    }

    /**
     *
     */
    public function key()
    {
        return key($this->ids);
    }

    /**
     *
     */
    public function valid()
    {
        return ( false !== current($this->ids) );
    }

    /**
     *
     */
    public function rewind()
    {
        reset($this->ids);
    }

    /**
     *
     */
    public function count()
    {
        return count($this->ids);
    }

    /**
     * @return null
     */
    public function currentShardingKey()
    {
        return null;
    }
}

{'fraction_non_alphanumeric': 0.14348561759729273, 'fraction_numerical': 0.0, 'mean_word_length': 1.595258999122037, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, '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': '2998532', 'n_tokens_mistral': 900, 'n_tokens_neox': 881, 'n_words': 216}