Skip to content

Commit

Permalink
Merge pull request #98 from vdbelt/fix/deprecated_helpers
Browse files Browse the repository at this point in the history
Fix for deprecated helpers
  • Loading branch information
freekmurze committed Jul 24, 2019
2 parents 8009c51 + a4a4424 commit faacf61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/CheckDefinitions/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Spatie\ServerMonitor\CheckDefinitions;

use Illuminate\Support\Str;
use Symfony\Component\Process\Process;

class Elasticsearch extends CheckDefinition
Expand All @@ -23,7 +24,7 @@ public function command(): string

public function resolve(Process $process)
{
$checkSucceeded = str_contains($process->getOutput(), 'lucene_version');
$checkSucceeded = Str::contains($process->getOutput(), 'lucene_version');

if ($checkSucceeded) {
$this->check->succeed('is running');
Expand Down
3 changes: 2 additions & 1 deletion src/CheckDefinitions/Memcached.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Spatie\ServerMonitor\CheckDefinitions;

use Illuminate\Support\Str;
use Symfony\Component\Process\Process;

class Memcached extends CheckDefinition
Expand All @@ -10,7 +11,7 @@ class Memcached extends CheckDefinition

public function resolve(Process $process)
{
if (str_contains($process->getOutput(), ['memcached is running', 'active (running)'])) {
if (Str::contains($process->getOutput(), ['memcached is running', 'active (running)'])) {
$this->check->succeed('is running');

return;
Expand Down
3 changes: 2 additions & 1 deletion src/CheckDefinitions/MySql.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Spatie\ServerMonitor\CheckDefinitions;

use Illuminate\Support\Str;
use Symfony\Component\Process\Process;

class MySql extends CheckDefinition
Expand All @@ -10,7 +11,7 @@ class MySql extends CheckDefinition

public function resolve(Process $process)
{
if (str_contains($process->getOutput(), 'mysql')) {
if (Str::contains($process->getOutput(), 'mysql')) {
$this->check->succeed('is running');

return;
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Artisan;
use Carbon\Carbon;
use Illuminate\Support\Str;
use Spatie\ServerMonitor\Models\Host;
use Spatie\ServerMonitor\Models\Check;
use Symfony\Component\Process\Process;
Expand Down Expand Up @@ -127,7 +128,7 @@ protected function getFailedProcess(): Process

protected function assertStringContains($needle, $haystack)
{
$this->assertTrue(str_contains($haystack, $needle), "String `{$haystack}` did not contain `{$needle}`");
$this->assertTrue(Str::contains($haystack, $needle), "String `{$haystack}` did not contain `{$needle}`");
}

protected function letSshServerRespondWithDiskspaceUsagePercentage(int $diskspaceUsagePercentage)
Expand Down

0 comments on commit faacf61

Please sign in to comment.