Rewinder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 2 Features 1
Metric Value
wmc 1
c 3
b 2
f 1
lcom 0
cbo 1
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 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