|null */ function extract_params_from_episode_uri(URI $episodeUri): ?array { preg_match( '~@(?P[a-zA-Z0-9\_]{1,32})\/episodes\/(?P[a-zA-Z0-9\-]{1,191})~', $episodeUri->getPath(), $matches, ); if ($matches === []) { return null; } if ( ! array_key_exists('podcastName', $matches) || ! array_key_exists('episodeSlug', $matches) ) { return null; } return [ 'podcastName' => $matches['podcastName'], 'episodeSlug' => $matches['episodeSlug'], ]; } }