public function getFavouriteShow(string $name): Stream
    {
        $roughMatch = false;

        $shows = $this->getFavouriteShows();
        foreach ($shows as $show) {
            if ($show->getTitle() === $name) {
                return $show;
            }
            if (strtolower($show->getTitle()) === strtolower($name)) {
                $roughMatch = $show;
            }
        }

        if ($roughMatch) {
            return $roughMatch;
        }

        throw new NotFoundException("Unable to find a radio show by the name '{$name}'");
    }
public function getFavouriteShow(string $name): Stream
    {
        $roughMatch = false;

        $shows = $this->getFavouriteShows();
        foreach ($shows as $show) {
            if ($show->getTitle() === $name) {
                return $show;
            }
            if (strtolower($show->getTitle()) === strtolower($name)) {
                $roughMatch = $show;
            }
        }

        if ($roughMatch) {
            return $roughMatch;
        }

        throw new NotFoundException("Unable to find a radio show by the name '{$name}'");
    }
public function getFavouriteShow ( string $ name ) : Stream { $ roughMatch = false ; $ shows = $ this -> getFavouriteShows ( ) ; foreach ( $ shows as $ show ) { if ( $ show -> getTitle ( ) === $ name ) { return $ show ; } if ( strtolower ( $ show -> getTitle ( ) ) === strtolower ( $ name ) ) { $ roughMatch = $ show ; } } if ( $ roughMatch ) { return $ roughMatch ; } throw new NotFoundException ( "Unable to find a radio show by the name '{$name}'" ) ; }
Get the favourite radio show with the specified name.

If no case-sensitive match is found it will return a case-insensitive match.

@param string $name The name of the show

@return Stream
Get the favourite radio show with the specified name .