2
2
3
3
namespace Opcodes \LogViewer ;
4
4
5
- use Carbon \Carbon ;
5
+ use Carbon \CarbonInterface ;
6
+ use Illuminate \Support \Carbon ;
6
7
use Illuminate \Support \Collection ;
7
8
use Illuminate \Support \Facades \Cache ;
8
9
@@ -47,7 +48,7 @@ public function metaCacheKey(): string
47
48
return $ this ->file ->cacheKey ().': ' .$ this ->identifier ().':metadata ' ;
48
49
}
49
50
50
- public function cacheTtl (): Carbon
51
+ public function cacheTtl (): CarbonInterface
51
52
{
52
53
if (! empty ($ this ->query )) {
53
54
// There will be a lot more search queries, and they're usually just one-off searches.
@@ -69,11 +70,11 @@ public function clearCache(): void
69
70
$ this ->loadMetadata ();
70
71
}
71
72
72
- public function addToIndex (int $ filePosition , int |Carbon $ timestamp , string $ severity , int $ index = null ): int
73
+ public function addToIndex (int $ filePosition , int |CarbonInterface $ timestamp , string $ severity , int $ index = null ): int
73
74
{
74
75
$ logIndex = $ index ?? $ this ->nextLogIndexToCreate ?? 0 ;
75
76
76
- if ($ timestamp instanceof Carbon ) {
77
+ if ($ timestamp instanceof CarbonInterface ) {
77
78
$ timestamp = $ timestamp ->timestamp ;
78
79
}
79
80
@@ -338,7 +339,7 @@ public function getEarliestTimestamp(): ?int
338
339
return $ earliestTimestamp ;
339
340
}
340
341
341
- public function getEarliestDate (): Carbon
342
+ public function getEarliestDate (): CarbonInterface
342
343
{
343
344
return Carbon::createFromTimestamp ($ this ->getEarliestTimestamp ());
344
345
}
@@ -369,7 +370,7 @@ public function getLatestTimestamp(): ?int
369
370
return $ latestTimestamp ;
370
371
}
371
372
372
- public function getLatestDate (): Carbon
373
+ public function getLatestDate (): CarbonInterface
373
374
{
374
375
return Carbon::createFromTimestamp ($ this ->getLatestTimestamp ());
375
376
}
0 commit comments