original_string: public function period(string $period)
      {
          if (!in_array($period, Constants::PERIODS)) {
              throw new InvalidPeriodException('Request period is not valid. Valid values are defined in \Barryvanveen\Lastfm\Constants::PERIODS.');
          }
  
          $this->query = array_merge($this->query ?? [], ['period' => $period]);
  
          return $this;
      }
code: public function period(string $period)
      {
          if (!in_array($period, Constants::PERIODS)) {
              throw new InvalidPeriodException('Request period is not valid. Valid values are defined in \Barryvanveen\Lastfm\Constants::PERIODS.');
          }
  
          $this->query = array_merge($this->query ?? [], ['period' => $period]);
  
          return $this;
      }
code_tokens: public function period ( string $ period ) { if ( ! in_array ( $ period , Constants :: PERIODS ) ) { throw new InvalidPeriodException ( 'Request period is not valid. Valid values are defined in \Barryvanveen\Lastfm\Constants::PERIODS.' ) ; } $ this -> query = array_merge ( $ this -> query ?? [ ] , [ 'period' => $ period ] ) ; return $ this ; }
docstring: Set or overwrite the period requested from the Last.fm API.
  
  @param string $period
  
  @throws InvalidPeriodException
  
  @return $this
docstring_tokens: Set or overwrite the period requested from the Last . fm API .