diff --git a/src/Actions/RecordUsage.php b/src/Actions/RecordUsage.php index f5f4013..b26decb 100644 --- a/src/Actions/RecordUsage.php +++ b/src/Actions/RecordUsage.php @@ -2,7 +2,6 @@ namespace SaeedVaziry\Monitoring\Actions; -use Illuminate\Support\Str; use SaeedVaziry\Monitoring\Exceptions\OSIsNotSupported; use SaeedVaziry\Monitoring\Models\MonitoringRecord; @@ -19,7 +18,7 @@ public function record(array $resources) $model = config('monitoring.models.monitoring_record'); $record = new $model([ - 'instance_name' => Str::replace(' ', '', config('monitoring.instance_name')), + 'instance_name' => str_replace(' ', '', config('monitoring.instance_name')), 'cpu' => $resources['cpu'] ?? null, 'memory' => $resources['memory'] ?? null, 'disk' => $resources['disk'] ?? null, diff --git a/src/System/CPU.php b/src/System/CPU.php index e5d0702..9ef555e 100644 --- a/src/System/CPU.php +++ b/src/System/CPU.php @@ -2,8 +2,6 @@ namespace SaeedVaziry\Monitoring\System; -use Illuminate\Support\Str; - class CPU implements SystemResource { /** @@ -15,7 +13,7 @@ public function usage() return 50; } - $usage = Str::replace("\n", '', shell_exec(file_get_contents(__DIR__ . '/../../scripts/cpu.sh'))); + $usage = str_replace("\n", '', shell_exec(file_get_contents(__DIR__ . '/../../scripts/cpu.sh'))); if (is_numeric($usage)) { return $usage; } diff --git a/src/System/Disk.php b/src/System/Disk.php index 3dfc177..cfd5bc6 100644 --- a/src/System/Disk.php +++ b/src/System/Disk.php @@ -2,8 +2,6 @@ namespace SaeedVaziry\Monitoring\System; -use Illuminate\Support\Str; - class Disk implements SystemResource { /** @@ -15,7 +13,7 @@ public function usage() return 50; } - $usage = Str::replace("\n", '', shell_exec(file_get_contents(__DIR__ . '/../../scripts/disk.sh'))); + $usage = str_replace("\n", '', shell_exec(file_get_contents(__DIR__ . '/../../scripts/disk.sh'))); if (is_numeric($usage)) { return $usage; } diff --git a/src/System/Memory.php b/src/System/Memory.php index 9bad775..1de5f55 100644 --- a/src/System/Memory.php +++ b/src/System/Memory.php @@ -2,8 +2,6 @@ namespace SaeedVaziry\Monitoring\System; -use Illuminate\Support\Str; - class Memory implements SystemResource { /** @@ -15,7 +13,7 @@ public function usage() return 50; } - $usage = Str::replace("\n", '', shell_exec(file_get_contents(__DIR__ . '/../../scripts/memory.sh'))); + $usage = str_replace("\n", '', shell_exec(file_get_contents(__DIR__ . '/../../scripts/memory.sh'))); if (is_numeric($usage)) { return $usage; }