Skip to content

Commit

Permalink
Merge pull request #2 from saeedvaziry/fix_str_helper
Browse files Browse the repository at this point in the history
fix Str helper not found error
  • Loading branch information
saeedvaziry authored Jan 12, 2022
2 parents e24c36d + 7424be3 commit 6eff39c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/Actions/RecordUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace SaeedVaziry\Monitoring\Actions;

use Illuminate\Support\Str;
use SaeedVaziry\Monitoring\Exceptions\OSIsNotSupported;
use SaeedVaziry\Monitoring\Models\MonitoringRecord;

Expand All @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions src/System/CPU.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace SaeedVaziry\Monitoring\System;

use Illuminate\Support\Str;

class CPU implements SystemResource
{
/**
Expand All @@ -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;
}
Expand Down
4 changes: 1 addition & 3 deletions src/System/Disk.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace SaeedVaziry\Monitoring\System;

use Illuminate\Support\Str;

class Disk implements SystemResource
{
/**
Expand All @@ -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;
}
Expand Down
4 changes: 1 addition & 3 deletions src/System/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace SaeedVaziry\Monitoring\System;

use Illuminate\Support\Str;

class Memory implements SystemResource
{
/**
Expand All @@ -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;
}
Expand Down

0 comments on commit 6eff39c

Please sign in to comment.