-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathDifferenceFormatterInterface.php
More file actions
36 lines (33 loc) · 1.2 KB
/
DifferenceFormatterInterface.php
File metadata and controls
36 lines (33 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
/**
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @license https://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Chronos;
use DateTimeInterface;
/**
* Interface for formatting differences in text.
*/
interface DifferenceFormatterInterface
{
/**
* Get the difference in a human readable format.
*
* @param \Cake\Chronos\ChronosDate|\DateTimeInterface $first The datetime to start with.
* @param \Cake\Chronos\ChronosDate|\DateTimeInterface|null $second The datetime to compare against.
* @param bool $absolute removes time difference modifiers ago, after, etc
* @return string The difference between the two days in a human readable format
*/
public function diffForHumans(
ChronosDate|DateTimeInterface $first,
ChronosDate|DateTimeInterface|null $second = null,
bool $absolute = false,
): string;
}