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

MySql   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 10 2
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