Passed
Pull Request — master (#27)
by Anatoly
04:06
created

ResponseFactory::createHtmlResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 3
b 0
f 0
nc 1
nop 2
dl 0
loc 11
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php declare(strict_types=1);
2
3
/**
4
 * It's free open-source software released under the MIT License.
5
 *
6
 * @author Anatoly Fenric <[email protected]>
7
 * @copyright Copyright (c) 2018, Anatoly Fenric
8
 * @license https://github.com/sunrise-php/http-message/blob/master/LICENSE
9
 * @link https://github.com/sunrise-php/http-message
10
 */
11
12
namespace Sunrise\Http\Message;
13
14
/**
15
 * Import classes
16
 */
17
use Psr\Http\Message\ResponseFactoryInterface;
18
use Psr\Http\Message\ResponseInterface;
19
20
/**
21
 * HTTP Response Message Factory
22
 *
23
 * @link https://www.php-fig.org/psr/psr-17/
24
 */
25
class ResponseFactory implements ResponseFactoryInterface
26
{
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 10
    public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
32
    {
33 10
        return new Response($code, $reasonPhrase);
34
    }
35
}
36