Skip to content

Commit 3c47387

Browse files
committed
Add HttpResponse stubs
1 parent 5110862 commit 3c47387

File tree

2 files changed

+176
-0
lines changed

2 files changed

+176
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
3+
namespace Bitrix\Main;
4+
5+
use Bitrix\Main\Web;
6+
7+
class HttpResponse extends Response
8+
{
9+
const STORE_COOKIE_NAME = "STORE_COOKIES";
10+
11+
/**
12+
* Undocumented function
13+
*
14+
* @param string $text
15+
* @return void
16+
*/
17+
public function flush(string $text = ''): void
18+
{ }
19+
20+
/**
21+
* Adds a HTTP header field to the response.
22+
*
23+
* @param string $name Header field name
24+
* @param string $value Header field value
25+
* @return $this
26+
* @throws ArgumentNullException
27+
*/
28+
public function addHeader(string $name, string $value = ''): self
29+
{
30+
return $this;
31+
}
32+
33+
/**
34+
* Sets a collection of HTTP headers.
35+
*
36+
* @param Web\HttpHeaders $headers Headers collection.
37+
*
38+
* @return $this
39+
*/
40+
public function setHeaders(Web\HttpHeaders $headers): self
41+
{
42+
return $this;
43+
}
44+
45+
/**
46+
* Adds a cookie to the response.
47+
*
48+
* @param Web\Cookie $cookie The cookie.
49+
* @param boolean $replace Replace an existing cookie or not.
50+
* @param boolean $checkExpires Check expires value of the cookie or not.
51+
* @return $this
52+
*/
53+
public function addCookie(Web\Cookie $cookie, bool $replace = true, bool $checkExpires = true): self
54+
{
55+
return $this;
56+
}
57+
58+
/**
59+
* Remembers user's choice about storing persistent cookies.
60+
*
61+
* @param boolean $mode
62+
*/
63+
public function allowPersistentCookies(bool $mode)
64+
{ }
65+
66+
/**
67+
* @return Web\Cookie
68+
*/
69+
public function getCookies(): Web\Cookie
70+
{
71+
return new Web\Cookie('', null);
72+
}
73+
74+
/**
75+
* Undocumented function
76+
*
77+
* @return Web\HttpHeaders
78+
*/
79+
public function getHeaders(): Web\HttpHeaders
80+
{
81+
return new Web\HttpHeaders();
82+
}
83+
84+
/**
85+
* Sets the HTTP status of the response.
86+
*
87+
* @param string $status
88+
* @return $this
89+
* @throws ArgumentNullException
90+
* @throws ArgumentOutOfRangeException
91+
*/
92+
public function setStatus(string $status): self
93+
{
94+
return $this;
95+
}
96+
97+
/**
98+
* Returns the HTTP status of the response.
99+
*
100+
* @return int|string|null
101+
*/
102+
public function getStatus()
103+
{
104+
return null;
105+
}
106+
107+
/**
108+
* Sets the latest time for the Last-Modified header field.
109+
*
110+
* @param Type\DateTime $time
111+
* @return $this
112+
*/
113+
public function setLastModified(Type\DateTime $time): self
114+
{
115+
return $this;
116+
}
117+
118+
/**
119+
* Undocumented function
120+
*
121+
* @param callable $job
122+
* @param array $args
123+
* @return void
124+
*/
125+
public function addBackgroundJob(callable $job, array $args = []): self
126+
{
127+
return $this;
128+
}
129+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace Bitrix\Main;
4+
5+
abstract class Response
6+
{
7+
/**
8+
* Undocumented function
9+
*
10+
* @param string $text
11+
* @return void
12+
*/
13+
public function flush(string $text = ''): void
14+
{ }
15+
16+
/**
17+
* Sets content.
18+
* Valid types are strings, numbers, null, and objects that implement a __toString() method.
19+
*
20+
* @param mixed $content Content that can be cast to string.
21+
*
22+
* @return $this
23+
* @throws ArgumentTypeException
24+
*/
25+
public function setContent($content): self
26+
{
27+
return $this;
28+
}
29+
30+
/**
31+
* Returns content of response.
32+
*
33+
* @return string
34+
*/
35+
public function getContent(): string
36+
{
37+
return '';
38+
}
39+
40+
/**
41+
* Sends content to the output.
42+
*
43+
* @return void
44+
*/
45+
public function send(): void
46+
{ }
47+
}

0 commit comments

Comments
 (0)