$parts[0], 'type' => $parts[1], 'id' => $parts[2], ]; } else { return ['provider' => null, 'type' => null, 'id' => null]; } } public static function decodeTmdbIdOrFail(string $encodedId): array { [$provider, $type, $id] = array_values( static::decodeTmdbId($encodedId), ); if (!$provider || !$type || !$id) { abort(404); } return [(int) $id, $type]; } }