public function getPlaylistByName(string $name): PlaylistInterface
    {
        $roughMatch = false;

        $playlists = $this->getPlaylists();
        foreach ($playlists as $playlist) {
            if ($playlist->getName() === $name) {
                return $playlist;
            }
            if (strtolower($playlist->getName()) === strtolower($name)) {
                $roughMatch = $playlist;
            }
        }

        if ($roughMatch) {
            return $roughMatch;
        }

        throw new NotFoundException("No playlist called '{$name}' exists on this network");
    }
public function getPlaylistByName(string $name): PlaylistInterface
    {
        $roughMatch = false;

        $playlists = $this->getPlaylists();
        foreach ($playlists as $playlist) {
            if ($playlist->getName() === $name) {
                return $playlist;
            }
            if (strtolower($playlist->getName()) === strtolower($name)) {
                $roughMatch = $playlist;
            }
        }

        if ($roughMatch) {
            return $roughMatch;
        }

        throw new NotFoundException("No playlist called '{$name}' exists on this network");
    }
public function getPlaylistByName ( string $ name ) : PlaylistInterface { $ roughMatch = false ; $ playlists = $ this -> getPlaylists ( ) ; foreach ( $ playlists as $ playlist ) { if ( $ playlist -> getName ( ) === $ name ) { return $ playlist ; } if ( strtolower ( $ playlist -> getName ( ) ) === strtolower ( $ name ) ) { $ roughMatch = $ playlist ; } } if ( $ roughMatch ) { return $ roughMatch ; } throw new NotFoundException ( "No playlist called '{$name}' exists on this network" ) ; }
Get the playlist 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 playlist

@return PlaylistInterface
Get the playlist with the specified name .