Completed
Push — 2.0 ( 0357a9...3fe951 )
by Peter
08:22 queued 10s
created

DateDiffExecutor::__invoke()   A

Complexity

Conditions 1
Paths 1

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 1
nc 1
nop 2
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * This file is part of the Happyr Doctrine Specification package.
6
 *
7
 * (c) Tobias Nyholm <[email protected]>
8
 *     Kacper Gunia <[email protected]>
9
 *     Peter Gribanov <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Happyr\DoctrineSpecification\Operand\PlatformFunction\Executor;
16
17
final class DateDiffExecutor
18
{
19
    /**
20
     * @param \DateTimeInterface $date1
21
     * @param \DateTimeInterface $date2
22
     *
23
     * @return \DateInterval
24
     */
25
    public function __invoke(\DateTimeInterface $date1, \DateTimeInterface $date2): \DateInterval
26
    {
27
        return $date1->diff($date2);
28
    }
29
}
30