Skip to content

Commit 8f92db6

Browse files
committed
Merge pull request #2 from freekmurze/deadcode
Remove unused code
2 parents 4042dcc + b78b8a7 commit 8f92db6

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

src/Helpers/Format.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,4 @@ public static function getHumanReadableSize($sizeInBytes)
2424

2525
return round($sizeInBytes, 2).' '.$units[$i];
2626
}
27-
28-
/**
29-
* @param bool $bool
30-
*
31-
* @return string
32-
*/
33-
public static function getEmoji($bool)
34-
{
35-
if ($bool) {
36-
return "\xe2\x9c\x85";
37-
}
38-
39-
return "\xe2\x9d\x8c";
40-
}
41-
42-
/**
43-
* @param \Carbon\Carbon $date
44-
*
45-
* @return string
46-
*/
47-
public static function ageInDays(Carbon $date)
48-
{
49-
return number_format(round($date->diffInMinutes() / (24 * 60), 2), 2).' ('.$date->diffForHumans().')';
50-
}
5127
}

tests/Unit/FormatTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,4 @@ public function it_can_determine_a_human_readable_filesize()
1818
$this->assertEquals('9.54 MB', Format::getHumanReadableSize(10000000));
1919
$this->assertEquals('9.31 GB', Format::getHumanReadableSize(10000000000));
2020
}
21-
22-
/** @test */
23-
public function it_can_determine_the_age_in_days()
24-
{
25-
Carbon::setTestNow(Carbon::create(2016, 1, 1)->startOfDay());
26-
27-
$this->assertEquals('0.00 (1 second ago)', Format::ageInDays(Carbon::now()));
28-
$this->assertEquals('0.04 (1 hour ago)', Format::ageInDays(Carbon::now()->subHour(1)));
29-
$this->assertEquals('1.04 (1 day ago)', Format::ageInDays(Carbon::now()->subHour(1)->subDay(1)));
30-
$this->assertEquals('30.04 (4 weeks ago)', Format::ageInDays(Carbon::now()->subHour(1)->subMonths(1)));
31-
}
3221
}

0 commit comments

Comments
 (0)