Skip to content

Commit 211019a

Browse files
committed
Restore unchanged files
1 parent fdf7c8d commit 211019a

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

src/LogFile.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ class LogFile
1616
use Concerns\LogFile\CanCacheData;
1717

1818
public string $path;
19-
2019
public string $name;
21-
2220
public string $identifier;
23-
2421
public string $absolutePath = '';
25-
2622
public string $subFolder = '';
27-
2823
private array $_logIndexCache;
2924

3025
public function __construct(string $path)

src/LogIndex.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ class LogIndex
1717
const DEFAULT_CHUNK_SIZE = 20_000;
1818

1919
public string $identifier;
20-
2120
protected int $nextLogIndexToCreate;
22-
2321
protected int $lastScannedFilePosition;
24-
2522
protected int $lastScannedIndex;
2623

2724
public function __construct(

src/Utils/GenerateCacheKey.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ public static function for(mixed $object, ?string $namespace = null): string
1313
$key = '';
1414

1515
if ($object instanceof LogFile) {
16-
$key = self::baseKey().':file:'.md5($object->path);
16+
$key = self::baseKey() . ':file:' . md5($object->path);
1717
}
1818

1919
if ($object instanceof LogIndex) {
20-
$key = self::for($object->file).':'.$object->identifier;
20+
$key = self::for($object->file) . ':' . $object->identifier;
2121
}
2222

2323
if (is_string($object)) {
24-
$key = self::baseKey().':'.$object;
24+
$key = self::baseKey() . ':' . $object;
2525
}
2626

27-
if (! empty($namespace)) {
28-
$key .= ':'.$namespace;
27+
if (!empty($namespace)) {
28+
$key .= ':' . $namespace;
2929
}
3030

3131
return $key;
3232
}
3333

3434
protected static function baseKey(): string
3535
{
36-
return 'log-viewer:'.LogViewer::version();
36+
return 'log-viewer:' . LogViewer::version();
3737
}
3838
}

tests/Unit/GenerateCacheKeyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$result = GenerateCacheKey::for($file);
1111

1212
expect($result)->toBe(
13-
'log-viewer:'.LogViewer::version().':file:'.md5($file->path)
13+
'log-viewer:' . LogViewer::version() . ':file:' . md5($file->path)
1414
);
1515
});
1616

@@ -20,7 +20,7 @@
2020
$result = GenerateCacheKey::for($file, $namespace = 'randomNamespace');
2121

2222
expect($result)->toBe(
23-
GenerateCacheKey::for($file).':'.$namespace
23+
GenerateCacheKey::for($file) . ':' . $namespace
2424
);
2525
});
2626

@@ -30,7 +30,7 @@
3030
$result = GenerateCacheKey::for($logIndex);
3131

3232
expect($result)->toBe(
33-
GenerateCacheKey::for($logIndex->file).':'.$logIndex->identifier
33+
GenerateCacheKey::for($logIndex->file) . ':' . $logIndex->identifier
3434
);
3535
});
3636

@@ -39,5 +39,5 @@
3939

4040
$result = GenerateCacheKey::for($string);
4141

42-
expect($result)->toBe('log-viewer:'.LogViewer::version().':'.$string);
42+
expect($result)->toBe('log-viewer:' . LogViewer::version() . ':' . $string);
4343
});

0 commit comments

Comments
 (0)