| Total Complexity | 1 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | abstract class Base |
||
| 21 | { |
||
| 22 | /** @var string Connector name */ |
||
| 23 | const NAME = 'Comarch'; |
||
| 24 | /** @var string Log name */ |
||
| 25 | const LOG_NAME = 'App\Integrations\Comarch'; |
||
| 26 | /** @var \App\Integrations\Comarch\Config Config instance. */ |
||
| 27 | public $config; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Constructor. |
||
| 31 | * |
||
| 32 | * @param \App\Integrations\Comarch\Config $config |
||
| 33 | */ |
||
| 34 | public function __construct(\App\Integrations\Comarch\Config $config) |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Authorization. |
||
| 41 | * |
||
| 42 | * @return void |
||
| 43 | */ |
||
| 44 | abstract public function authorize(): void; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Check if authorized. |
||
| 48 | * |
||
| 49 | * @return bool |
||
| 50 | */ |
||
| 51 | abstract public function isAuthorized(): bool; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Function to send request. |
||
| 55 | * |
||
| 56 | * @param string $method |
||
| 57 | * @param string $action |
||
| 58 | * @param array $params |
||
| 59 | * |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | abstract public function request(string $method, string $action, array $params = []): string; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Get information about Comarch ERP. |
||
| 66 | * |
||
| 67 | * @return array |
||
| 68 | */ |
||
| 69 | abstract public function getInfo(): array; |
||
| 70 | } |
||
| 71 |