Skip to content

Commit 07f792f

Browse files
florisboschgithub-actions[bot]
authored andcommitted
Fix styling
1 parent a7f7440 commit 07f792f

File tree

12 files changed

+22
-22
lines changed

12 files changed

+22
-22
lines changed

config/log-viewer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
|
6868
*/
6969
'filesystem' => [
70-
'root' => env('LOG_VIEWER_FILESYSTEM_ROOT', ''),
71-
'disk' => env('LOG_VIEWER_FILESYSTEM_DISK', 'log-viewer-local'),
70+
'root' => env('LOG_VIEWER_FILESYSTEM_ROOT', ''),
71+
'disk' => env('LOG_VIEWER_FILESYSTEM_DISK', 'log-viewer-local'),
7272
],
7373

7474
/*

src/Concerns/LogFile/CanCacheData.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
namespace Opcodes\LogViewer\Concerns\LogFile;
44

55
use Carbon\CarbonInterface;
6-
use Illuminate\Contracts\Cache\Repository;
76
use Opcodes\LogViewer\Facades\Cache;
87
use Opcodes\LogViewer\Utils\GenerateCacheKey;
98

109
trait CanCacheData
1110
{
1211
protected function indexCacheKeyForQuery(string $query = ''): string
1312
{
14-
return GenerateCacheKey::for($this, md5($query) . ':index');
13+
return GenerateCacheKey::for($this, md5($query).':index');
1514
}
1615

1716
public function clearCache(): void

src/Http/Livewire/FileList.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public function deleteFolder(string $folderIdentifier)
9090
{
9191
$folder = LogViewer::getFolder($folderIdentifier);
9292

93-
9493
if ($folder) {
9594
Gate::authorize('deleteLogFolder', $folder);
9695

src/LogFile.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Opcodes\LogViewer\Exceptions\InvalidRegularExpression;
99
use Opcodes\LogViewer\Facades\LogViewer;
1010
use Opcodes\LogViewer\Utils\Utils;
11-
use Symfony\Component\HttpFoundation\BinaryFileResponse;
1211
use Symfony\Component\HttpFoundation\StreamedResponse;
1312

1413
class LogFile
@@ -17,9 +16,13 @@ class LogFile
1716
use Concerns\LogFile\CanCacheData;
1817

1918
public string $path;
19+
2020
public string $name;
21+
2122
public string $identifier;
23+
2224
public string $subFolder = '';
25+
2326
private array $_logIndexCache;
2427

2528
public function __construct(string $path)

src/LogIndex.php

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

1919
public string $identifier;
20+
2021
protected int $nextLogIndexToCreate;
22+
2123
protected int $lastScannedFilePosition;
24+
2225
protected int $lastScannedIndex;
2326

2427
public function __construct(

src/LogViewerService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ protected function getFilePathsMatchingPattern($pattern)
6060
{
6161
$files = [];
6262

63-
foreach($this->getFilesystem()->allFiles($this->basePathForLogs()) as $file)
64-
{
63+
foreach ($this->getFilesystem()->allFiles($this->basePathForLogs()) as $file) {
6564
if (preg_match(pattern: Glob::toRegex(glob: $pattern), subject: $file)) {
6665
$files[] = $file;
6766
}
@@ -73,6 +72,7 @@ protected function getFilePathsMatchingPattern($pattern)
7372
public function basePathForLogs(): string
7473
{
7574
$rootFolder = Str::of(config('log-viewer.filesystem.root'));
75+
7676
return empty($rootFolder)
7777
? $rootFolder->finish('/')
7878
: $rootFolder;

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
});

tests/Unit/LogIndex/ChunkedIndicesTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use Opcodes\LogViewer\Exceptions\InvalidChunkSizeException;
4-
use Opcodes\LogViewer\LogFile;
54

65
it('can set the chunk size for the log index', function () {
76
$logIndex = createLogIndex();

tests/Unit/LogIndex/LogIndexTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Opcodes\LogViewer\Facades\Cache;
44
use Opcodes\LogViewer\Facades\LogViewer;
5-
use Opcodes\LogViewer\LogFile;
65
use Opcodes\LogViewer\Utils\GenerateCacheKey;
76

87
it('starts off with an empty index', function () {

0 commit comments

Comments
 (0)