Passed
Pull Request — master (#7)
by Sandro
03:30
created

VpackStreamHandlerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A createStreamHandler() 0 3 1
1
<?php
2
/**
3
 * Sandro Keil (https://sandro-keil.de)
4
 *
5
 * @link      http://github.com/sandrokeil/arangodb-php-client for the canonical source repository
6
 * @copyright Copyright (c) 2018-2019 Sandro Keil
7
 * @license   http://github.com/sandrokeil/arangodb-php-client/blob/master/LICENSE.md New BSD License
8
 */
9
10
declare(strict_types=1);
11
12
namespace ArangoDb\Statement;
13
14
use Psr\Http\Message\StreamInterface;
15
16
class VpackStreamHandlerFactory implements StreamHandlerFactoryInterface
17
{
18
    /**
19
     * @var int
20
     */
21
    private $resultType;
22
23 2
    public function __construct(int $resultType)
24
    {
25 2
        $this->resultType = $resultType;
26 2
    }
27
28 2
    public function createStreamHandler(StreamInterface $body): StreamHandler
29
    {
30 2
        return new VpackStreamHandler($body, $this->resultType);
31
    }
32
}
33