Bicycle/System/Classes/HTTP/Request.php
Egor Isaev b65603b4d0 dev
2026-06-23 10:44:18 +03:00

55 lines
1.5 KiB
PHP

<?php
/**
* @package Bicycle
* @author Egor Isaev
* @description HTTP/Request.php
* @copyright (c) 04/06/2026
*/
namespace System\Classes\HTTP;
/**
* Контракт входящего HTTP-запроса и константы методов.
*/
interface Request
{
public const GET = 'GET';
public const POST = 'POST';
public const PUT = 'PUT';
public const PATCH = 'PATCH';
public const DELETE = 'DELETE';
public const HEAD = 'HEAD';
public const OPTIONS = 'OPTIONS';
/**
* Геттер/сеттер HTTP-метода.
*
* @param string|null $method Метод или null для чтения
* @return mixed
*/
public function method(?string $method = null);
/**
* @return mixed URI запроса
*/
public function uri();
/**
* Геттер/сеттер GET-параметров.
*
* @param string|array|null $key Ключ, массив или null
* @param mixed $value Значение при записи
* @return mixed
*/
public function query(null|string|array $key = null, mixed $value = null);
/**
* Геттер/сеттер POST-данных.
*
* @param string|array|null $key Ключ, массив или null
* @param mixed $value Значение при записи
* @return mixed
*/
public function post(null|string|array $key = null, mixed $value = null);
}