Skip to content

Commit

Permalink
Merge pull request #2 from mmz-srf/bugfix/string-for-cantonal-majority
Browse files Browse the repository at this point in the history
cantonal results need string for halbkantone
  • Loading branch information
pascalvb authored Nov 27, 2024
2 parents d4c1e81 + 8040581 commit 4f24e2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Model/Polis/PolisCantonalResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
readonly class PolisCantonalResult
{
public function __construct(
public PolisResultAbsolute $absolute,
public PolisResultCantons $absolute,
public PolisResultRelative $relative,
) {
}

public static function createFromArray(array $data): self
{
return new self(
absolute: new PolisResultAbsolute(yes: $data['absolute']['yes'], no: $data['absolute']['no']),
absolute: new PolisResultCantons(yes: $data['absolute']['yes'], no: $data['absolute']['no']),
relative: new PolisResultRelative(yes: $data['relative']['yes'], no: $data['relative']['no'], participation: null),
);
}
Expand Down
12 changes: 12 additions & 0 deletions src/Model/Polis/PolisResultCantons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace SRF\PolisBundle\Model\Polis;

readonly class PolisResultCantons
{
public function __construct(
public string $yes,
public string $no,
) {
}
}

0 comments on commit 4f24e2f

Please sign in to comment.