Skip to content

Commit b7214ce

Browse files
author
Norbert Orzechowicz
committed
Merge pull request #69 from norzechowicz/php7-support
Renamed all facades in order to support php7
2 parents 3f252ef + 0b0eeea commit b7214ce

11 files changed

Lines changed: 127 additions & 126 deletions

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ matrix:
1414
- php: 5.4
1515
- php: 5.5
1616
- php: 5.6
17+
- php: 7.0
1718
- php: hhvm
1819
allow_failures:
1920
- env: DEPENDENCIES='low'

README.md

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@ composer require coduo/php-humanizer
2323
**Humanize**
2424

2525
```php
26-
use Coduo\PHPHumanizer\String;
26+
use Coduo\PHPHumanizer\StringHumanizer;
2727

28-
echo String::humanize('field_name'); // "Field Name"
29-
echo String::humanize('user_id'); // "User"
30-
echo String::humanize('field_name', false); // "field name"
28+
echo StringHumanizer::humanize('field_name'); // "Field Name"
29+
echo StringHumanizer::humanize('user_id'); // "User"
30+
echo StringHumanizer::humanize('field_name', false); // "field name"
3131
```
3232

3333
**Truncate**
3434

3535
Truncate string to word closest to a certain length
3636

3737
```php
38-
use Coduo\PHPHumanizer\String;
38+
use Coduo\PHPHumanizer\StringHumanizer;
3939

4040
$text = 'Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc.';
4141

42-
echo String::truncate($text, 8); // "Lorem ipsum"
43-
echo String::truncate($text, 8, '...'); // "Lorem ipsum..."
44-
echo String::truncate($text, 2); // "Lorem"
45-
echo String::truncate($text, strlen($text)); // "Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc."
42+
echo StringHumanizer::truncate($text, 8); // "Lorem ipsum"
43+
echo StringHumanizer::truncate($text, 8, '...'); // "Lorem ipsum..."
44+
echo StringHumanizer::truncate($text, 2); // "Lorem"
45+
echo StringHumanizer::truncate($text, strlen($text)); // "Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc."
4646

4747
```
4848

@@ -51,14 +51,14 @@ echo String::truncate($text, strlen($text)); // "Lorem ipsum dolorem si amet, lo
5151
Truncate and HTML string to word closest to a certain length
5252

5353
```php
54-
use Coduo\PHPHumanizer\String;
54+
use Coduo\PHPHumanizer\StringHumanizer;
5555

5656
$text = '<p><b>HyperText Markup Language</b>, commonly referred to as <b>HTML</b>, is the standard <a href="/wiki/Markup_language" title="Markup language">markup language</a> used to create <a href="/wiki/Web_page" title="Web page">web pages</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span>[</span>1<span>]</span></a></sup> <a href="/wiki/Web_browser" title="Web browser">Web browsers</a> can read HTML files and render them into visible or audible web pages. HTML describes the structure of a <a href="/wiki/Website" title="Website">website</a> <a href="/wiki/Semantic" title="Semantic" class="mw-redirect">semantically</a> along with cues for presentation, making it a markup language, rather than a <a href="/wiki/Programming_language" title="Programming language">programming language</a>.</p>';
5757

58-
echo String::truncateHtml($text, 3); // "<b>HyperText</b>"
59-
echo String::truncateHtml($text, 12, ''); // "HyperText Markup"
60-
echo String::truncateHtml($text, 50, '', '...'); // "HyperText Markup Language, commonly referred to as..."
61-
echo String::truncateHtml($text, 75, '<b><i><u><em><strong><a><span>', '...'); // '<b>HyperText Markup Language</b>, commonly referred to as <b>HTML</b>, is the standard <a href="/wiki/Markup_language" title="Markup language">markup...</a>'
58+
echo StringHumanizer::truncateHtml($text, 3); // "<b>HyperText</b>"
59+
echo StringHumanizer::truncateHtml($text, 12, ''); // "HyperText Markup"
60+
echo StringHumanizer::truncateHtml($text, 50, '', '...'); // "HyperText Markup Language, commonly referred to as..."
61+
echo StringHumanizer::truncateHtml($text, 75, '<b><i><u><em><strong><a><span>', '...'); // '<b>HyperText Markup Language</b>, commonly referred to as <b>HTML</b>, is the standard <a href="/wiki/Markup_language" title="Markup language">markup...</a>'
6262

6363
```
6464

