forked from zepgram/module-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRequestAdapter.php
executable file
·78 lines (65 loc) · 1.53 KB
/
RequestAdapter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* This file is part of Zepgram\Rest\Model
*
* @package Zepgram\Rest\Model
* @file RequestAdapter.php
* @date 04 11 2021 23:28
*
* @author Benjamin Calef <[email protected]>
* @copyright 2021 Zepgram Copyright (c) (https://github.com/zepgram)
* @license MIT License
**/
declare(strict_types=1);
namespace Zepgram\Rest\Model;
use Magento\Framework\DataObject;
abstract class RequestAdapter
{
/** @var string */
protected const HEADER_ACCEPT = 'Accept';
/** @var string */
protected const HEADER_CONTENT_TYPE = 'Content-Type';
/** @var string */
protected const CONTENT_TYPE = 'application/json';
/** @var string */
protected const HEADER_ACCEPT_LANGUAGE = 'Accept-Language';
/** @var string */
protected const SERVICE_ENDPOINT = '';
/**
* @param DataObject $rawRawData
*/
public function dispatch(DataObject $rawRawData): void //@codingStandardsIgnoreLine
{
}
/**
* @return array
*/
public function getBody(): array
{
return [];
}
/**
* @return array
*/
public function getHeaders(): array
{
return [
self::HEADER_ACCEPT => static::CONTENT_TYPE,
self::HEADER_CONTENT_TYPE => static::CONTENT_TYPE
];
}
/**
* @return string
*/
public function getUri(): string
{
return static::SERVICE_ENDPOINT;
}
/**
* @return string|null
*/
public function getCacheKey(): ?string
{
return null;
}
}