Issues (7)

ReadinessChecker/PhiremockClientChecker.php (2 issues)

1
<?php
2
/**
3
 * This file is part of codeception-phiremock-extension.
4
 *
5
 * phiremock-codeception-extension is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Lesser General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * phiremock-codeception-extension is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with phiremock-codeception-extension.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace Mcustiel\Phiremock\Codeception\Extension\ReadinessChecker;
20
21
use GuzzleHttp\Exception\ConnectException;
22
use Mcustiel\Phiremock\Client\Phiremock;
0 ignored issues
show
The type Mcustiel\Phiremock\Client\Phiremock was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
use Mcustiel\Phiremock\Codeception\Extension\ReadinessCheckerInterface;
24
25
class PhiremockClientChecker implements ReadinessCheckerInterface
26
{
27
    private $client;
28
29
    public function __construct(Phiremock $client)
30
    {
31
        $this->client = $client;
32
    }
33
34
    public function isReady(): bool
35
    {
36
        try {
37
            $this->client->reset();
38
            return true;
39
        } catch (ConnectException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
40
        }
41
42
        return false;
43
    }
44
}
45