src/SpotifyWebAPI.php
protected function idToUri($ids, $type)
    {
        $type = 'spotify:' . $type . ':';

        $ids = array_map(function ($id) use ($type) {
            if (substr($id, 0, strlen($type)) != $type) {
                $id = $type . $id;
            }

            return $id;
        }, (array) $ids);

        return (count($ids) == 1) ? $ids[0] : $ids;
    }
protected function idToUri($ids, $type)
    {
        $type = 'spotify:' . $type . ':';

        $ids = array_map(function ($id) use ($type) {
            if (substr($id, 0, strlen($type)) != $type) {
                $id = $type . $id;
            }

            return $id;
        }, (array) $ids);

        return (count($ids) == 1) ? $ids[0] : $ids;
    }
protected function idToUri ( $ ids , $ type ) { $ type = 'spotify:' . $ type . ':' ; $ ids = array_map ( function ( $ id ) use ( $ type ) { if ( substr ( $ id , 0 , strlen ( $ type ) ) != $ type ) { $ id = $ type . $ id ; } return $ id ; } , ( array ) $ ids ) ; return ( count ( $ ids ) == 1 ) ? $ ids [ 0 ] : $ ids ; }
Convert Spotify object IDs to Spotify URIs.

@param array|string $ids ID(s) to convert.
@param string $type Spotify object type.

@return array|string Spotify URI(s).
Convert Spotify object IDs to Spotify URIs .