MessageFactoryInterface::hasBaseUri()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Ivory Http Adapter package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\HttpAdapter\Message;
13
14
use Guzzle\Stream\StreamInterface;
15
use Ivory\HttpAdapter\HttpAdapterException;
16
use Psr\Http\Message\UriInterface;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
interface MessageFactoryInterface
22
{
23
    /**
24
     * @return bool
25
     */
26
    public function hasBaseUri();
27
28
    /**
29
     * @return UriInterface|null
30
     */
31
    public function getBaseUri();
32
33
    /**
34
     * @param string|UriInterface|null $baseUri
35
     *
36
     * @throws HttpAdapterException
37
     */
38
    public function setBaseUri($baseUri);
39
40
    /**
41
     * @param string|object                        $uri
42
     * @param string                               $method
43
     * @param string                               $protocolVersion
44
     * @param array                                $headers
45
     * @param resource|string|StreamInterface|null $body
46
     * @param array                                $parameters
47
     *
48
     * @return RequestInterface
49
     */
50
    public function createRequest(
51
        $uri,
52
        $method = RequestInterface::METHOD_GET,
53
        $protocolVersion = RequestInterface::PROTOCOL_VERSION_1_1,
54
        array $headers = [],
55
        $body = null,
56
        array $parameters = []
57
    );
58
59
    /**
60
     * @param string|object $uri
61
     * @param string        $method
62
     * @param string        $protocolVersion
63
     * @param array         $headers
64
     * @param array|string  $datas
65
     * @param array         $files
66
     * @param array         $parameters
67
     *
68
     * @return InternalRequestInterface
69
     */
70
    public function createInternalRequest(
71
        $uri,
72
        $method = RequestInterface::METHOD_GET,
73
        $protocolVersion = RequestInterface::PROTOCOL_VERSION_1_1,
74
        array $headers = [],
75
        $datas = [],
76
        array $files = [],
77
        array $parameters = []
78
    );
79
80
    /**
81
     * @param int                                  $statusCode
82
     * @param string                               $protocolVersion
83
     * @param array                                $headers
84
     * @param resource|string|StreamInterface|null $body
85
     * @param array                                $parameters
86
     *
87
     * @return ResponseInterface
88
     */
89
    public function createResponse(
90
        $statusCode = 200,
91
        $protocolVersion = RequestInterface::PROTOCOL_VERSION_1_1,
92
        array $headers = [],
93
        $body = null,
94
        array $parameters = []
95
    );
96
}
97