original_string: protected function generate()
      {
          if ($this->subperiodsProcessed) {
              return;
          }
  
          parent::generate();
          $date = $this->date;
  
          if ($date->toString('N') > 1) {
              $date = $date->subDay($date->toString('N') - 1);
          }
  
          $startWeek = $date;
  
          $currentDay = clone $startWeek;
          while ($currentDay->compareWeek($startWeek) == 0) {
              $this->addSubperiod(new Day($currentDay));
              $currentDay = $currentDay->addDay(1);
          }
      }
code: protected function generate()
      {
          if ($this->subperiodsProcessed) {
              return;
          }
  
          parent::generate();
          $date = $this->date;
  
          if ($date->toString('N') > 1) {
              $date = $date->subDay($date->toString('N') - 1);
          }
  
          $startWeek = $date;
  
          $currentDay = clone $startWeek;
          while ($currentDay->compareWeek($startWeek) == 0) {
              $this->addSubperiod(new Day($currentDay));
              $currentDay = $currentDay->addDay(1);
          }
      }
code_tokens: protected function generate ( ) { if ( $ this -> subperiodsProcessed ) { return ; } parent :: generate ( ) ; $ date = $ this -> date ; if ( $ date -> toString ( 'N' ) > 1 ) { $ date = $ date -> subDay ( $ date -> toString ( 'N' ) - 1 ) ; } $ startWeek = $ date ; $ currentDay = clone $ startWeek ; while ( $ currentDay -> compareWeek ( $ startWeek ) == 0 ) { $ this -> addSubperiod ( new Day ( $ currentDay ) ) ; $ currentDay = $ currentDay -> addDay ( 1 ) ; } }
docstring: Generates the subperiods - one for each day in the week
docstring_tokens: Generates the subperiods - one for each day in the week