Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
| SocketRequest | |
0.00% |
0 / 6 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getOrigin | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRequestLanguage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLocale | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRouteVerb | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package phpOMS\Message\Socket |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace phpOMS\Message\Socket; |
| 16 | |
| 17 | use phpOMS\Message\RequestAbstract; |
| 18 | use phpOMS\Router\RouteVerb; |
| 19 | |
| 20 | /** |
| 21 | * Request class. |
| 22 | * |
| 23 | * @package phpOMS\Message\Socket |
| 24 | * @license OMS License 2.0 |
| 25 | * @link https://jingga.app |
| 26 | * @since 1.0.0 |
| 27 | */ |
| 28 | final class SocketRequest extends RequestAbstract |
| 29 | { |
| 30 | /** |
| 31 | * Constructor |
| 32 | * |
| 33 | * @since 1.0.0 |
| 34 | */ |
| 35 | public function __construct() |
| 36 | { |
| 37 | $this->header = new SocketHeader(); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * {@inheritdoc} |
| 42 | */ |
| 43 | public function getOrigin() : string |
| 44 | { |
| 45 | return '127.0.0.1'; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Get request language |
| 50 | * |
| 51 | * @return string |
| 52 | * |
| 53 | * @since 1.0.0 |
| 54 | */ |
| 55 | public function getRequestLanguage() : string |
| 56 | { |
| 57 | return 'en'; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Get request locale |
| 62 | * |
| 63 | * @return string |
| 64 | * |
| 65 | * @since 1.0.0 |
| 66 | */ |
| 67 | public function getLocale() : string |
| 68 | { |
| 69 | return 'en_US'; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * {@inheritdoc} |
| 74 | */ |
| 75 | public function getBody() : string |
| 76 | { |
| 77 | return ''; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * {@inheritdoc} |
| 82 | */ |
| 83 | public function getRouteVerb() : int |
| 84 | { |
| 85 | return RouteVerb::ANY; |
| 86 | } |
| 87 | } |