Skip to content

Commit

Permalink
Spain regional holidays 2025 (#258)
Browse files Browse the repository at this point in the history
* Spain Regional Holidays 2025

* new test

* test with snapshots

removed generic snapshot and separate them for every year just in case somebody still wants to check holidays until 2022
  • Loading branch information
prodelpe authored Dec 30, 2024
1 parent 9938e6c commit ab8fa3a
Show file tree
Hide file tree
Showing 10 changed files with 506 additions and 6 deletions.
112 changes: 112 additions & 0 deletions src/Countries/Spain.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,116 @@ protected function regionHolidays2024(): array
default => throw InvalidRegion::notFound($this->region),
};
}

protected function regionHolidays2025(): array

Check failure on line 397 in src/Countries/Spain.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Spatie\Holidays\Countries\Spain::regionHolidays2025() return type has no value type specified in iterable type array.
{
$sanJose = ['San José' => '03-19'];
$juevesSanto = ['Jueves Santo' => '04-17'];
$lunesPascua = ['Lunes de Pascua' => '04-21'];
$fiestaSacrificio = ['Fiesta del Sacrificio Eid al-Adha' => '06-07'];
$sanJuan = ['San Juan' => '06-24'];
$santiagoApostol = ['Santiago Apóstol' => '07-25'];
$inmaculadaConcepcion = ['Lunes siguiente a la Inmaculada Concepción' => '12-08'];

return match ($this->region) {
// Andalucía
'es-an' => [
'Día de Andalucía' => '02-28',
] + $juevesSanto + $inmaculadaConcepcion,

// Aragón
'es-ar' => [
'San Jorge / Día de Aragón' => '04-23',
] + $juevesSanto + $inmaculadaConcepcion,

// Principado de Asturias
'es-as' => [
'Día de Asturias' => '09-08',
] + $juevesSanto + $inmaculadaConcepcion,

// Cantabria
'es-cb' => $juevesSanto + $lunesPascua + $santiagoApostol,

// Ciudad Autónoma de Ceuta
'es-ce' => [
'Nuestra Señora de África' => '08-05',
] + $juevesSanto + $fiestaSacrificio,

// Castilla y León
'es-cl' => [
'Fiesta de Castilla y León' => '04-23',
] + $juevesSanto + $inmaculadaConcepcion,

// Castilla-La Mancha
'es-cm' => [
'Corpus Christi' => '06-19',
'Día de Castilla-La Mancha' => '05-31',
] + $juevesSanto,

// Canarias
'es-cn' => [
'Día de Canarias' => '05-30',
] + $juevesSanto,

// Cataluña / Catalunya
'es-ct' => [
'Fiesta Nacional de Cataluña' => '09-11',
'San Esteban' => '12-26',
] + $lunesPascua + $sanJuan,

// Extremadura
'es-ex' => [
'Día de Extremadura' => '09-08',
] + $juevesSanto + $inmaculadaConcepcion,

// Galicia
'es-ga' => [
'Día de las Letras Gallegas' => '05-17',
'Santiago Apóstol / Día de Galicia' => '07-25',
] + $juevesSanto,

// Islas Baleares / Illes Balears
'es-ib' => [
'Día de les Illes Balears' => '03-01',
'San Esteban' => '12-26',
] + $juevesSanto + $lunesPascua,

// Región de Murcia
'es-mc' => [
'Día de la Región de Murcia' => '06-09'
] + $sanJose + $juevesSanto + $inmaculadaConcepcion,

// Comunidad de Madrid
'es-md' => [
'Fiesta de la Comunidad de Madrid' => '05-02',
] + $juevesSanto + $santiagoApostol,

// Ciudad Autónoma de Melilla
'es-ml' => $juevesSanto + $fiestaSacrificio + $inmaculadaConcepcion,

// Comunidad Foral de Navarra / Nafarroako Foru Komunitatea
'es-nc' => [
'Día de Navarra: San Francisco Javier' => '12-03',
] + $juevesSanto + $lunesPascua + $santiagoApostol,

// País Vasco / Euskal Herria
'es-pv' => [
'Día del País Vasco / Euskadiko Eguna' => '10-25'
] + $juevesSanto + $lunesPascua + $santiagoApostol,

// La Rioja
'es-ri' => [
'Lunes siguiente al Día de La Rioja' => '06-09',
] + $juevesSanto + $lunesPascua,

// Comunidad Valenciana / Comunitat Valenciana
'es-vc' => [
'Día de la Comunidad Valenciana' => '10-09',
] + $sanJose + $lunesPascua + $sanJuan,

null => [],
default => throw InvalidRegion::notFound($this->region),
};
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "A\u00f1o Nuevo",
"date": "2022-01-01"
},
{
"name": "Epifan\u00eda del Se\u00f1or",
"date": "2022-01-06"
},
{
"name": "Viernes Santo",
"date": "2022-04-15"
},
{
"name": "D\u00eda del Trabajador",
"date": "2022-05-01"
},
{
"name": "Asunci\u00f3n de la Virgen",
"date": "2022-08-15"
},
{
"name": "Fiesta Nacional de Espa\u00f1a",
"date": "2022-10-12"
},
{
"name": "Todos los Santos",
"date": "2022-11-01"
},
{
"name": "D\u00eda de la Constituci\u00f3n Espa\u00f1ola",
"date": "2022-12-06"
},
{
"name": "Inmaculada Concepci\u00f3n",
"date": "2022-12-08"
},
{
"name": "Navidad",
"date": "2022-12-25"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "A\u00f1o Nuevo",
"date": "2023-01-01"
},
{
"name": "Epifan\u00eda del Se\u00f1or",
"date": "2023-01-06"
},
{
"name": "Viernes Santo",
"date": "2023-04-07"
},
{
"name": "D\u00eda del Trabajador",
"date": "2023-05-01"
},
{
"name": "Asunci\u00f3n de la Virgen",
"date": "2023-08-15"
},
{
"name": "Fiesta Nacional de Espa\u00f1a",
"date": "2023-10-12"
},
{
"name": "Todos los Santos",
"date": "2023-11-01"
},
{
"name": "D\u00eda de la Constituci\u00f3n Espa\u00f1ola",
"date": "2023-12-06"
},
{
"name": "Inmaculada Concepci\u00f3n",
"date": "2023-12-08"
},
{
"name": "Navidad",
"date": "2023-12-25"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "A\u00f1o Nuevo",
"date": "2025-01-01"
},
{
"name": "Epifan\u00eda del Se\u00f1or",
"date": "2025-01-06"
},
{
"name": "Viernes Santo",
"date": "2025-04-18"
},
{
"name": "D\u00eda del Trabajador",
"date": "2025-05-01"
},
{
"name": "Asunci\u00f3n de la Virgen",
"date": "2025-08-15"
},
{
"name": "Fiesta Nacional de Espa\u00f1a",
"date": "2025-10-12"
},
{
"name": "Todos los Santos",
"date": "2025-11-01"
},
{
"name": "D\u00eda de la Constituci\u00f3n Espa\u00f1ola",
"date": "2025-12-06"
},
{
"name": "Inmaculada Concepci\u00f3n",
"date": "2025-12-08"
},
{
"name": "Navidad",
"date": "2025-12-25"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"name": "A\u00f1o Nuevo",
"date": "2022-01-01"
},
{
"name": "Epifan\u00eda del Se\u00f1or",
"date": "2022-01-06"
},
{
"name": "Jueves Santo",
"date": "2022-04-14"
},
{
"name": "Viernes Santo",
"date": "2022-04-15"
},
{
"name": "Lunes siguiente a San Jorge, D\u00eda de Arag\u00f3n",
"date": "2022-04-23"
},
{
"name": "D\u00eda del Trabajador",
"date": "2022-05-01"
},
{
"name": "Lunes siguiente a la Fiesta del Trabajo",
"date": "2022-05-02"
},
{
"name": "Asunci\u00f3n de la Virgen",
"date": "2022-08-15"
},
{
"name": "Fiesta Nacional de Espa\u00f1a",
"date": "2022-10-12"
},
{
"name": "Todos los Santos",
"date": "2022-11-01"
},
{
"name": "D\u00eda de la Constituci\u00f3n Espa\u00f1ola",
"date": "2022-12-06"
},
{
"name": "Inmaculada Concepci\u00f3n",
"date": "2022-12-08"
},
{
"name": "Navidad",
"date": "2022-12-25"
},
{
"name": "Lunes siguiente a Navidad",
"date": "2022-12-26"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
{
"name": "A\u00f1o Nuevo",
"date": "2023-01-01"
},
{
"name": "Lunes siguiente a la Fiesta de A\u00f1o Nuevo",
"date": "2023-01-02"
},
{
"name": "Epifan\u00eda del Se\u00f1or",
"date": "2023-01-06"
},
{
"name": "Jueves Santo",
"date": "2023-04-06"
},
{
"name": "Viernes Santo",
"date": "2023-04-07"
},
{
"name": "Lunes siguiente a San Jorge, D\u00eda de Arag\u00f3n",
"date": "2023-04-24"
},
{
"name": "D\u00eda del Trabajador",
"date": "2023-05-01"
},
{
"name": "Asunci\u00f3n de la Virgen",
"date": "2023-08-15"
},
{
"name": "Fiesta Nacional de Espa\u00f1a",
"date": "2023-10-12"
},
{
"name": "Todos los Santos",
"date": "2023-11-01"
},
{
"name": "D\u00eda de la Constituci\u00f3n Espa\u00f1ola",
"date": "2023-12-06"
},
{
"name": "Inmaculada Concepci\u00f3n",
"date": "2023-12-08"
},
{
"name": "Navidad",
"date": "2023-12-25"
}
]
Loading

0 comments on commit ab8fa3a

Please sign in to comment.