Repository: symfony/symfony
File: src/Symfony/Component/Translation/Bridge/Crowdin/CrowdinProvider.php (PHP)

Code before:
            if (!$fileId) {
                continue;
            }

            $sourceFileInfo = $this->downloadSourceFile($fileId);
            $sourceFile = $this->client->request('GET', $sourceFileInfo->toArray()['data']['url']);

            $providerCatalogue = $this->loader->load($sourceFile->getContent(), $this->defaultLocale, $domain);
            $existingMessages = array_diff($providerCatalogue->all($domain), $messages);

            $content = $this->xliffFileDumper->formatCatalogue(
                new MessageCatalogue($this->defaultLocale, [$domain => $existingMessages]),
                $domain,
                ['default_locale' => $this->defaultLocale],
            );

            try {
                $file = $this->updateFile($fileId, $domain, $content);

                if (null === $file) {
                    $this->logger->warning(
                        \sprintf('Unable to delete strings in file "%d" and domain "%s".', $fileId, $domain)
                    );
                }
            } catch (ProviderException $e) {
                throw new ProviderException(\sprintf('Unable to delete strings in file "%d" and domain "%s": "%s".', $fileId, $domain, $e->getMessage()), $e->getResponse(), previous: $e);
            }
        }
    }

    private function getFileIdByDomain(array $filesMap, string $domain): ?int
    {
        return $filesMap[\sprintf('%s.%s', $domain, 'xlf')] ?? null;
    }

    private function addFile(string $domain, string $content): ?array
    {
        $storageId = $this->addStorage($domain, $content);

        /**
         * @see https://developer.crowdin.com/api/v2/#operation/api.projects.files.getMany (Crowdin API)
         * @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.files.getMany (Crowdin Enterprise API)
         */
        $response = $this->client->request('POST', 'files', [
            'json' => [
                'storageId' => $storageId,
                'name' => \sprintf('%s.%s', $domain, 'xlf'),
            ],
        ]);

        if (201 !== $statusCode = $response->getStatusCode()) {

Review comment (suggestion):
Exception message should be updated to match the new "update file" operation.

Code after:
            if (!$fileId) {
                continue;
            }

            $sourceFileInfo = $this->downloadSourceFile($fileId);
            $sourceFile = $this->client->request('GET', $sourceFileInfo->toArray()['data']['url']);

            $providerCatalogue = $this->loader->load($sourceFile->getContent(), $this->defaultLocale, $domain);
            $existingMessages = array_diff($providerCatalogue->all($domain), $messages);

            $content = $this->xliffFileDumper->formatCatalogue(
                new MessageCatalogue($this->defaultLocale, [$domain => $existingMessages]),
                $domain,
                ['default_locale' => $this->defaultLocale],
            );

            try {
                $file = $this->updateFile($fileId, $domain, $content);

                if (null === $file) {
                    $this->logger->warning(
                        \sprintf('Unable to update file "%d" and domain "%s".', $fileId, $domain)
                    );
                }
            } catch (ProviderException $e) {
                throw new ProviderException(\sprintf('Unable to update file "%d" and domain "%s": "%s".', $fileId, $domain, $e->getMessage()), $e->getResponse(), previous: $e);
            }
        }
    }

    private function getFileIdByDomain(array $filesMap, string $domain): ?int
    {
        return $filesMap[\sprintf('%s.%s', $domain, 'xlf')] ?? null;
    }

    private function addFile(string $domain, string $content): ?array
    {
        $storageId = $this->addStorage($domain, $content);

        /**
         * @see https://developer.crowdin.com/api/v2/#operation/api.projects.files.getMany (Crowdin API)
         * @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.files.getMany (Crowdin Enterprise API)
         */
        $response = $this->client->request('POST', 'files', [
            'json' => [
                'storageId' => $storageId,
                'name' => \sprintf('%s.%s', $domain, 'xlf'),
            ],
        ]);

        if (201 !== $statusCode = $response->getStatusCode()) {