Skip to content

Commit

Permalink
Merge 0c15a69 into 32f79fc
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jan 2, 2020
2 parents 32f79fc + 0c15a69 commit 9d109e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Log/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static function engine(string $name): ?LoggerInterface
*
* @param int|string $level The severity level of the message being written.
* The value must be an integer or string matching a known level.
* @param mixed $message Message content to log
* @param string $message Message content to log
* @param string|array $context Additional data to be used for logging the message.
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
Expand All @@ -350,7 +350,7 @@ public static function engine(string $name): ?LoggerInterface
* @return bool Success
* @throws \InvalidArgumentException If invalid level is passed.
*/
public static function write($level, $message, $context = []): bool
public static function write($level, string $message, $context = []): bool
{
static::_init();
if (is_int($level) && in_array($level, static::$_levelMap, true)) {
Expand Down
6 changes: 3 additions & 3 deletions src/Log/LogTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ trait LogTrait
* Convenience method to write a message to Log. See Log::write()
* for more information on writing to logs.
*
* @param mixed $msg Log message.
* @param string $message Log message.
* @param int|string $level Error level.
* @param string|array $context Additional log data relevant to this message.
* @return bool Success of log write.
*/
public function log($msg, $level = LogLevel::ERROR, $context = []): bool
public function log(string $message, $level = LogLevel::ERROR, $context = []): bool
{
return Log::write($level, $msg, $context);
return Log::write($level, $message, $context);
}
}
4 changes: 2 additions & 2 deletions tests/TestCase/Log/LogTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public function testLog()

$mock->expects($this->at(1))
->method('log')
->with('debug', [1, 2]);
->with('debug', 'message');

Log::setConfig('trait_test', ['engine' => $mock]);
$subject = $this->getObjectForTrait('Cake\Log\LogTrait');

$subject->log('Testing');
$subject->log([1, 2], 'debug');
$subject->log('message', 'debug');
}
}

0 comments on commit 9d109e7

Please sign in to comment.