Completed
Push — master ( 62eba7...9fc3a4 )
by Márk
08:43 queued 05:59
created

GuzzleStreamFactory::createStream()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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