@@ -67,120 +67,120 @@ echo String::truncateHtml($text, 75, '<b><i><u><em><strong><a><span>', '...'); /
6767
**Ordinalize**
6868

6969
```php
70-
use Coduo\PHPHumanizer\Number;
70+
use Coduo\PHPHumanizer\NumberHumanizer;
7171

72-
echo Number::ordinalize(0); // "0th"
73-
echo Number::ordinalize(1); // "1st"
74-
echo Number::ordinalize(2); // "2nd"
75-
echo Number::ordinalize(23); // "23rd"
76-
echo Number::ordinalize(1002, 'nl'); // "1002e"
77-
echo Number::ordinalize(-111); // "-111th"
72+
echo NumberHumanizer::ordinalize(0); // "0th"
73+
echo NumberHumanizer::ordinalize(1); // "1st"
74+
echo NumberHumanizer::ordinalize(2); // "2nd"
75+
echo NumberHumanizer::ordinalize(23); // "23rd"
76+
echo NumberHumanizer::ordinalize(1002, 'nl'); // "1002e"
77+
echo NumberHumanizer::ordinalize(-111); // "-111th"
7878

7979
```
8080

8181
**Ordinal**
8282

8383
```php
84-
use Coduo\PHPHumanizer\Number;
84+
use Coduo\PHPHumanizer\NumberHumanizer;
8585

86-
echo Number::ordinal(0); // "th"
87-
echo Number::ordinal(1); // "st"
88-
echo Number::ordinal(2); // "nd"
89-
echo Number::ordinal(23); // "rd"
90-
echo Number::ordinal(1002); // "nd"
91-
echo Number::ordinal(-111, 'nl'); // "e"
86+
echo NumberHumanizer::ordinal(0); // "th"
87+
echo NumberHumanizer::ordinal(1); // "st"
88+
echo NumberHumanizer::ordinal(2); // "nd"
89+
echo NumberHumanizer::ordinal(23); // "rd"
90+
echo NumberHumanizer::ordinal(1002); // "nd"
91+
echo NumberHumanizer::ordinal(-111, 'nl'); // "e"
9292
```
9393

9494
**Roman numbers**
9595
```php
96-
use Coduo\PHPHumanizer\Number;
96+
use Coduo\PHPHumanizer\NumberHumanizer;
9797

98-
echo Number::toRoman(1); // "I"
99-
echo Number::toRoman(5); // "V"
100-
echo Number::toRoman(1300); // "MCCC"
98+
echo NumberHumanizer::toRoman(1); // "I"
99+
echo NumberHumanizer::toRoman(5); // "V"
100+
echo NumberHumanizer::toRoman(1300); // "MCCC"
101101

102-
echo Number::fromRoman("MMMCMXCIX"); // 3999
103-
echo Number::fromRoman("V"); // 5
104-
echo Number::fromRoman("CXXV"); // 125
102+
echo NumberHumanizer::fromRoman("MMMCMXCIX"); // 3999
103+
echo NumberHumanizer::fromRoman("V"); // 5
104+
echo NumberHumanizer::fromRoman("CXXV"); // 125
105105
```
106106

107107
**Binary Suffix**
108108

109109
Convert a number of bytes in to the highest applicable data unit
110110

111111
```php
112-
use Coduo\PHPHumanizer\Number;
112+
use Coduo\PHPHumanizer\NumberHumanizer;
113113

114-
echo Number::binarySuffix(0); // "0 bytes"
115-
echo Number::binarySuffix(1); // "1 bytes"
116-
echo Number::binarySuffix(1024); // "1 kB"
117-
echo Number::binarySuffix(1025); // "1 kB"
118-
echo Number::binarySuffix(1536); // "1.5 kB"
119-
echo Number::binarySuffix(1048576 * 5); // "5 MB"
120-
echo Number::binarySuffix(1073741824 * 2); // "2 GB"
121-
echo Number::binarySuffix(1099511627776 * 3); // "3 TB"
122-
echo Number::binarySuffix(1325899906842624); // "1.18 PB"
114+
echo NumberHumanizer::binarySuffix(0); // "0 bytes"
115+
echo NumberHumanizer::binarySuffix(1); // "1 bytes"
116+
echo NumberHumanizer::binarySuffix(1024); // "1 kB"
117+
echo NumberHumanizer::binarySuffix(1025); // "1 kB"
118+
echo NumberHumanizer::binarySuffix(1536); // "1.5 kB"
119+
echo NumberHumanizer::binarySuffix(1048576 * 5); // "5 MB"
120+
echo NumberHumanizer::binarySuffix(1073741824 * 2); // "2 GB"
121+
echo NumberHumanizer::binarySuffix(1099511627776 * 3); // "3 TB"
122+
echo NumberHumanizer::binarySuffix(1325899906842624); // "1.18 PB"
123123
```
124124

