HeadersMatch::assert()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Muzzle\Assertions;
4
5
use Muzzle\Messages\Transaction;
6
7
class HeadersMatch implements Assertion
8
{
9
10
    public function assert(Transaction $actual, Transaction $expected) : void
11
    {
12
13
        foreach ($expected->request()->getHeaders() as $header => $value) {
14
            $actual->request()->assertHeader($header, $value);
0 ignored issues
show
Bug introduced by
The method assertHeader() 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

14
            $actual->request()->/** @scrutinizer ignore-call */ assertHeader($header, $value);
Loading history...
15
        }
16
    }
17
}
18