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;
    }
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;
    }
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 ; }
Set or overwrite the period requested from the Last.fm API.

@param string $period

@throws InvalidPeriodException

@return $this
Set or overwrite the period requested from the Last . fm API .