125125
Number can be also formatted for specific locale
126126

127127
```php
128-
use Coduo\PHPHumanizer\Number;
128+
use Coduo\PHPHumanizer\NumberHumanizer;
129129

130-
echo Number::binarySuffix(1536, 'pl'); // "1,5 kB"
130+
echo NumberHumanizer::binarySuffix(1536, 'pl'); // "1,5 kB"
131131
```
132132

133133
Number can also be humanized with a specific number of decimal places with `preciseBinarySuffix($number, $precision, $locale = 'en')`
134134
The precision parameter must be between 0 and 3.
135135

136136
```php
137-
use Coduo\PHPHumanizer\Number;
137+
use Coduo\PHPHumanizer\NumberHumanizer;
138138

139-
echo Number::preciseBinarySuffix(1024, 2); // "1.00 kB"
140-
echo Number::preciseBinarySuffix(1325899906842624, 3); // "1.178 PB"
139+
echo NumberHumanizer::preciseBinarySuffix(1024, 2); // "1.00 kB"
140+
echo NumberHumanizer::preciseBinarySuffix(1325899906842624, 3); // "1.178 PB"
141141
```
142142

143143
This function also supports locale
144144

145145
```php
146-
use Coduo\PHPHumanizer\Number;
146+
use Coduo\PHPHumanizer\NumberHumanizer;
147147

148-
echo Number::preciseBinarySuffix(1325899906842624, 3, 'pl'); // "1,178 PB"
148+
echo NumberHumanizer::preciseBinarySuffix(1325899906842624, 3, 'pl'); // "1,178 PB"
149149
```
150150

151151
**Metric Suffix**
152152

153153
```php
154-
use Coduo\PHPHumanizer\Number;
154+
use Coduo\PHPHumanizer\NumberHumanizer;
155155

156-
echo Number::metricSuffix(-1); // "-1"
157-
echo Number::metricSuffix(0); // "0"
158-
echo Number::metricSuffix(1); // "1"
159-
echo Number::metricSuffix(101); // "101"
160-
echo Number::metricSuffix(1000); // "1k"
161-
echo Number::metricSuffix(1240); // "1.2k"
162-
echo Number::metricSuffix(1240000); // "1.24M"
163-
echo Number::metricSuffix(3500000); // "3.5M"
156+
echo NumberHumanizer::metricSuffix(-1); // "-1"
157+
echo NumberHumanizer::metricSuffix(0); // "0"
158+
echo NumberHumanizer::metricSuffix(1); // "1"
159+
echo NumberHumanizer::metricSuffix(101); // "101"
160+
echo NumberHumanizer::metricSuffix(1000); // "1k"
161+
echo NumberHumanizer::metricSuffix(1240); // "1.2k"
162+
echo NumberHumanizer::metricSuffix(1240000); // "1.24M"
163+
echo NumberHumanizer::metricSuffix(3500000); // "3.5M"
164164
```
165165

166166
Number can be also formatted for specific locale
167167

168168
```php
169-
use Coduo\PHPHumanizer\Number;
169+
use Coduo\PHPHumanizer\NumberHumanizer;
170170

171-
echo Number::metricSuffix(1240000, 'pl'); // "1,24M"
171+
echo NumberHumanizer::metricSuffix(1240000, 'pl'); // "1,24M"
172172
```
173173

174174
## Collections
175175

176176
**Oxford**
177177

178178
```php
179-
use Coduo\PHPHumanizer\Collection;
179+
use Coduo\PHPHumanizer\CollectionHumanizer;
180180

181-
echo Collection::oxford(['Michal', 'Norbert', 'Lukasz', 'Pawel'], 2); // "Michal, Norbert, and 2 others"
182-
echo Collection::oxford(['Michal', 'Norbert', 'Lukasz'], 2); // "Michal, Norbert, and 1 other"
183-
echo Collection::oxford(['Michal', 'Norbert']); // "Michal and Norbert"
181+
echo CollectionHumanizer::oxford(['Michal', 'Norbert', 'Lukasz', 'Pawel'], 2); // "Michal, Norbert, and 2 others"
182+
echo CollectionHumanizer::oxford(['Michal', 'Norbert', 'Lukasz'], 2); // "Michal, Norbert, and 1 other"
183+
echo CollectionHumanizer::oxford(['Michal', 'Norbert']); // "Michal and Norbert"
184184
```
185185

