-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<?php | ||
|
||
namespace Bitrix\Main; | ||
|
||
use Bitrix\Main\Web; | ||
|
||
class HttpResponse extends Response | ||
{ | ||
const STORE_COOKIE_NAME = "STORE_COOKIES"; | ||
|
||
/** | ||
* Undocumented function | ||
* | ||
* @param string $text | ||
* @return void | ||
*/ | ||
public function flush(string $text = ''): void | ||
{ } | ||
|
||
/** | ||
* Adds a HTTP header field to the response. | ||
* | ||
* @param string $name Header field name | ||
* @param string $value Header field value | ||
* @return $this | ||
* @throws ArgumentNullException | ||
*/ | ||
public function addHeader(string $name, string $value = ''): self | ||
{ | ||
return $this; | ||
} | ||
|
||
/** | ||
* Sets a collection of HTTP headers. | ||
* | ||
* @param Web\HttpHeaders $headers Headers collection. | ||
* | ||
* @return $this | ||
*/ | ||
public function setHeaders(Web\HttpHeaders $headers): self | ||
{ | ||
return $this; | ||
} | ||
|
||
/** | ||
* Adds a cookie to the response. | ||
* | ||
* @param Web\Cookie $cookie The cookie. | ||
* @param boolean $replace Replace an existing cookie or not. | ||
* @param boolean $checkExpires Check expires value of the cookie or not. | ||
* @return $this | ||
*/ | ||
public function addCookie(Web\Cookie $cookie, bool $replace = true, bool $checkExpires = true): self | ||
{ | ||
return $this; | ||
} | ||
|
||
/** | ||
* Remembers user's choice about storing persistent cookies. | ||
* | ||
* @param boolean $mode | ||
*/ | ||
public function allowPersistentCookies(bool $mode) | ||
{ } | ||
|
||
/** | ||
* @return Web\Cookie | ||
*/ | ||
public function getCookies(): Web\Cookie | ||
{ | ||
return new Web\Cookie('', null); | ||
} | ||
|
||
/** | ||
* Undocumented function | ||
* | ||
* @return Web\HttpHeaders | ||
*/ | ||
public function getHeaders(): Web\HttpHeaders | ||
{ | ||
return new Web\HttpHeaders(); | ||
} | ||
|
||
/** | ||
* Sets the HTTP status of the response. | ||
* | ||
* @param string $status | ||
* @return $this | ||
* @throws ArgumentNullException | ||
* @throws ArgumentOutOfRangeException | ||
*/ | ||
public function setStatus(string $status): self | ||
{ | ||
return $this; | ||
} | ||
|
||
/** | ||
* Returns the HTTP status of the response. | ||
* | ||
* @return int|string|null | ||
*/ | ||
public function getStatus() | ||
{ | ||
return null; | ||
} | ||
|
||
/** | ||
* Sets the latest time for the Last-Modified header field. | ||
* | ||
* @param Type\DateTime $time | ||
* @return $this | ||
*/ | ||
public function setLastModified(Type\DateTime $time): self | ||
{ | ||
return $this; | ||
} | ||
|
||
/** | ||
* Undocumented function | ||
* | ||
* @param callable $job | ||
* @param array $args | ||
* @return void | ||
*/ | ||
public function addBackgroundJob(callable $job, array $args = []): self | ||
{ | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Bitrix\Main; | ||
|
||
abstract class Response | ||
{ | ||
/** | ||
* Undocumented function | ||
* | ||
* @param string $text | ||
* @return void | ||
*/ | ||
public function flush(string $text = ''): void | ||
{ } | ||
|
||
/** | ||
* Sets content. | ||
* Valid types are strings, numbers, null, and objects that implement a __toString() method. | ||
* | ||
* @param mixed $content Content that can be cast to string. | ||
* | ||
* @return $this | ||
* @throws ArgumentTypeException | ||
*/ | ||
public function setContent($content): self | ||
{ | ||
return $this; | ||
} | ||
|
||
/** | ||
* Returns content of response. | ||
* | ||
* @return string | ||
*/ | ||
public function getContent(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
/** | ||
* Sends content to the output. | ||
* | ||
* @return void | ||
*/ | ||
public function send(): void | ||
{ } | ||
} |