Commit 163acab67325a739266b36e5f56efb7f91c7b748

Authored by Joalisson Barros
1 parent 3ccab425
Exists in 2.9 and in 2 other branches 2.7, 2.8

Configura factory para 2021

app/Services/Educacenso/ImportServiceFactory.php
... ... @@ -5,6 +5,7 @@ namespace App\Services\Educacenso;
5 5 use App\Exceptions\Educacenso\NotImplementedYear;
6 6 use App\Services\Educacenso\Version2019\ImportService as ImportService2019;
7 7 use App\Services\Educacenso\Version2020\ImportService as ImportService2020;
  8 +use App\Services\Educacenso\Version2021\ImportService as ImportService2021;
8 9 use DateTime;
9 10  
10 11 class ImportServiceFactory
... ... @@ -40,6 +41,7 @@ class ImportServiceFactory
40 41 $imports = [
41 42 2019 => ImportService2019::class,
42 43 2020 => ImportService2020::class,
  44 + 2021 => ImportService2021::class,
43 45 ];
44 46  
45 47 if (isset($imports[$year])) {
... ...
app/Services/Educacenso/Version2021/ImportService.php 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +<?php
  2 +
  3 +
  4 +namespace App\Services\Educacenso\Version2021;
  5 +
  6 +
  7 +use App\Services\Educacenso\Version2020\ImportService as ImportServiceVersion2020;
  8 +
  9 +class ImportService extends ImportServiceVersion2020
  10 +{
  11 + /**
  12 + * Retorna o ano a que o service se refere
  13 + *
  14 + * @return int
  15 + */
  16 + public function getYear()
  17 + {
  18 + return 2021;
  19 + }
  20 +}
... ...