186186
Oxford is using translator component, so you can use whatever string format you like.
@@ -190,35 +190,35 @@ Oxford is using translator component, so you can use whatever string format you
190190
**Difference**
191191

192192
```php
193-
use Coduo\PHPHumanizer\DateTime;
194-
195-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:00")); // just now
196-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:05")); // 5 seconds from now
197-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:59:00")); // 1 minute ago
198-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:45:00")); // 15 minutes ago
199-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:15:00")); // 15 minutes from now
200-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 14:00:00")); // 1 hour from now
201-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 15:00:00")); // 2 hours from now
202-
echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:00:00")); // 1 hour ago
203-
echo DateTime::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-25")); // 1 day ago
204-
echo DateTime::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-24")); // 2 days ago
205-
echo DateTime::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-28")); // 2 days from now
206-
echo DateTime::difference(new \DateTime("2014-04-01"), new \DateTime("2014-04-15")); // 2 weeks from now
207-
echo DateTime::difference(new \DateTime("2014-04-15"), new \DateTime("2014-04-07")); // 1 week ago
208-
echo DateTime::difference(new \DateTime("2014-01-01"), new \DateTime("2014-04-01")); // 3 months from now
209-
echo DateTime::difference(new \DateTime("2014-05-01"), new \DateTime("2014-04-01")); // 1 month ago
210-
echo DateTime::difference(new \DateTime("2015-05-01"), new \DateTime("2014-04-01")); // 1 year ago
211-
echo DateTime::difference(new \DateTime("2014-05-01"), new \DateTime("2016-04-01")); // 2 years from now
193+
use Coduo\PHPHumanizer\DateTimeHumanizer;
194+
195+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:00")); // just now
196+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:05")); // 5 seconds from now
197+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:59:00")); // 1 minute ago
198+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:45:00")); // 15 minutes ago
199+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:15:00")); // 15 minutes from now
200+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 14:00:00")); // 1 hour from now
201+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 15:00:00")); // 2 hours from now
202+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:00:00")); // 1 hour ago
203+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-25")); // 1 day ago
204+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-24")); // 2 days ago
205+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-28")); // 2 days from now
206+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-01"), new \DateTime("2014-04-15")); // 2 weeks from now
207+
echo DateTimeHumanizer::difference(new \DateTime("2014-04-15"), new \DateTime("2014-04-07")); // 1 week ago
208+
echo DateTimeHumanizer::difference(new \DateTime("2014-01-01"), new \DateTime("2014-04-01")); // 3 months from now
209+
echo DateTimeHumanizer::difference(new \DateTime("2014-05-01"), new \DateTime("2014-04-01")); // 1 month ago
210+
echo DateTimeHumanizer::difference(new \DateTime("2015-05-01"), new \DateTime("2014-04-01")); // 1 year ago
211+
echo DateTimeHumanizer::difference(new \DateTime("2014-05-01"), new \DateTime("2016-04-01")); // 2 years from now
212212
```
213213

214214
**Precise difference**
215215

216216
```php
217-
use Coduo\PHPHumanizer\DateTime;
217+
use Coduo\PHPHumanizer\DateTimeHumanizer;
218218

219-
echo DateTime::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-25 11:20:00")); // 1 day, 1 hour, 40 minutes ago
220-
echo DateTime::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2015-04-28 17:00:00")); // 1 year, 2 days, 4 hours from now
221-
echo DateTime::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2016-04-27 13:00:00")); // 2 years, 1 day from now
219+
echo DateTimeHumanizer::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-25 11:20:00")); // 1 day, 1 hour, 40 minutes ago
220+
echo DateTimeHumanizer::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2015-04-28 17:00:00")); // 1 year, 2 days, 4 hours from now
221+
echo DateTimeHumanizer::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2016-04-27 13:00:00")); // 2 years, 1 day from now
222222
```
223223

