GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( aea5ce...acd138 )
by Kyle
22s
created

DateTimeCopier::copyDateTime()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Spatie\OpeningHours\Helpers;
4
5
use DateTimeImmutable;
6
use DateTimeInterface;
7
8
trait DateTimeCopier
9
{
10
    /**
11
     * @param DateTimeInterface $date
12
     *
13
     * @return \DateTime|\DateTimeImmutable
14
     */
15
    protected function copyDateTime(DateTimeInterface $date): DateTimeInterface
16
    {
17
        return $date instanceof DateTimeImmutable ? $date : clone $date;
18
    }
19
20
    protected function yesterday(DateTimeInterface $date): DateTimeInterface
21
    {
22
        return $this->copyDateTime($date)->modify('-1 day');
23
    }
24
}
25