Completed
Pull Request — master (#2)
by Márk
02:43
created

GuzzleStreamFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 10
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createStream() 0 4 1
1
<?php
2
3
namespace Http\Message\StreamFactory;
4
5
use Http\Message\StreamFactory;
6
7
/**
8
 * Creates Guzzle streams.
9
 *
10
 * @author Михаил Красильников <[email protected]>
11
 */
12
final class GuzzleStreamFactory implements StreamFactory
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 4
    public function createStream($body = null)
18
    {
19 4
        return \GuzzleHttp\Psr7\stream_for($body);
0 ignored issues
show
Bug introduced by
It seems like $body defined by parameter $body on line 17 can also be of type null; however, GuzzleHttp\Psr7\stream_for() does only seem to accept string|resource|object<P...essage\StreamInterface>, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
20
    }
21
}
22