|
1
|
|
|
<?php |
|
2
|
|
|
namespace Holiday\Country; |
|
3
|
|
|
|
|
4
|
|
|
use Holiday\Model\AbstractHoliday; |
|
5
|
|
|
|
|
6
|
|
|
class FranceHoliday extends AbstractHoliday |
|
7
|
|
|
{ |
|
8
|
|
|
public static function getHolidays($year = null) |
|
9
|
|
|
{ |
|
10
|
|
|
$year === null ? $year = intval(date('Y')) : $year = intval($year); |
|
11
|
|
|
$holidays = [ |
|
12
|
|
|
parent::getEasterMonday($year), |
|
|
|
|
|
|
13
|
|
|
parent::getAscensionDay($year), |
|
|
|
|
|
|
14
|
|
|
parent::getWitmonday($year), |
|
|
|
|
|
|
15
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 1, 1)), // 1er janvier |
|
16
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 5, 1)), // Fête du travail |
|
17
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 5, 8)), // Victoire des alliés |
|
18
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 7, 14)), // Fête nationale |
|
19
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 8, 15)), // Assomption |
|
20
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 11, 01)), // Toussaint |
|
21
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 11, 11)), // Armistice |
|
22
|
|
|
new \DateTime(sprintf('%d-%d-%d', $year, 12, 25)), // Noel |
|
23
|
|
|
]; |
|
24
|
|
|
|
|
25
|
|
|
sort($holidays); |
|
26
|
|
|
|
|
27
|
|
|
return $holidays; |
|
28
|
|
|
} |
|
29
|
|
|
} |
|
30
|
|
|
|
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.