WeekendsProvider::isHoliday()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * @author: Vova Lando <[email protected]>
4
 * @package: LoanPaymentsCalculator
5
 * @subpackage: DateProvider
6
 * @created: 14/06/2017 15:35
7
 */
8
namespace cog\LoanPaymentsCalculator\DateProvider\HolidayProvider;
9
10
/**
11
 * Class WeekendsProvider - provides functionality to determine weekend based on php DateTime
12
 */
13
class WeekendsProvider implements HolidayProvider
14
{
15
    /**
16
     * @param \DateTime $date
17
     *
18
     * @return bool
19
     */
20 8
    public function isHoliday(\DateTime $date)
21
    {
22 8
        return $date->format('N') >= 5;
23
    }
24
}
25