Completed
Push — master ( e167bf...f8a4e6 )
by Freek
13s
created

src/CheckDefinitions/Elasticsearch.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Spatie\ServerMonitor\CheckDefinitions;
4
5
use Symfony\Component\Process\Process;
6
7
class Elasticsearch extends CheckDefinition
8
{
9
    public $command = 'curl --silent http://localhost:9200';
10
11 View Code Duplication
    public function resolve(Process $process)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
    {
13
        $checkSucceeded = str_contains($process->getOutput(), 'lucene_version');
14
15
        if ($checkSucceeded) {
16
            $this->check->succeed('is running');
17
18
            return;
19
        }
20
21
        $this->check->fail('is not running');
22
    }
23
}
24