summaryrefslogtreecommitdiffstats
path: root/src/Monolog/Processor/MemoryProcessor.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Monolog/Processor/MemoryProcessor.php')
-rw-r--r--src/Monolog/Processor/MemoryProcessor.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Monolog/Processor/MemoryProcessor.php b/src/Monolog/Processor/MemoryProcessor.php
index 85f9dc5..5b06c2e 100644
--- a/src/Monolog/Processor/MemoryProcessor.php
+++ b/src/Monolog/Processor/MemoryProcessor.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -32,22 +32,20 @@ abstract class MemoryProcessor
* @param bool $realUsage Set this to true to get the real size of memory allocated from system.
* @param bool $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
*/
- public function __construct($realUsage = true, $useFormatting = true)
+ public function __construct(bool $realUsage = true, bool $useFormatting = true)
{
- $this->realUsage = (boolean) $realUsage;
- $this->useFormatting = (boolean) $useFormatting;
+ $this->realUsage = $realUsage;
+ $this->useFormatting = $useFormatting;
}
/**
* Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
*
* @param int $bytes
- * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is
+ * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as int
*/
- protected function formatBytes($bytes)
+ protected function formatBytes(int $bytes)
{
- $bytes = (int) $bytes;
-
if (!$this->useFormatting) {
return $bytes;
}