Completed
Push — master ( 88eea6...1145d2 )
by Freek
02:10
created

MySql::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Spatie\ServerMonitor\CheckDefinitions;
4
5
use Symfony\Component\Process\Process;
6
7
final class MySql extends CheckDefinition
8
{
9
    public $command = 'ps -e | grep mysqld$';
10
11
    public function resolve(Process $process)
12
    {
13
        if (str_contains($process->getOutput(), 'mysql')) {
14
            $this->check->succeed('is running');
15
16
            return;
17
        }
18
19
        $this->check->fail('is not running');
20
    }
21
}
22