| Total Complexity | 7 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class Prova extends Preferenser { |
||
| 18 | use Tick; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Pröva tipsrad. |
||
| 22 | */ |
||
| 23 | public function pröva_tipsrad(string $tipsrad_012): bool { |
||
| 24 | return $this->pröva_andelar($this->teckenfördelning($tipsrad_012)) || $this->tick(); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Pröva andelar. |
||
| 29 | * @param int[] $vektor |
||
| 30 | */ |
||
| 31 | protected function pröva_andelar(array $vektor): bool { |
||
| 32 | return in($vektor[0], $this->andel_1_min, $this->andel_1_max) && |
||
| 33 | in($vektor[1], $this->andel_x_min, $this->andel_x_max) && |
||
| 34 | in($vektor[2], $this->andel_2_min, $this->andel_2_max); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Teckenfördelning. |
||
| 39 | * @return int[] |
||
| 40 | */ |
||
| 41 | protected function teckenfördelning(string $tipsrad_012): array { |
||
| 42 | return [substr_count($tipsrad_012, '0'), substr_count($tipsrad_012, '1'), substr_count($tipsrad_012, '2')]; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Annonsera modul. |
||
| 47 | */ |
||
| 48 | public function annonsera(): string { |
||
| 51 | } |
||
| 52 | } |
||
| 53 |