FranceHoliday   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHolidays() 0 21 2
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),
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getEasterMonday() instead of getHolidays()). Are you sure this is correct? If so, you might want to change this to $this->getEasterMonday().

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:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
13
            parent::getAscensionDay($year),
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getAscensionDay() instead of getHolidays()). Are you sure this is correct? If so, you might want to change this to $this->getAscensionDay().

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:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
14
            parent::getWitmonday($year),
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getWitmonday() instead of getHolidays()). Are you sure this is correct? If so, you might want to change this to $this->getWitmonday().

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:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
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