Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Apr 3, 2022
1 parent 6b6a54a commit 07fec1d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"illuminate/support": "^9.0",
"illuminate/log": "^9.0",
"phpunit/phpunit": "^9.0",
"psr/log": "^2.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/var-dumper": "^6.0"
},
"require-dev": {
Expand Down
4 changes: 1 addition & 3 deletions src/ChannelFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ public function dump(?string $level = null): ChannelFake
*/
public function dd(?string $level = null): never
{
// TODO: add symfony var dumper as a recommended composer dependecy like
// laravel does.
$this->dump($level);

exit(1);
Expand All @@ -208,7 +206,7 @@ public function write(string $level, string $message, array $context = []): void
$this->log($level, $message, $context);
}

public function log($level, string|Stringable $message, array $context = []): void
public function log($level, $message, array $context = []): void
{
$this->logs[] = [
'level' => $level,
Expand Down
2 changes: 1 addition & 1 deletion src/LogFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function assertChannelIsCurrentlyForgotten(string $name): LogFake
/**
* @param mixed $level
*/
public function log($level, string|Stringable $message, array $context = []): void
public function log($level, $message, array $context = []): void
{
$this->driver()->log($level, $message, $context);
}
Expand Down
18 changes: 9 additions & 9 deletions src/LogHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,48 @@
*/
trait LogHelpers
{
public function emergency(string|Stringable $message, array $context = []): void
public function emergency($message, $context = []): void
{
$this->log('emergency', $message, $context);
}

public function alert(string|Stringable $message, array $context = []): void
public function alert($message, array $context = []): void
{
$this->log('alert', $message, $context);
}

public function critical(string|Stringable $message, array $context = []): void
public function critical($message, array $context = []): void
{
$this->log('critical', $message, $context);
}

public function error(string|Stringable $message, array $context = []): void
public function error($message, array $context = []): void
{
$this->log('error', $message, $context);
}

public function warning(string|Stringable $message, array $context = []): void
public function warning($message, array $context = []): void
{
$this->log('warning', $message, $context);
}

public function notice(string|Stringable $message, array $context = []): void
public function notice($message, array $context = []): void
{
$this->log('notice', $message, $context);
}

public function info(string|Stringable $message, array $context = []): void
public function info($message, array $context = []): void
{
$this->log('info', $message, $context);
}

public function debug(string|Stringable $message, array $context = []): void
public function debug($message, array $context = []): void
{
$this->log('debug', $message, $context);
}

/**
* @param mixed $level
*/
abstract public function log($level, string|Stringable $message, array $context = []): void;
abstract public function log($level, $message, array $context = []): void;
}

0 comments on commit 07fec1d

Please sign in to comment.