Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
arukompas authored and github-actions[bot] committed Jul 22, 2023
1 parent 6976e49 commit cdb6153
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class Host
public bool $is_remote;

public function __construct(
public string|null $identifier,
public ?string $identifier,
public string $name,
public string|null $host = null,
public array|null $headers = null,
public array|null $auth = null,
public ?string $host = null,
public ?array $headers = null,
public ?array $auth = null,
) {
$this->is_remote = $this->isRemote();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function extractContextsFromFullText(): void

if (json_last_error() == JSON_ERROR_CTRL_CHAR) {
// might need to escape new lines
$json_data = json_decode(str_replace("\n", "\\n", $json_string), true);
$json_data = json_decode(str_replace("\n", '\\n', $json_string), true);
}

if (json_last_error() == JSON_ERROR_NONE) {
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/GenerateCacheKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class GenerateCacheKey
{
public static function for(mixed $object, ?string $namespace = null): string
public static function for(mixed $object, string $namespace = null): string
{
$key = '';

Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function glob_recursive($pattern, $flags = 0): bool|array
{
$files = glob($pattern, $flags);

foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
$files = array_merge($files, static::glob_recursive($dir.'/'.basename($pattern), $flags));
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Authorization/CanDeleteFoldersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
test('"deleteLogFolder" gate can prevent folder deletion', function () {
generateLogFiles([$fileName = 'laravel.log']);
$folder = LogViewer::getFolder('');
Gate::define('deleteLogFolder', fn (mixed $user, ?LogFolder $folder = null) => false);
Gate::define('deleteLogFolder', fn (mixed $user, LogFolder $folder = null) => false);

$this->deleteJson(route('log-viewer.folders.delete', $folder->identifier))
->assertForbidden();
test()->assertFileExists(storage_path('logs/'.$fileName));

// now let's allow access again
Gate::define('deleteLogFolder', fn (mixed $user, ?LogFolder $folder = null) => true);
Gate::define('deleteLogFolder', fn (mixed $user, LogFolder $folder = null) => true);

$this->deleteJson(route('log-viewer.folders.delete', $folder->identifier))
->assertOk();
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Authorization/CanDeleteLogFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

test('"deleteLogFile" gate can prevent file deletion', function () {
generateLogFiles([$fileName = 'laravel.log']);
Gate::define('deleteLogFile', fn (mixed $user, ?LogFile $file = null) => false);
Gate::define('deleteLogFile', fn (mixed $user, LogFile $file = null) => false);

$this->deleteJson(route('log-viewer.files.delete', $fileName))
->assertForbidden();
test()->assertFileExists(storage_path('logs/'.$fileName));

// now let's allow access again
Gate::define('deleteLogFile', fn (mixed $user, ?LogFile $file = null) => true);
Gate::define('deleteLogFile', fn (mixed $user, LogFile $file = null) => true);

$this->deleteJson(route('log-viewer.files.delete', $fileName))
->assertOk();
Expand Down

0 comments on commit cdb6153

Please sign in to comment.