<commit_before><?php

namespace CalendR\Period;

/**
 * Represents a week
 *
 * @author <NAME> <<EMAIL>>
 */
class Week extends PeriodAbstract implements \Iterator
{
    /**
     * @var null|PeriodInterface
     */
    private $current = null;

    /**
     * @param \DateTime        $start
     * @param FactoryInterface $factory
     *
     * @throws Exception\NotAWeek
     */
    public function __construct(\DateTime $start, $factory = null)
    {
        if (!self::isValid($start)) {
            throw new Exception\NotAWeek;
        }

        $this->begin = clone $start;
        $this->end = clone $start;
        $this->end->add(new \DateInterval('P7D'));

        parent::__construct($factory);
    }

    /**
     * @return int
     */
    public function getNumber()
    {
        return $this->begin->format('W');
    }

    /**
     * Returns the period as a DatePeriod
     *
     * @return \DatePeriod
     */
    public function getDatePeriod()
    {<commit_msg>Update Week Period<commit_after><?php

namespace CalendR\Period;

/**
 * Represents a week
 *
 * @author <NAME> <<EMAIL>>
 */
class Week extends PeriodAbstract implements \Iterator
{
    /**
     * @var null|PeriodInterface
     */
    private $current = null;

    /**
     * @param \DateTime        $start
     * @param FactoryInterface $factory
     *
     * @throws Exception\NotAWeek
     */
    public function __construct(\DateTime $start, $factory = null)
    {
        if (!self::isValid($start)) {
            throw new Exception\NotAWeek;
        }

        $this->begin = clone $start;
        $this->end = clone $start;
        $this->end->add($this->getDateInterval());

        parent::__construct($factory);
    }

    /**
     * @return int
     */
    public function getNumber()
    {
        return $this->begin->format('W');
    }

    /**
     * Returns the period as a DatePeriod
     *
     * @return \DatePeriod
     */
    public function getDatePeriod()
    {
{'fraction_non_alphanumeric': 0.1392984239959329, 'fraction_numerical': 0.0005083884087442806, 'mean_word_length': 2.0091743119266057, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 22, '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': '4483423', 'n_tokens_mistral': 578, 'n_tokens_neox': 571, 'n_words': 133}