mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-01 10:50:21 +02:00
Fix phpstan build
This commit is contained in:
@@ -72,7 +72,7 @@ class RedisHandler extends AbstractProcessingHandler
|
||||
$mode = \defined('Redis::MULTI') ? Redis::MULTI : 1;
|
||||
$this->redisClient->multi($mode)
|
||||
->rPush($this->redisKey, $record->formatted)
|
||||
->lTrim($this->redisKey, -$this->capSize, -1)
|
||||
->ltrim($this->redisKey, -$this->capSize, -1)
|
||||
->exec();
|
||||
} else {
|
||||
$redisKey = $this->redisKey;
|
||||
|
@@ -179,7 +179,7 @@ class TestHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
public function __call(string $method, array $args): bool
|
||||
{
|
||||
if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
|
||||
if ((bool) preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches)) {
|
||||
$genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
|
||||
$level = \constant(Level::class.'::' . $matches[2]);
|
||||
$callback = [$this, $genericMethod];
|
||||
|
@@ -200,6 +200,7 @@ final class Utils
|
||||
$data = preg_replace_callback(
|
||||
'/[\x80-\xFF]+/',
|
||||
function (array $m): string {
|
||||
// @phpstan-ignore function.deprecated
|
||||
return \function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]);
|
||||
},
|
||||
$data
|
||||
@@ -234,12 +235,12 @@ final class Utils
|
||||
return (int) $val;
|
||||
}
|
||||
|
||||
if (preg_match('/^\s*(?<val>\d+)(?:\.\d+)?\s*(?<unit>[gmk]?)\s*$/i', $val, $match) !== 1) {
|
||||
if (!(bool) preg_match('/^\s*(?<val>\d+)(?:\.\d+)?\s*(?<unit>[gmk]?)\s*$/i', $val, $match)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$val = (int) $match['val'];
|
||||
switch (strtolower($match['unit'] ?? '')) {
|
||||
switch (strtolower($match['unit'])) {
|
||||
case 'g':
|
||||
$val *= 1024;
|
||||
// no break
|
||||
|
Reference in New Issue
Block a user