From a9dde3ba08822d9bc51c153632b890280742ce5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20von=20B=C3=BCren?= Date: Mon, 25 Nov 2024 10:20:18 +0100 Subject: [PATCH 1/2] the documentation was wrong --- src/Service/PolisClient.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Service/PolisClient.php b/src/Service/PolisClient.php index 43582ec..093c88b 100644 --- a/src/Service/PolisClient.php +++ b/src/Service/PolisClient.php @@ -24,17 +24,9 @@ public function __construct( ) { } - private function translatePolisLanguageCode(string $languageCode): string - { - return match ($languageCode) { - 'rm' => 'rr', - default => $languageCode, - }; - } - public function fetchPolisCaseByVotationId(int $id, string $language): PolisCase { - $votationResponse = $this->client->request('GET', sprintf('/polis-api/v2/votations/%s?lang=%s', $id, $this->translatePolisLanguageCode($language))); + $votationResponse = $this->client->request('GET', sprintf('/polis-api/v2/votations/%s?lang=%s', $id, $language)); $data = $votationResponse->toArray(); $case = []; @@ -99,12 +91,12 @@ public function fetchPolisCaseByVotationId(int $id, string $language): PolisCase public function fetchPolisVotationById(int $id, string $language): PolisVotation { - return $this->fetchPolisCaseByVotationId($id, $this->translatePolisLanguageCode($language))->votations[0]; + return $this->fetchPolisCaseByVotationId($id, $language)->votations[0]; } public function fetchPolisCaseById(int $id, string $language = 'de'): PolisCase { - $caseData = $this->client->request('GET', sprintf('/polis-api/v2/cases/%s?lang=%s', $id, $this->translatePolisLanguageCode($language))); + $caseData = $this->client->request('GET', sprintf('/polis-api/v2/cases/%s?lang=%s', $id, $language)); $data = $caseData->toArray(); return $this->denormalizePolisCase($data['Case'][0]); @@ -114,7 +106,7 @@ public function fetchPolisCases(string $language = 'de', bool $onlyActive = true { $caseData = $this->client->request('GET', sprintf( '/polis-api/v2/cases?lang=%s&listAllCases=%s', - $this->translatePolisLanguageCode($language), + $language, $onlyActive ? 'false' : 'true' )); $data = $caseData->toArray(); From 3575ec74cee10ea63298084e23e022561a6216e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20von=20B=C3=BCren?= Date: Mon, 25 Nov 2024 10:37:40 +0100 Subject: [PATCH 2/2] no container linter when no real symfony --- .github/workflows/lint-container.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/lint-container.yml diff --git a/.github/workflows/lint-container.yml b/.github/workflows/lint-container.yml deleted file mode 100644 index 547055d..0000000 --- a/.github/workflows/lint-container.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: PHP Container Linter - -on: [pull_request] - -jobs: - container-linter: - runs-on: ubuntu-latest - steps: - # Checkout - - name: Checkout - uses: actions/checkout@v4 - - # PHP - - uses: ./.github/actions/php - - # Composer - - uses: ramsey/composer-install@v3 - - # Lint - - run: php bin/console lint:container