Новые классы для работы со схемами

This commit is contained in:
Anthony Axenov 2020-04-15 21:38:33 +08:00
parent 9ce4997699
commit 1061e1d3a7
4 changed files with 50 additions and 0 deletions

View File

@ -35,6 +35,7 @@
"autoload": { "autoload": {
"classmap": [ "classmap": [
"src/AtolOnline/Api/", "src/AtolOnline/Api/",
"src/AtolOnline/Api/Schemas/",
"src/AtolOnline/Exceptions/", "src/AtolOnline/Exceptions/",
"src/AtolOnline/Entities/", "src/AtolOnline/Entities/",
"src/AtolOnline/Traits/", "src/AtolOnline/Traits/",

View File

@ -0,0 +1,15 @@
<?php
namespace AtolOnline\Api;
abstract class AtolSchema
{
/**
* @return mixed
*/
public static function get()
{
return static::$json
?? static::$json = json_decode(file_get_contents(static::$URL));
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace AtolOnline\Api;
class CorrectionSchema extends AtolSchema
{
/**
* @var
*/
protected static $json;
/**
* Адрес схемы
*/
protected static $URL = 'https://online.atol.ru/possystem/v4/schema/correction';
}

View File

@ -0,0 +1,17 @@
<?php
namespace AtolOnline\Api;
class SellSchema extends AtolSchema
{
/**
* @var
*/
protected static $json;
/**
* Адрес схемы
*/
protected static $URL = 'https://online.atol.ru/possystem/v4/schema/sell';
}