224224
Currently we support following languages:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"thunderer/shortcode": "~0.5"
2323
},
2424
"require-dev": {
25-
"phpspec/phpspec": "2.0.*",
25+
"phpspec/phpspec": "^2",
2626
"phpunit/phpunit": "^4.5|^5.0"
2727
},
2828
"config": {

src/Coduo/PHPHumanizer/Collection.php renamed to src/Coduo/PHPHumanizer/CollectionHumanizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Coduo\PHPHumanizer\Collection\Oxford;
77
use Coduo\PHPHumanizer\Translator\Builder;
88

9-
class Collection
9+
class CollectionHumanizer
1010
{
1111
public static function oxford($collection, $limit = null, $locale = 'en')
1212
{

src/Coduo/PHPHumanizer/DateTime.php renamed to src/Coduo/PHPHumanizer/DateTimeHumanizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Coduo\PHPHumanizer\DateTime\PreciseFormatter;
99
use Coduo\PHPHumanizer\Translator\Builder;
1010

11-
class DateTime
11+
class DateTimeHumanizer
1212
{
1313
public static function difference(\DateTime $fromDate, \DateTime $toDate, $locale = 'en')
1414
{

src/Coduo/PHPHumanizer/Number.php renamed to src/Coduo/PHPHumanizer/NumberHumanizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Coduo\PHPHumanizer\String\BinarySuffix;
88
use Coduo\PHPHumanizer\String\MetricSuffix;
99

10-
class Number
10+
class NumberHumanizer
1111
{
1212
/**
1313
* @param int|float $number

src/Coduo/PHPHumanizer/String.php renamed to src/Coduo/PHPHumanizer/StringHumanizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Coduo\PHPHumanizer\String\HtmlTruncate;
99
use Coduo\PHPHumanizer\String\WordBreakpoint;
1010

11-
class String
11+
class StringHumanizer
1212
{
1313
/**
1414
* @param $text

tests/Coduo/PHPHumanizer/Tests/CollectionTest.php renamed to tests/Coduo/PHPHumanizer/Tests/CollectionHumanizerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
namespace Coduo\PHPHumanizer\Tests;
44

5-
use Coduo\PHPHumanizer\Collection;
5+
use Coduo\PHPHumanizer\CollectionHumanizer;
66

7-
final class CollectionTest extends \PHPUnit_Framework_TestCase
7+
final class CollectionHumanizerTest extends \PHPUnit_Framework_TestCase
88
{
99
/**
1010
* @dataProvider oxfordCollectionProvider
1111
*/
1212
function test_oxford_collections_humanizing($collection, $limit, $locale, $expectedResult)
1313
{
14-
$this->assertEquals($expectedResult, Collection::oxford($collection, $limit, $locale));
14+
$this->assertEquals($expectedResult, CollectionHumanizer::oxford($collection, $limit, $locale));
1515
}
1616

1717
public function oxfordCollectionProvider()

tests/Coduo/PHPHumanizer/Tests/DateTimeTest.php renamed to tests/Coduo/PHPHumanizer/Tests/DateTimeHumanizerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Coduo\PHPHumanizer\Tests;
44

5-
use Coduo\PHPHumanizer\DateTime;
5+
use Coduo\PHPHumanizer\DateTimeHumanizer;
66

7-
class DateTimeTest extends \PHPUnit_Framework_TestCase
7+
class DateTimeHumanizerTest extends \PHPUnit_Framework_TestCase
88
{
99
/**
1010
* @test
@@ -17,7 +17,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase
1717
*/
1818
public function test_humanize_difference_between_dates($firstDate, $secondDate, $expected, $locale)
1919
{
20-
$this->assertEquals($expected, DateTime::difference(new \DateTime($firstDate), new \DateTime($secondDate), $locale));
20+
$this->assertEquals($expected, DateTimeHumanizer::difference(new \DateTime($firstDate), new \DateTime($secondDate), $locale));
2121
}
2222

2323
/**
@@ -30,7 +30,7 @@ public function test_humanize_difference_between_dates($firstDate, $secondDate,
3030
*/
3131
public function test_humanize_precise_difference_between_dates($firstDate, $secondDate, $expected, $locale)
3232
{
33-
$this->assertEquals($expected, DateTime::preciseDifference(new \DateTime($firstDate), new \DateTime($secondDate), $locale));
33+
$this->assertEquals($expected, DateTimeHumanizer::preciseDifference(new \DateTime($firstDate), new \DateTime($secondDate), $locale));
3434
}
3535

3636
/**

0 commit comments

Comments
 (0)