Rewinder::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 2 Features 0
Metric Value
c 2
b 2
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
namespace iansltx\BusinessDays;
4
5
/**
6
 * Class Rewinder
7
 *
8
 * Provides an easy way to calculate dates that are a specified number of
9
 * "business bays" in the past relative to a supplied date. This is achieved
10
 * by first adding a series of filter callbacks that define what is NOT a
11
 * business day.
12
 *
13
 * Calculates a date X days before $start_date, where X was supplied in
14
 * static::createWithDays(); if the end date would land on a non-business
15
 * day, the last business day before that date is returned.
16
 *
17
 * A negative day count may be entered into the constructor to count in the
18
 * opposite direction (days in the future vs. in the past). Or just use
19
 * FastForwarder.
20
 *
21
 * @package iansltx\BusinessDays
22
 */
23
class Rewinder extends FastForwarder
24
{
25 8
    public function __construct($num_days, array $skip_when = [])
26
    {
27 8
        parent::__construct($num_days * -1, $skip_when);
28 8
    }
29
}
30