QueryContains::assert()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Muzzle\Assertions;
4
5
use Muzzle\Messages\Transaction;
6
use function GuzzleHttp\Psr7\parse_query;
7
8
class QueryContains implements Assertion
9
{
10
11
    public function assert(Transaction $actual, Transaction $expected) : void
12
    {
13
14
        if ($expected->request()->getUri()->getQuery() !== '') {
15
            $actual->request()->assertUriQueryContains(
0 ignored issues
show
Bug introduced by
The method assertUriQueryContains() does not exist on Psr\Http\Message\RequestInterface. It seems like you code against a sub-type of Psr\Http\Message\RequestInterface such as Muzzle\Messages\AssertableRequest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
            $actual->request()->/** @scrutinizer ignore-call */ assertUriQueryContains(
Loading history...
16
                parse_query($expected->request()->getUri()->getQuery())
17
            );
18
        }
19
    }
20
}
21