GuzzleStreamFactory::createStream()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
c 1
b 0
f 0
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
 * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory
13
 */
14
final class GuzzleStreamFactory implements StreamFactory
15
{
16
    /**
17 7
     * {@inheritdoc}
18
     */
19 7
    public function createStream($body = null)
20
    {
21
        return \GuzzleHttp\Psr7\stream_for($body);
0 ignored issues
show
Deprecated Code introduced by
The function GuzzleHttp\Psr7\stream_for() has been deprecated: stream_for will be removed in guzzlehttp/psr7:2.0. Use Utils::streamFor instead. ( Ignorable by Annotation )

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

21
        return /** @scrutinizer ignore-deprecated */ \GuzzleHttp\Psr7\stream_for($body);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
22
    }
23
}
24