Completed
Pull Request — master (#86)
by Eduardo
01:31
created

Memcached::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 10
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\ServerMonitor\CheckDefinitions;
4
5
use Symfony\Component\Process\Process;
6
7
class Memcached extends CheckDefinition
8
{
9
    public $command = 'service memcached status';
10
11
    public function resolve(Process $process)
12
    {
13
        if (str_contains($process->getOutput(), 'memcached is running')) || (str_contains($process->getOutput(), 'active (running)') ) {
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_BOOLEAN_OR
Loading history...
14
            $this->check->succeed('is running');
15
16
            return;
17
        }
18
19
        $this->check->fail('is not running');
20
    }
21
}
22