Completed
Pull Request — master (#129)
by
unknown
01:24
created

TestClientInjectionContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Behat\Context;
6
7
use Behat\Behat\Context\Context;
8
use Symfony\Component\BrowserKit\AbstractBrowser;
9
10
final class TestClientInjectionContext implements Context
11
{
12
    private $client;
13
14
    public function __construct(AbstractBrowser $client)
15
    {
16
        $this->client = $client;
17
    }
18
19
    /** @Then the client should be passed */
20
    public function clientShouldBePassed(): void
21
    {
22
        assert(is_object($this->client));
23
        assert($this->client instanceof AbstractBrowser);
0 ignored issues
show
Bug introduced by
The class Symfony\Component\BrowserKit\AbstractBrowser does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
24
    }
25
}