@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | $archive = UnifiedArchive::open($file, [], $password); |
28 | - if ($archive === null) |
|
29 | - throw new \Exception('Could not open archive '.$file); |
|
28 | + if ($archive === null) { |
|
29 | + throw new \Exception('Could not open archive '.$file); |
|
30 | + } |
|
30 | 31 | |
31 | 32 | return $archive; |
32 | 33 | } |
@@ -39,17 +40,18 @@ discard block |
||
39 | 40 | */ |
40 | 41 | public function formatDate($unixtime) |
41 | 42 | { |
42 | - if (strtotime('today') < $unixtime) |
|
43 | - return 'Today, '.date('G:m', $unixtime); |
|
44 | - else if (strtotime('yesterday') < $unixtime) |
|
45 | - return 'Yesterday, '.date('G:m', $unixtime); |
|
46 | - else { |
|
43 | + if (strtotime('today') < $unixtime) { |
|
44 | + return 'Today, '.date('G:m', $unixtime); |
|
45 | + } else if (strtotime('yesterday') < $unixtime) { |
|
46 | + return 'Yesterday, '.date('G:m', $unixtime); |
|
47 | + } else { |
|
47 | 48 | $datetime = new \DateTime(); |
48 | 49 | $datetime->setTimestamp($unixtime); |
49 | - if ($datetime->format('Y') == date('Y')) |
|
50 | - return $datetime->format('d M, H:m'); |
|
51 | - else |
|
52 | - return $datetime->format('d M Y, H:m'); |
|
50 | + if ($datetime->format('Y') == date('Y')) { |
|
51 | + return $datetime->format('d M, H:m'); |
|
52 | + } else { |
|
53 | + return $datetime->format('d M Y, H:m'); |
|
54 | + } |
|
53 | 55 | } |
54 | 56 | } |
55 | 57 |