mirror of
https://github.com/anthonyaxenov/atol-online.git
synced 2024-11-22 11:34:33 +00:00
Compare commits
7 Commits
2a66889e46
...
05fd25e810
Author | SHA1 | Date | |
---|---|---|---|
05fd25e810 | |||
3e03fdca61 | |||
c077f98cf9 | |||
2260233e3f | |||
c30c7d069f | |||
8f235d4730 | |||
85750cd211 |
@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
| master | [![CI](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml) | [![codecov](https://codecov.io/gh/anthonyaxenov/atol-online/branch/master/graph/badge.svg?token=WR2IV7FTF0)](https://codecov.io/gh/anthonyaxenov/atol-online) |
|
| master | [![CI](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml) | [![codecov](https://codecov.io/gh/anthonyaxenov/atol-online/branch/master/graph/badge.svg?token=WR2IV7FTF0)](https://codecov.io/gh/anthonyaxenov/atol-online) |
|
||||||
|---|---|---|
|
|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| dev | [![CI dev](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml) | [![codecov dev](https://codecov.io/gh/anthonyaxenov/atol-online/branch/dev/graph/badge.svg?token=WR2IV7FTF0)](https://codecov.io/gh/anthonyaxenov/atol-online) |
|
| dev | [![CI dev](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/anthonyaxenov/atol-online/actions/workflows/ci.yml) | [![codecov dev](https://codecov.io/gh/anthonyaxenov/atol-online/branch/dev/graph/badge.svg?token=WR2IV7FTF0)](https://codecov.io/gh/anthonyaxenov/atol-online) |
|
||||||
|
|
||||||
Текущие поддерживаемые версии АТОЛ Онлайн:
|
Текущие поддерживаемые версии АТОЛ Онлайн:
|
||||||
|
|
||||||
@ -92,7 +92,6 @@ composer test-cov # тестирование с покрытием
|
|||||||
* **[Документация к библиотеке](/docs/readme.md)**
|
* **[Документация к библиотеке](/docs/readme.md)**
|
||||||
* Telegram-канал: [@atolonline_php](https://t.me/atolonline_php)
|
* Telegram-канал: [@atolonline_php](https://t.me/atolonline_php)
|
||||||
* [Документация АТОЛ Онлайн](https://online.atol.ru/lib/)
|
* [Документация АТОЛ Онлайн](https://online.atol.ru/lib/)
|
||||||
* Функционал, находящийся в разработке: [ROADMAP.md](ROADMAP.md)
|
|
||||||
|
|
||||||
## Лицензия
|
## Лицензия
|
||||||
|
|
||||||
|
66
ROADMAP.md
66
ROADMAP.md
@ -1,66 +0,0 @@
|
|||||||
# Roadmap
|
|
||||||
|
|
||||||
Здесь перечислены реализованные функции и находящиеся в разработке.
|
|
||||||
|
|
||||||
Порядок их упоминания здесь может не совпадать с порядком реализации.
|
|
||||||
|
|
||||||
Эталонная реализация подразумевает полную поддержку всех методов API и обеих схем документов:
|
|
||||||
* [Документы прихода, возврата прихода, расхода, возврата расхода](https://online.atol.ru/possystem/v4/schema/sell)
|
|
||||||
* [Документы коррекции прихода, коррекции расхода](https://online.atol.ru/possystem/v4/schema/correction)
|
|
||||||
|
|
||||||
## Общий функционал библиотеки
|
|
||||||
|
|
||||||
- [x] Переключение настроек доступа к ККТ при переключении тестового режима
|
|
||||||
- [x] Тесты для класса налоговой ставки (+ массив)
|
|
||||||
- [ ] Тесты для класса оплаты (+ массив)
|
|
||||||
- [x] Тесты для класса предмета расчёта (+ массив)
|
|
||||||
- [x] Тесты для класса клиента
|
|
||||||
- [x] Тесты для класса компании
|
|
||||||
- [ ] Тесты для класса данных коррекций
|
|
||||||
- [ ] Тесты для класса документа
|
|
||||||
- [ ] Тесты для класса ответа ККТ
|
|
||||||
- [ ] Тесты для регистрации документа прихода
|
|
||||||
- [ ] Тесты для регистрации документа возврата прихода
|
|
||||||
- [ ] Тесты для регистрации документа коррекции прихода
|
|
||||||
- [ ] Тесты для регистрации документа расхода
|
|
||||||
- [ ] Тесты для регистрации документа возврата расхода
|
|
||||||
- [ ] Тесты для регистрации документа коррекции расхода
|
|
||||||
- [ ] Вообще все расчёты вообще везде должны быть строго в копейках.
|
|
||||||
Рубли (дроби) должны быть только в JSON-представлениях
|
|
||||||
|
|
||||||
## Поддержка методов API (регистрация документов)
|
|
||||||
|
|
||||||
- [x] приход
|
|
||||||
- [x] расход
|
|
||||||
- [x] возврат прихода
|
|
||||||
- [x] возврат расхода
|
|
||||||
- [x] коррекция прихода
|
|
||||||
- [x] коррекция расхода
|
|
||||||
- [x] проверка статуса документа
|
|
||||||
|
|
||||||
## Документы прихода, возврата прихода, расхода, возврата расхода
|
|
||||||
|
|
||||||
- [x] Пoддержка `receipt.client` (обязательный)
|
|
||||||
- [x] Пoддержка `receipt.company` (обязательный)
|
|
||||||
- [x] Пoддержка `receipt.items` (обязательный)
|
|
||||||
- [x] Пoддержка `receipt.total` (обязательный)
|
|
||||||
- [x] Пoддержка `receipt.payments` (обязательный)
|
|
||||||
- [x] Пoддержка `receipt.vats`
|
|
||||||
- [ ] Пoддержка `receipt.additional_check_props`
|
|
||||||
- [x] Пoддержка `receipt.cashier`
|
|
||||||
- [ ] Пoддержка `receipt.additional_user_props`
|
|
||||||
- [ ] Пoддержка `receipt.agent_info`
|
|
||||||
- [ ] Пoддержка `receipt.supplier_info`
|
|
||||||
- [ ] Пoддержка `receipt.items.agent_info`
|
|
||||||
- [ ] Пoддержка `receipt.items.supplier_info`
|
|
||||||
- [ ] Пoддержка `receipt.items.nomenclature_code`
|
|
||||||
- [ ] Пoддержка `receipt.items.excise`
|
|
||||||
- [ ] Пoддержка `receipt.items.country_code`
|
|
||||||
- [ ] Пoддержка `receipt.items.declaration_number`
|
|
||||||
|
|
||||||
## Документы коррекции прихода, коррекции расхода
|
|
||||||
|
|
||||||
- [x] Пoддержка `correction.company` (обязательный)
|
|
||||||
- [x] Пoддержка `correction.vats` (обязательный)
|
|
||||||
- [x] Пoддержка `correction.correction_info` (обязательный)
|
|
||||||
- [x] Пoддержка `correction.cashier`
|
|
@ -56,7 +56,8 @@
|
|||||||
"psr/log": "^3",
|
"psr/log": "^3",
|
||||||
"ramsey/uuid": "^4.2",
|
"ramsey/uuid": "^4.2",
|
||||||
"myclabs/php-enum": "^1.8",
|
"myclabs/php-enum": "^1.8",
|
||||||
"illuminate/collections": "^8.70"
|
"illuminate/collections": "^8.70",
|
||||||
|
"jetbrains/phpstorm-attributes": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9.5"
|
"phpunit/phpunit": "^9.5"
|
||||||
|
300
composer.lock
generated
300
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "b03e06fba2a861f7ce366484ec6421c3",
|
"content-hash": "4877f27cd59b6558eea01644e2d520ef",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
@ -50,6 +50,10 @@
|
|||||||
"brick",
|
"brick",
|
||||||
"math"
|
"math"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/brick/math/issues",
|
||||||
|
"source": "https://github.com/brick/math/tree/0.9.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/BenMorel",
|
"url": "https://github.com/BenMorel",
|
||||||
@ -166,6 +170,10 @@
|
|||||||
"rest",
|
"rest",
|
||||||
"web service"
|
"web service"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||||
|
"source": "https://github.com/guzzle/guzzle/tree/7.4.0"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/GrahamCampbell",
|
"url": "https://github.com/GrahamCampbell",
|
||||||
@ -246,6 +254,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"promise"
|
"promise"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/guzzle/promises/issues",
|
||||||
|
"source": "https://github.com/guzzle/promises/tree/1.5.1"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/GrahamCampbell",
|
"url": "https://github.com/GrahamCampbell",
|
||||||
@ -357,6 +369,10 @@
|
|||||||
"uri",
|
"uri",
|
||||||
"url"
|
"url"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/guzzle/psr7/issues",
|
||||||
|
"source": "https://github.com/guzzle/psr7/tree/2.1.0"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/GrahamCampbell",
|
"url": "https://github.com/GrahamCampbell",
|
||||||
@ -375,16 +391,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/collections",
|
"name": "illuminate/collections",
|
||||||
"version": "v8.70.2",
|
"version": "v8.74.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/collections.git",
|
"url": "https://github.com/illuminate/collections.git",
|
||||||
"reference": "05f286ec5fd2dd286e8384577047efc375c8954c"
|
"reference": "f292b77824b42cd28decc7327e7c2e24c3806371"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/collections/zipball/05f286ec5fd2dd286e8384577047efc375c8954c",
|
"url": "https://api.github.com/repos/illuminate/collections/zipball/f292b77824b42cd28decc7327e7c2e24c3806371",
|
||||||
"reference": "05f286ec5fd2dd286e8384577047efc375c8954c",
|
"reference": "f292b77824b42cd28decc7327e7c2e24c3806371",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -393,7 +409,7 @@
|
|||||||
"php": "^7.3|^8.0"
|
"php": "^7.3|^8.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"symfony/var-dumper": "Required to use the dump method (^5.1.4)."
|
"symfony/var-dumper": "Required to use the dump method (^5.4)."
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@ -421,20 +437,24 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Collections package.",
|
"description": "The Illuminate Collections package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2021-10-22T18:01:46+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-11-30T14:29:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/contracts",
|
"name": "illuminate/contracts",
|
||||||
"version": "v8.70.2",
|
"version": "v8.74.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/contracts.git",
|
"url": "https://github.com/illuminate/contracts.git",
|
||||||
"reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0"
|
"reference": "b0886ec05a63b204634d64d0b39d5b78a7c06f81"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/e76f4bce73a2a1656add24bd5210ebc4b8af49c0",
|
"url": "https://api.github.com/repos/illuminate/contracts/zipball/b0886ec05a63b204634d64d0b39d5b78a7c06f81",
|
||||||
"reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0",
|
"reference": "b0886ec05a63b204634d64d0b39d5b78a7c06f81",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -465,20 +485,24 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Contracts package.",
|
"description": "The Illuminate Contracts package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2021-10-22T18:01:46+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-11-17T15:04:30+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/macroable",
|
"name": "illuminate/macroable",
|
||||||
"version": "v8.70.2",
|
"version": "v8.74.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/macroable.git",
|
"url": "https://github.com/illuminate/macroable.git",
|
||||||
"reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05"
|
"reference": "aed81891a6e046fdee72edd497f822190f61c162"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05",
|
"url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162",
|
||||||
"reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05",
|
"reference": "aed81891a6e046fdee72edd497f822190f61c162",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -507,7 +531,53 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Macroable package.",
|
"description": "The Illuminate Macroable package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2020-10-27T15:20:30+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-11-16T13:57:03+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "jetbrains/phpstorm-attributes",
|
||||||
|
"version": "1.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/JetBrains/phpstorm-attributes.git",
|
||||||
|
"reference": "a7a83ae5df4dd3c0875484483de19de8edf60a9f"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/JetBrains/phpstorm-attributes/zipball/a7a83ae5df4dd3c0875484483de19de8edf60a9f",
|
||||||
|
"reference": "a7a83ae5df4dd3c0875484483de19de8edf60a9f",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"JetBrains\\PhpStorm\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Apache-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "JetBrains",
|
||||||
|
"homepage": "https://www.jetbrains.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PhpStorm specific attributes",
|
||||||
|
"keywords": [
|
||||||
|
"attributes",
|
||||||
|
"jetbrains",
|
||||||
|
"phpstorm"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://youtrack.jetbrains.com/newIssue?project=WI",
|
||||||
|
"source": "https://github.com/JetBrains/phpstorm-attributes/tree/1.0"
|
||||||
|
},
|
||||||
|
"time": "2020-11-17T11:09:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "myclabs/php-enum",
|
"name": "myclabs/php-enum",
|
||||||
@ -553,6 +623,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"enum"
|
"enum"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/myclabs/php-enum/issues",
|
||||||
|
"source": "https://github.com/myclabs/php-enum/tree/1.8.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/mnapoli",
|
"url": "https://github.com/mnapoli",
|
||||||
@ -607,6 +681,10 @@
|
|||||||
"container-interop",
|
"container-interop",
|
||||||
"psr"
|
"psr"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/php-fig/container/issues",
|
||||||
|
"source": "https://github.com/php-fig/container/tree/1.1.2"
|
||||||
|
},
|
||||||
"time": "2021-11-05T16:50:12+00:00"
|
"time": "2021-11-05T16:50:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -656,6 +734,9 @@
|
|||||||
"psr",
|
"psr",
|
||||||
"psr-18"
|
"psr-18"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/http-client/tree/master"
|
||||||
|
},
|
||||||
"time": "2020-06-29T06:28:15+00:00"
|
"time": "2020-06-29T06:28:15+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -708,6 +789,9 @@
|
|||||||
"request",
|
"request",
|
||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/http-factory/tree/master"
|
||||||
|
},
|
||||||
"time": "2019-04-30T12:38:16+00:00"
|
"time": "2019-04-30T12:38:16+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -808,6 +892,9 @@
|
|||||||
"psr",
|
"psr",
|
||||||
"psr-3"
|
"psr-3"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/log/tree/3.0.0"
|
||||||
|
},
|
||||||
"time": "2021-07-14T16:46:02+00:00"
|
"time": "2021-07-14T16:46:02+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -856,6 +943,9 @@
|
|||||||
"psr-16",
|
"psr-16",
|
||||||
"simple-cache"
|
"simple-cache"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/simple-cache/tree/master"
|
||||||
|
},
|
||||||
"time": "2017-10-23T01:57:42+00:00"
|
"time": "2017-10-23T01:57:42+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -965,6 +1055,10 @@
|
|||||||
"queue",
|
"queue",
|
||||||
"set"
|
"set"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/ramsey/collection/issues",
|
||||||
|
"source": "https://github.com/ramsey/collection/tree/1.2.2"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/ramsey",
|
"url": "https://github.com/ramsey",
|
||||||
@ -1059,6 +1153,10 @@
|
|||||||
"identifier",
|
"identifier",
|
||||||
"uuid"
|
"uuid"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/ramsey/uuid/issues",
|
||||||
|
"source": "https://github.com/ramsey/uuid/tree/4.2.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/ramsey",
|
"url": "https://github.com/ramsey",
|
||||||
@ -1073,16 +1171,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v2.4.0",
|
"version": "v2.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
"reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627"
|
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627",
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
|
||||||
"reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627",
|
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1091,7 +1189,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "2.4-dev"
|
"dev-main": "2.5-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
@ -1119,6 +1217,9 @@
|
|||||||
],
|
],
|
||||||
"description": "A generic function and convention to trigger deprecation notices",
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://symfony.com/sponsor",
|
"url": "https://symfony.com/sponsor",
|
||||||
@ -1133,7 +1234,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-03-23T23:28:01+00:00"
|
"time": "2021-07-12T14:48:14+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
@ -1195,6 +1296,9 @@
|
|||||||
"polyfill",
|
"polyfill",
|
||||||
"portable"
|
"portable"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://symfony.com/sponsor",
|
"url": "https://symfony.com/sponsor",
|
||||||
@ -1275,6 +1379,9 @@
|
|||||||
"portable",
|
"portable",
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://symfony.com/sponsor",
|
"url": "https://symfony.com/sponsor",
|
||||||
@ -1351,6 +1458,9 @@
|
|||||||
"portable",
|
"portable",
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://symfony.com/sponsor",
|
"url": "https://symfony.com/sponsor",
|
||||||
@ -1498,16 +1608,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nikic/php-parser",
|
"name": "nikic/php-parser",
|
||||||
"version": "v4.13.1",
|
"version": "v4.13.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||||
"reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd"
|
"reference": "210577fe3cf7badcc5814d99455df46564f3c077"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd",
|
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
|
||||||
"reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd",
|
"reference": "210577fe3cf7badcc5814d99455df46564f3c077",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1546,7 +1656,11 @@
|
|||||||
"parser",
|
"parser",
|
||||||
"php"
|
"php"
|
||||||
],
|
],
|
||||||
"time": "2021-11-03T20:52:16+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
||||||
|
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
|
||||||
|
},
|
||||||
|
"time": "2021-11-30T19:35:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phar-io/manifest",
|
"name": "phar-io/manifest",
|
||||||
@ -1602,6 +1716,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
|
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phar-io/manifest/issues",
|
||||||
|
"source": "https://github.com/phar-io/manifest/tree/2.0.3"
|
||||||
|
},
|
||||||
"time": "2021-07-20T11:28:43+00:00"
|
"time": "2021-07-20T11:28:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1759,6 +1877,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
||||||
|
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
|
||||||
|
},
|
||||||
"time": "2021-10-19T17:43:47+00:00"
|
"time": "2021-10-19T17:43:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1805,6 +1927,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
|
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
|
||||||
|
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
|
||||||
|
},
|
||||||
"time": "2021-10-02T14:08:47+00:00"
|
"time": "2021-10-02T14:08:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1868,20 +1994,24 @@
|
|||||||
"spy",
|
"spy",
|
||||||
"stub"
|
"stub"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phpspec/prophecy/issues",
|
||||||
|
"source": "https://github.com/phpspec/prophecy/tree/1.14.0"
|
||||||
|
},
|
||||||
"time": "2021-09-10T09:02:12+00:00"
|
"time": "2021-09-10T09:02:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
"version": "9.2.8",
|
"version": "9.2.9",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||||
"reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e"
|
"reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f301eb1453c9e7a1bc912ee8b0ea9db22c60223b",
|
||||||
"reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e",
|
"reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1935,26 +2065,30 @@
|
|||||||
"testing",
|
"testing",
|
||||||
"xunit"
|
"xunit"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.9"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-10-30T08:01:38+00:00"
|
"time": "2021-11-19T15:21:02+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-file-iterator",
|
"name": "phpunit/php-file-iterator",
|
||||||
"version": "3.0.5",
|
"version": "3.0.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
||||||
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
|
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
|
||||||
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
|
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1991,13 +2125,17 @@
|
|||||||
"filesystem",
|
"filesystem",
|
||||||
"iterator"
|
"iterator"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2020-09-28T05:57:25+00:00"
|
"time": "2021-12-02T12:48:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-invoker",
|
"name": "phpunit/php-invoker",
|
||||||
@ -2050,6 +2188,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"process"
|
"process"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/php-invoker/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2105,6 +2247,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"template"
|
"template"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2160,6 +2306,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"timer"
|
"timer"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2255,6 +2405,10 @@
|
|||||||
"testing",
|
"testing",
|
||||||
"xunit"
|
"xunit"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://phpunit.de/donate.html",
|
"url": "https://phpunit.de/donate.html",
|
||||||
@ -2311,6 +2465,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Library for parsing CLI options",
|
"description": "Library for parsing CLI options",
|
||||||
"homepage": "https://github.com/sebastianbergmann/cli-parser",
|
"homepage": "https://github.com/sebastianbergmann/cli-parser",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/cli-parser/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2363,6 +2521,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Collection of value objects that represent the PHP code units",
|
"description": "Collection of value objects that represent the PHP code units",
|
||||||
"homepage": "https://github.com/sebastianbergmann/code-unit",
|
"homepage": "https://github.com/sebastianbergmann/code-unit",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/code-unit/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2414,6 +2576,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Looks up which function or method a line of code belongs to",
|
"description": "Looks up which function or method a line of code belongs to",
|
||||||
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
|
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2484,6 +2650,10 @@
|
|||||||
"compare",
|
"compare",
|
||||||
"equality"
|
"equality"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/comparator/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2537,6 +2707,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Library for calculating the complexity of PHP code units",
|
"description": "Library for calculating the complexity of PHP code units",
|
||||||
"homepage": "https://github.com/sebastianbergmann/complexity",
|
"homepage": "https://github.com/sebastianbergmann/complexity",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/complexity/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2599,6 +2773,10 @@
|
|||||||
"unidiff",
|
"unidiff",
|
||||||
"unified diff"
|
"unified diff"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/diff/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2658,6 +2836,10 @@
|
|||||||
"environment",
|
"environment",
|
||||||
"hhvm"
|
"hhvm"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/environment/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2731,6 +2913,10 @@
|
|||||||
"export",
|
"export",
|
||||||
"exporter"
|
"exporter"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/exporter/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2791,6 +2977,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"global state"
|
"global state"
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/global-state/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2844,6 +3034,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Library for counting the lines of code in PHP source code",
|
"description": "Library for counting the lines of code in PHP source code",
|
||||||
"homepage": "https://github.com/sebastianbergmann/lines-of-code",
|
"homepage": "https://github.com/sebastianbergmann/lines-of-code",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2897,6 +3091,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
|
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
|
||||||
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -2948,6 +3146,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Allows reflection of object attributes, including inherited and non-public ones",
|
"description": "Allows reflection of object attributes, including inherited and non-public ones",
|
||||||
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
|
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/object-reflector/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -3007,6 +3209,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Provides functionality to recursively process PHP variables",
|
"description": "Provides functionality to recursively process PHP variables",
|
||||||
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -3058,6 +3264,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Provides a list of PHP built-in functions that operate on resources",
|
"description": "Provides a list of PHP built-in functions that operate on resources",
|
||||||
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
|
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/resource-operations/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -3110,6 +3320,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Collection of value objects that represent the types of the PHP type system",
|
"description": "Collection of value objects that represent the types of the PHP type system",
|
||||||
"homepage": "https://github.com/sebastianbergmann/type",
|
"homepage": "https://github.com/sebastianbergmann/type",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/type/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/type/tree/2.3.4"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -3159,6 +3373,10 @@
|
|||||||
],
|
],
|
||||||
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
||||||
"homepage": "https://github.com/sebastianbergmann/version",
|
"homepage": "https://github.com/sebastianbergmann/version",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/sebastianbergmann/version/issues",
|
||||||
|
"source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/sebastianbergmann",
|
"url": "https://github.com/sebastianbergmann",
|
||||||
@ -3205,6 +3423,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
|
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/theseer/tokenizer/issues",
|
||||||
|
"source": "https://github.com/theseer/tokenizer/tree/1.2.1"
|
||||||
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/theseer",
|
"url": "https://github.com/theseer",
|
||||||
@ -3283,5 +3505,5 @@
|
|||||||
"ext-mbstring": "*"
|
"ext-mbstring": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "1.1.0"
|
"plugin-api-version": "2.1.0"
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ use AtolOnline\Exceptions\InvalidEnumValueException;
|
|||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 26-28
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 26-28
|
||||||
*/
|
*/
|
||||||
class AgentInfo extends Entity
|
final class AgentInfo extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string|null Признак агента (1057)
|
* @var string|null Признак агента (1057)
|
||||||
@ -45,21 +45,21 @@ class AgentInfo extends Entity
|
|||||||
* Конструктор
|
* Конструктор
|
||||||
*
|
*
|
||||||
* @param string|null $type Признак агента (1057)
|
* @param string|null $type Признак агента (1057)
|
||||||
* @param PayingAgent|null $paying_agent Платёжный агент
|
* @param PayingAgent|null $pagent Платёжный агент
|
||||||
* @param ReceivePaymentsOperator|null $receive_payments_operator Оператор по приёму платежей
|
* @param ReceivePaymentsOperator|null $rp_operator Оператор по приёму платежей
|
||||||
* @param MoneyTransferOperator|null $money_transfer_operator Оператор перевода
|
* @param MoneyTransferOperator|null $mt_operator Оператор перевода
|
||||||
* @throws InvalidEnumValueException
|
* @throws InvalidEnumValueException
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
?string $type = null,
|
?string $type = null,
|
||||||
?PayingAgent $paying_agent = null,
|
?PayingAgent $pagent = null,
|
||||||
?ReceivePaymentsOperator $receive_payments_operator = null,
|
?ReceivePaymentsOperator $rp_operator = null,
|
||||||
?MoneyTransferOperator $money_transfer_operator = null,
|
?MoneyTransferOperator $mt_operator = null,
|
||||||
) {
|
) {
|
||||||
!is_null($type) && $this->setType($type);
|
!is_null($type) && $this->setType($type);
|
||||||
!is_null($paying_agent) && $this->setPayingAgent($paying_agent);
|
!is_null($pagent) && $this->setPayingAgent($pagent);
|
||||||
!is_null($receive_payments_operator) && $this->setReceivePaymentsOperator($receive_payments_operator);
|
!is_null($rp_operator) && $this->setReceivePaymentsOperator($rp_operator);
|
||||||
!is_null($money_transfer_operator) && $this->setMoneyTransferOperator($money_transfer_operator);
|
!is_null($mt_operator) && $this->setMoneyTransferOperator($mt_operator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,7 +79,7 @@ class AgentInfo extends Entity
|
|||||||
* @return AgentInfo
|
* @return AgentInfo
|
||||||
* @throws InvalidEnumValueException
|
* @throws InvalidEnumValueException
|
||||||
*/
|
*/
|
||||||
public function setType(?string $type): AgentInfo
|
public function setType(?string $type): self
|
||||||
{
|
{
|
||||||
AgentTypes::isValid($type) && $this->type = $type;
|
AgentTypes::isValid($type) && $this->type = $type;
|
||||||
return $this;
|
return $this;
|
||||||
@ -98,12 +98,12 @@ class AgentInfo extends Entity
|
|||||||
/**
|
/**
|
||||||
* Устанавливает платёжного агента
|
* Устанавливает платёжного агента
|
||||||
*
|
*
|
||||||
* @param PayingAgent|null $paying_agent
|
* @param PayingAgent|null $agent
|
||||||
* @return AgentInfo
|
* @return AgentInfo
|
||||||
*/
|
*/
|
||||||
public function setPayingAgent(?PayingAgent $paying_agent): AgentInfo
|
public function setPayingAgent(?PayingAgent $agent): self
|
||||||
{
|
{
|
||||||
$this->paying_agent = $paying_agent;
|
$this->paying_agent = $agent;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,12 +120,12 @@ class AgentInfo extends Entity
|
|||||||
/**
|
/**
|
||||||
* Устанавливает оператора по приёму платежей
|
* Устанавливает оператора по приёму платежей
|
||||||
*
|
*
|
||||||
* @param ReceivePaymentsOperator|null $receive_payments_operator
|
* @param ReceivePaymentsOperator|null $operator
|
||||||
* @return AgentInfo
|
* @return AgentInfo
|
||||||
*/
|
*/
|
||||||
public function setReceivePaymentsOperator(?ReceivePaymentsOperator $receive_payments_operator): AgentInfo
|
public function setReceivePaymentsOperator(?ReceivePaymentsOperator $operator): self
|
||||||
{
|
{
|
||||||
$this->receive_payments_operator = $receive_payments_operator;
|
$this->receive_payments_operator = $operator;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,12 +142,12 @@ class AgentInfo extends Entity
|
|||||||
/**
|
/**
|
||||||
* Устанавливает оператора перевода
|
* Устанавливает оператора перевода
|
||||||
*
|
*
|
||||||
* @param MoneyTransferOperator|null $money_transfer_operator
|
* @param MoneyTransferOperator|null $operator
|
||||||
* @return AgentInfo
|
* @return AgentInfo
|
||||||
*/
|
*/
|
||||||
public function setMoneyTransferOperator(?MoneyTransferOperator $money_transfer_operator): AgentInfo
|
public function setMoneyTransferOperator(?MoneyTransferOperator $operator): self
|
||||||
{
|
{
|
||||||
$this->money_transfer_operator = $money_transfer_operator;
|
$this->money_transfer_operator = $operator;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,54 +11,51 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\{
|
use AtolOnline\Constants\Constraints;
|
||||||
Constants\Constraints,
|
use AtolOnline\Exceptions\{
|
||||||
Exceptions\InvalidEmailException,
|
InvalidEmailException,
|
||||||
Exceptions\InvalidInnLengthException,
|
InvalidInnLengthException,
|
||||||
Exceptions\InvalidPhoneException,
|
InvalidPhoneException,
|
||||||
Exceptions\TooLongClientContactException,
|
TooLongClientNameException,
|
||||||
Exceptions\TooLongClientNameException,
|
TooLongEmailException
|
||||||
Exceptions\TooLongEmailException};
|
};
|
||||||
|
use AtolOnline\Traits\{
|
||||||
|
HasEmail,
|
||||||
|
HasInn
|
||||||
|
};
|
||||||
|
use JetBrains\PhpStorm\Pure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Класс, описывающий покупателя
|
* Класс, описывающий покупателя
|
||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 17
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 17
|
||||||
*/
|
*/
|
||||||
class Client extends Entity
|
final class Client extends Entity
|
||||||
{
|
{
|
||||||
|
use HasEmail, HasInn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Наименование (1227)
|
* @var string|null Наименование (1227)
|
||||||
*/
|
*/
|
||||||
protected ?string $name = null;
|
protected ?string $name = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null Email (1008)
|
|
||||||
*/
|
|
||||||
protected ?string $email = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Телефон (1008)
|
* @var string|null Телефон (1008)
|
||||||
*/
|
*/
|
||||||
protected ?string $phone = null;
|
protected ?string $phone = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null ИНН (1228)
|
|
||||||
*/
|
|
||||||
protected ?string $inn = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Конструктор объекта покупателя
|
* Конструктор объекта покупателя
|
||||||
*
|
*
|
||||||
* @param string|null $name Наименование (1227)
|
* @param string|null $name Наименование (1227)
|
||||||
* @param string|null $phone Email (1008)
|
|
||||||
* @param string|null $email Телефон (1008)
|
* @param string|null $email Телефон (1008)
|
||||||
|
* @param string|null $phone Email (1008)
|
||||||
* @param string|null $inn ИНН (1228)
|
* @param string|null $inn ИНН (1228)
|
||||||
* @throws TooLongClientNameException
|
|
||||||
* @throws TooLongClientContactException
|
|
||||||
* @throws TooLongEmailException
|
|
||||||
* @throws InvalidEmailException
|
* @throws InvalidEmailException
|
||||||
* @throws InvalidInnLengthException
|
* @throws InvalidInnLengthException
|
||||||
|
* @throws InvalidPhoneException
|
||||||
|
* @throws TooLongClientNameException
|
||||||
|
* @throws TooLongEmailException
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
?string $name = null,
|
?string $name = null,
|
||||||
@ -101,38 +98,6 @@ class Client extends Entity
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленный email
|
|
||||||
*
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public function getEmail(): ?string
|
|
||||||
{
|
|
||||||
return $this->email;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает email
|
|
||||||
*
|
|
||||||
* @param string|null $email
|
|
||||||
* @return $this
|
|
||||||
* @throws TooLongEmailException Слишком длинный email
|
|
||||||
* @throws InvalidEmailException Невалидный email
|
|
||||||
*/
|
|
||||||
public function setEmail(?string $email): self
|
|
||||||
{
|
|
||||||
if (is_string($email)) {
|
|
||||||
$email = preg_replace('/[\n\r\t]/', '', trim($email));
|
|
||||||
if (mb_strlen($email) > Constraints::MAX_LENGTH_EMAIL) {
|
|
||||||
throw new TooLongEmailException($email);
|
|
||||||
} elseif (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
|
|
||||||
throw new InvalidEmailException($email);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->email = empty($email) ? null : $email;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает установленный телефон
|
* Возвращает установленный телефон
|
||||||
*
|
*
|
||||||
@ -162,38 +127,10 @@ class Client extends Entity
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленный ИНН
|
|
||||||
*
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public function getInn(): ?string
|
|
||||||
{
|
|
||||||
return $this->inn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает ИНН
|
|
||||||
*
|
|
||||||
* @param string|null $inn
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidInnLengthException Некорректная длина ИНН
|
|
||||||
*/
|
|
||||||
public function setInn(?string $inn): self
|
|
||||||
{
|
|
||||||
if (is_string($inn)) {
|
|
||||||
$inn = preg_replace('/[^\d]/', '', trim($inn));
|
|
||||||
if (preg_match_all(Constraints::PATTERN_INN, $inn) === 0) {
|
|
||||||
throw new InvalidInnLengthException($inn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->inn = empty($inn) ? null : $inn;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
#[Pure]
|
||||||
public function jsonSerialize(): array
|
public function jsonSerialize(): array
|
||||||
{
|
{
|
||||||
$json = [];
|
$json = [];
|
||||||
|
@ -14,35 +14,33 @@ namespace AtolOnline\Entities;
|
|||||||
use AtolOnline\{
|
use AtolOnline\{
|
||||||
Constants\Constraints,
|
Constants\Constraints,
|
||||||
Enums\SnoTypes,
|
Enums\SnoTypes,
|
||||||
Exceptions\InvalidEmailException,
|
Traits\HasEmail,
|
||||||
Exceptions\InvalidEnumValueException,
|
Traits\HasInn
|
||||||
Exceptions\InvalidInnLengthException,
|
};
|
||||||
Exceptions\InvalidPaymentAddressException,
|
use AtolOnline\Exceptions\{
|
||||||
Exceptions\TooLongEmailException,
|
InvalidEmailException,
|
||||||
Exceptions\TooLongPaymentAddressException};
|
InvalidEnumValueException,
|
||||||
|
InvalidInnLengthException,
|
||||||
|
InvalidPaymentAddressException,
|
||||||
|
TooLongEmailException,
|
||||||
|
TooLongPaymentAddressException
|
||||||
|
};
|
||||||
|
use JetBrains\PhpStorm\ArrayShape;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Класс, описывающий сущность компании-продавца
|
* Класс, описывающий сущность компании-продавца
|
||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 17
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 17
|
||||||
*/
|
*/
|
||||||
class Company extends Entity
|
final class Company extends Entity
|
||||||
{
|
{
|
||||||
/**
|
use HasEmail, HasInn;
|
||||||
* @var string|null Почта (1117)
|
|
||||||
*/
|
|
||||||
protected ?string $email;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Система налогообложения продавца (1055)
|
* @var string|null Система налогообложения продавца (1055)
|
||||||
*/
|
*/
|
||||||
protected ?string $sno;
|
protected ?string $sno;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null ИНН (1018)
|
|
||||||
*/
|
|
||||||
protected ?string $inn;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Место расчётов (адрес интернет-магазина) (1187)
|
* @var string|null Место расчётов (адрес интернет-магазина) (1187)
|
||||||
*/
|
*/
|
||||||
@ -74,36 +72,6 @@ class Company extends Entity
|
|||||||
$this->setPaymentAddress($payment_address);
|
$this->setPaymentAddress($payment_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленный email
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getEmail(): string
|
|
||||||
{
|
|
||||||
return $this->email;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает email
|
|
||||||
*
|
|
||||||
* @param string $email
|
|
||||||
* @return $this
|
|
||||||
* @throws TooLongEmailException Слишком длинный email
|
|
||||||
* @throws InvalidEmailException Невалидный email
|
|
||||||
*/
|
|
||||||
public function setEmail(string $email): self
|
|
||||||
{
|
|
||||||
$email = preg_replace('/[\n\r\t]/', '', trim($email));
|
|
||||||
if (mb_strlen($email) > Constraints::MAX_LENGTH_EMAIL) {
|
|
||||||
throw new TooLongEmailException($email);
|
|
||||||
} elseif (empty($email) || filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
|
|
||||||
throw new InvalidEmailException($email);
|
|
||||||
}
|
|
||||||
$this->email = $email;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает установленный тип налогообложения
|
* Возвращает установленный тип налогообложения
|
||||||
*
|
*
|
||||||
@ -129,33 +97,6 @@ class Company extends Entity
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленный ИНН
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getInn(): string
|
|
||||||
{
|
|
||||||
return $this->inn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает ИНН
|
|
||||||
*
|
|
||||||
* @param string $inn
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidInnLengthException
|
|
||||||
*/
|
|
||||||
public function setInn(string $inn): self
|
|
||||||
{
|
|
||||||
$inn = preg_replace('/[^\d]/', '', trim($inn));
|
|
||||||
if (empty($inn) || preg_match_all(Constraints::PATTERN_INN, $inn) === 0) {
|
|
||||||
throw new InvalidInnLengthException($inn);
|
|
||||||
}
|
|
||||||
$this->inn = $inn;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает установленный адрес места расчётов
|
* Возвращает установленный адрес места расчётов
|
||||||
*
|
*
|
||||||
@ -193,6 +134,12 @@ class Company extends Entity
|
|||||||
* @throws InvalidInnLengthException
|
* @throws InvalidInnLengthException
|
||||||
* @throws InvalidPaymentAddressException
|
* @throws InvalidPaymentAddressException
|
||||||
*/
|
*/
|
||||||
|
#[ArrayShape([
|
||||||
|
'email' => "string",
|
||||||
|
'sno' => "string",
|
||||||
|
'inn' => "string",
|
||||||
|
'payment_address' => "string",
|
||||||
|
])]
|
||||||
public function jsonSerialize(): array
|
public function jsonSerialize(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@ -11,26 +11,28 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\{
|
use AtolOnline\Constants\Constraints;
|
||||||
Constants\Constraints,
|
use AtolOnline\Enums\{
|
||||||
Enums\PaymentMethods,
|
PaymentMethods,
|
||||||
Enums\PaymentObjects,
|
PaymentObjects,
|
||||||
Enums\VatTypes,
|
VatTypes
|
||||||
Exceptions\EmptyItemNameException,
|
};
|
||||||
Exceptions\InvalidDeclarationNumberException,
|
use AtolOnline\Exceptions\{
|
||||||
Exceptions\InvalidEnumValueException,
|
EmptyItemNameException,
|
||||||
Exceptions\InvalidOKSMCodeException,
|
InvalidDeclarationNumberException,
|
||||||
Exceptions\NegativeItemExciseException,
|
InvalidEnumValueException,
|
||||||
Exceptions\NegativeItemPriceException,
|
InvalidOKSMCodeException,
|
||||||
Exceptions\NegativeItemQuantityException,
|
NegativeItemExciseException,
|
||||||
Exceptions\TooHighItemQuantityException,
|
NegativeItemPriceException,
|
||||||
Exceptions\TooHighPriceException,
|
NegativeItemQuantityException,
|
||||||
Exceptions\TooHighSumException,
|
TooHighItemQuantityException,
|
||||||
Exceptions\TooLongItemCodeException,
|
TooHighPriceException,
|
||||||
Exceptions\TooLongItemNameException,
|
TooHighSumException,
|
||||||
Exceptions\TooLongMeasurementUnitException,
|
TooLongItemCodeException,
|
||||||
Exceptions\TooLongUserdataException,
|
TooLongItemNameException,
|
||||||
Exceptions\TooManyException
|
TooLongMeasurementUnitException,
|
||||||
|
TooLongUserdataException,
|
||||||
|
TooManyException
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,7 +40,7 @@ use AtolOnline\{
|
|||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 21-30
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 21-30
|
||||||
*/
|
*/
|
||||||
class Item extends Entity
|
final class Item extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string Наименование (1030)
|
* @var string Наименование (1030)
|
||||||
@ -153,7 +155,7 @@ class Item extends Entity
|
|||||||
*
|
*
|
||||||
* @param string $name Наименование
|
* @param string $name Наименование
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooLongItemNameException Слишком длинное имя/наименование
|
* @throws TooLongItemNameException
|
||||||
* @throws EmptyItemNameException
|
* @throws EmptyItemNameException
|
||||||
*/
|
*/
|
||||||
public function setName(string $name): self
|
public function setName(string $name): self
|
||||||
@ -186,6 +188,7 @@ class Item extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws NegativeItemPriceException
|
* @throws NegativeItemPriceException
|
||||||
* @throws TooHighPriceException
|
* @throws TooHighPriceException
|
||||||
|
* @throws TooHighSumException
|
||||||
*/
|
*/
|
||||||
public function setPrice(float $rubles): self
|
public function setPrice(float $rubles): self
|
||||||
{
|
{
|
||||||
@ -196,7 +199,7 @@ class Item extends Entity
|
|||||||
throw new NegativeItemPriceException($this->getName(), $rubles);
|
throw new NegativeItemPriceException($this->getName(), $rubles);
|
||||||
}
|
}
|
||||||
$this->price = $rubles;
|
$this->price = $rubles;
|
||||||
//$this->calcSum();
|
$this->getVat()?->setSum($this->getSum());
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +220,7 @@ class Item extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooHighItemQuantityException
|
* @throws TooHighItemQuantityException
|
||||||
* @throws NegativeItemQuantityException
|
* @throws NegativeItemQuantityException
|
||||||
|
* @throws TooHighSumException
|
||||||
*/
|
*/
|
||||||
public function setQuantity(float $quantity): self
|
public function setQuantity(float $quantity): self
|
||||||
{
|
{
|
||||||
@ -228,6 +232,7 @@ class Item extends Entity
|
|||||||
throw new NegativeItemQuantityException($this->getName(), $quantity);
|
throw new NegativeItemQuantityException($this->getName(), $quantity);
|
||||||
}
|
}
|
||||||
$this->quantity = $quantity;
|
$this->quantity = $quantity;
|
||||||
|
$this->getVat()?->setSum($this->getSum());
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,7 +462,7 @@ class Item extends Entity
|
|||||||
*
|
*
|
||||||
* @param string|null $user_data Дополнительный реквизит
|
* @param string|null $user_data Дополнительный реквизит
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooLongUserdataException Слишком длинный дополнительный реквизит
|
* @throws TooLongUserdataException
|
||||||
*/
|
*/
|
||||||
public function setUserData(?string $user_data): self
|
public function setUserData(?string $user_data): self
|
||||||
{
|
{
|
||||||
@ -485,13 +490,15 @@ class Item extends Entity
|
|||||||
* @param float|null $excise
|
* @param float|null $excise
|
||||||
* @return Item
|
* @return Item
|
||||||
* @throws NegativeItemExciseException
|
* @throws NegativeItemExciseException
|
||||||
|
* @throws TooHighSumException
|
||||||
*/
|
*/
|
||||||
public function setExcise(?float $excise): Item
|
public function setExcise(?float $excise): self
|
||||||
{
|
{
|
||||||
if ($excise < 0) {
|
if ($excise < 0) {
|
||||||
throw new NegativeItemExciseException($this->getName(), $excise);
|
throw new NegativeItemExciseException($this->getName(), $excise);
|
||||||
}
|
}
|
||||||
$this->excise = $excise;
|
$this->excise = $excise;
|
||||||
|
$this->getVat()?->setSum($this->getSum());
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,25 +565,6 @@ class Item extends Entity
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Расчитывает стоимость и размер НДС на неё
|
|
||||||
*
|
|
||||||
* @return float
|
|
||||||
* @throws TooHighPriceException Слишком большая сумма
|
|
||||||
*/
|
|
||||||
//public function calcSum(): float
|
|
||||||
//{
|
|
||||||
// $sum = $this->quantity * $this->price;
|
|
||||||
// if (rubles($sum) > 42949672.95) {
|
|
||||||
// throw new TooHighPriceException($sum, 42949672.95);
|
|
||||||
// }
|
|
||||||
// $this->sum = $sum;
|
|
||||||
// if ($this->vat) {
|
|
||||||
// $this->vat->setSum(rubles($sum));
|
|
||||||
// }
|
|
||||||
// return $this->getSum();
|
|
||||||
//}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @throws TooHighSumException
|
* @throws TooHighSumException
|
||||||
|
@ -11,14 +11,17 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\Exceptions\EmptyMonitorDataException;
|
use AtolOnline\Exceptions\{
|
||||||
use AtolOnline\Exceptions\NotEnoughMonitorDataException;
|
EmptyMonitorDataException,
|
||||||
|
NotEnoughMonitorDataException
|
||||||
|
};
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Класс сущности ККТ, получаемой от монитора
|
* Класс сущности ККТ, получаемой от монитора
|
||||||
*
|
*
|
||||||
|
* @see https://online.atol.ru/files/API_service_information.pdf Документация, стр 11
|
||||||
* @property string|null serialNumber Заводской номер ККТ
|
* @property string|null serialNumber Заводской номер ККТ
|
||||||
* @property string|null registrationNumber Регистрационный номер машины (РНМ)
|
* @property string|null registrationNumber Регистрационный номер машины (РНМ)
|
||||||
* @property string|null deviceNumber Номер автоматического устройства (внутренний идентификатор устройства)
|
* @property string|null deviceNumber Номер автоматического устройства (внутренний идентификатор устройства)
|
||||||
@ -38,14 +41,13 @@ use Exception;
|
|||||||
* @property DateTime|string|null firstUnsetDocTimestamp Дата первого неотправленного документа. Указывается, если
|
* @property DateTime|string|null firstUnsetDocTimestamp Дата первого неотправленного документа. Указывается, если
|
||||||
* есть неотправленные документы.
|
* есть неотправленные документы.
|
||||||
* @property int|null networkErrorCode Код ошибки сети
|
* @property int|null networkErrorCode Код ошибки сети
|
||||||
* @see https://online.atol.ru/files/API_service_information.pdf Документация, стр 11
|
|
||||||
*/
|
*/
|
||||||
final class Kkt extends Entity
|
final class Kkt extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Сопоставление кодов сетевых ошибок ККТ с их описаниями
|
* Сопоставление кодов сетевых ошибок ККТ с их описаниями
|
||||||
*/
|
*/
|
||||||
public const ERROR_CODES = [
|
public const ERROR_CODES = [
|
||||||
0 => 'Нет ошибок',
|
0 => 'Нет ошибок',
|
||||||
1 => 'Отсутствует физический канал связи',
|
1 => 'Отсутствует физический канал связи',
|
||||||
2 => 'Ошибка сетевых настроек или нет соединения с сервером ОФД',
|
2 => 'Ошибка сетевых настроек или нет соединения с сервером ОФД',
|
||||||
@ -97,7 +99,7 @@ final class Kkt extends Entity
|
|||||||
* @throws EmptyMonitorDataException
|
* @throws EmptyMonitorDataException
|
||||||
* @throws NotEnoughMonitorDataException
|
* @throws NotEnoughMonitorDataException
|
||||||
*/
|
*/
|
||||||
public function __construct(protected \stdClass $data)
|
public function __construct(protected object $data)
|
||||||
{
|
{
|
||||||
if (empty((array)$data)) {
|
if (empty((array)$data)) {
|
||||||
throw new EmptyMonitorDataException();
|
throw new EmptyMonitorDataException();
|
||||||
|
@ -11,9 +11,14 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\Constants\Constraints;
|
use AtolOnline\Exceptions\{
|
||||||
use AtolOnline\Exceptions\InvalidInnLengthException;
|
InvalidInnLengthException,
|
||||||
use AtolOnline\Exceptions\InvalidPhoneException;
|
InvalidPhoneException
|
||||||
|
};
|
||||||
|
use AtolOnline\Traits\{
|
||||||
|
HasInn,
|
||||||
|
HasPhones
|
||||||
|
};
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,8 +26,10 @@ use Illuminate\Support\Collection;
|
|||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 28
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 28
|
||||||
*/
|
*/
|
||||||
class MoneyTransferOperator extends Entity
|
final class MoneyTransferOperator extends Entity
|
||||||
{
|
{
|
||||||
|
use HasInn, HasPhones;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Наименование (1026)
|
* @var string|null Наименование (1026)
|
||||||
*/
|
*/
|
||||||
@ -111,69 +118,6 @@ class MoneyTransferOperator extends Entity
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленные номера телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @return Collection
|
|
||||||
*/
|
|
||||||
public function getPhones(): Collection
|
|
||||||
{
|
|
||||||
return $this->phones;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает массив номеров телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @param array|Collection|null $phones
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidPhoneException
|
|
||||||
*/
|
|
||||||
public function setPhones(array|Collection|null $phones): self
|
|
||||||
{
|
|
||||||
if (!is_null($phones)) {
|
|
||||||
$phones = is_array($phones) ? collect($phones) : $phones;
|
|
||||||
$phones->each(function ($phone) {
|
|
||||||
$phone = preg_replace('/[^\d]/', '', trim($phone));
|
|
||||||
if (preg_match(Constraints::PATTERN_PHONE, $phone) != 1) {
|
|
||||||
throw new InvalidPhoneException($phone);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$this->phones = $phones ?? collect();
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленный ИНН
|
|
||||||
*
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public function getInn(): ?string
|
|
||||||
{
|
|
||||||
return $this->inn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает ИНН
|
|
||||||
*
|
|
||||||
* @param string|null $inn
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidInnLengthException Некорректная длина ИНН
|
|
||||||
*/
|
|
||||||
public function setInn(?string $inn): self
|
|
||||||
{
|
|
||||||
if (is_string($inn)) {
|
|
||||||
$inn = preg_replace('/[^\d]/', '', trim($inn));
|
|
||||||
if (preg_match_all(Constraints::PATTERN_INN, $inn) === 0) {
|
|
||||||
throw new InvalidInnLengthException($inn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->inn = $inn ?: null;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
@ -12,8 +12,11 @@ declare(strict_types = 1);
|
|||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\Constants\Constraints;
|
use AtolOnline\Constants\Constraints;
|
||||||
use AtolOnline\Exceptions\InvalidPhoneException;
|
use AtolOnline\Exceptions\{
|
||||||
use AtolOnline\Exceptions\TooLongPayingAgentOperationException;
|
InvalidPhoneException,
|
||||||
|
TooLongPayingAgentOperationException
|
||||||
|
};
|
||||||
|
use AtolOnline\Traits\HasPhones;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,18 +24,15 @@ use Illuminate\Support\Collection;
|
|||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 19
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 19
|
||||||
*/
|
*/
|
||||||
class PayingAgent extends Entity
|
final class PayingAgent extends Entity
|
||||||
{
|
{
|
||||||
|
use HasPhones;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Наименование операции (1044)
|
* @var string|null Наименование операции (1044)
|
||||||
*/
|
*/
|
||||||
protected ?string $operation = null;
|
protected ?string $operation = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Collection Телефоны платёжного агента (1073)
|
|
||||||
*/
|
|
||||||
protected Collection $phones;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Конструктор
|
* Конструктор
|
||||||
*
|
*
|
||||||
@ -78,40 +78,6 @@ class PayingAgent extends Entity
|
|||||||
return $this->operation;
|
return $this->operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает массив номеров телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @param array|Collection|null $phones
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidPhoneException
|
|
||||||
*/
|
|
||||||
public function setPhones(array|Collection|null $phones): self
|
|
||||||
{
|
|
||||||
if (!is_null($phones)) {
|
|
||||||
$phones = is_array($phones) ? collect($phones) : $phones;
|
|
||||||
$phones->each(function ($phone) {
|
|
||||||
$phone = preg_replace('/[^\d]/', '', trim($phone));
|
|
||||||
if (preg_match(Constraints::PATTERN_PHONE, $phone) != 1) {
|
|
||||||
throw new InvalidPhoneException($phone);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$this->phones = empty($phones) ? collect() : $phones;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленные номера телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @return Collection
|
|
||||||
*/
|
|
||||||
public function getPhones(): Collection
|
|
||||||
{
|
|
||||||
return $this->phones;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
@ -11,8 +11,8 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\Constants\Constraints;
|
|
||||||
use AtolOnline\Exceptions\InvalidPhoneException;
|
use AtolOnline\Exceptions\InvalidPhoneException;
|
||||||
|
use AtolOnline\Traits\HasPhones;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,12 +20,9 @@ use Illuminate\Support\Collection;
|
|||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 19-20
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 19-20
|
||||||
*/
|
*/
|
||||||
class ReceivePaymentsOperator extends Entity
|
final class ReceivePaymentsOperator extends Entity
|
||||||
{
|
{
|
||||||
/**
|
use HasPhones;
|
||||||
* @var Collection Телефоны оператора по приёму платежей (1074)
|
|
||||||
*/
|
|
||||||
protected Collection $phones;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Конструктор
|
* Конструктор
|
||||||
@ -33,46 +30,11 @@ class ReceivePaymentsOperator extends Entity
|
|||||||
* @param array|Collection|null $phones Телефоны оператора по приёму платежей (1074)
|
* @param array|Collection|null $phones Телефоны оператора по приёму платежей (1074)
|
||||||
* @throws InvalidPhoneException
|
* @throws InvalidPhoneException
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(array|Collection|null $phones = null)
|
||||||
array|Collection|null $phones = null,
|
{
|
||||||
) {
|
|
||||||
$this->setPhones($phones);
|
$this->setPhones($phones);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленные номера телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @return Collection
|
|
||||||
*/
|
|
||||||
public function getPhones(): Collection
|
|
||||||
{
|
|
||||||
return $this->phones;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает массив номеров телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @param array|Collection|null $phones
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidPhoneException
|
|
||||||
*/
|
|
||||||
public function setPhones(array|Collection|null $phones): self
|
|
||||||
{
|
|
||||||
if (!is_null($phones)) {
|
|
||||||
$phones = is_array($phones) ? collect($phones) : $phones;
|
|
||||||
$phones->each(function ($phone) {
|
|
||||||
$phone = preg_replace('/[^\d]/', '', trim($phone));
|
|
||||||
if (preg_match(Constraints::PATTERN_PHONE, $phone) != 1) {
|
|
||||||
throw new InvalidPhoneException($phone);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$this->phones = empty($phones) ? collect() : $phones;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
@ -11,9 +11,14 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
use AtolOnline\Constants\Constraints;
|
use AtolOnline\Exceptions\{
|
||||||
use AtolOnline\Exceptions\InvalidInnLengthException;
|
InvalidInnLengthException,
|
||||||
use AtolOnline\Exceptions\InvalidPhoneException;
|
InvalidPhoneException
|
||||||
|
};
|
||||||
|
use AtolOnline\Traits\{
|
||||||
|
HasInn,
|
||||||
|
HasPhones
|
||||||
|
};
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,23 +26,15 @@ use Illuminate\Support\Collection;
|
|||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 29
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 29
|
||||||
*/
|
*/
|
||||||
class Supplier extends Entity
|
final class Supplier extends Entity
|
||||||
{
|
{
|
||||||
|
use HasPhones, HasInn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null Наименование (1225)
|
* @var string|null Наименование (1225)
|
||||||
*/
|
*/
|
||||||
protected ?string $name = null;
|
protected ?string $name = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null ИНН (1226)
|
|
||||||
*/
|
|
||||||
protected ?string $inn = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Collection Телефоны (1171)
|
|
||||||
*/
|
|
||||||
protected Collection $phones;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Конструктор
|
* Конструктор
|
||||||
*
|
*
|
||||||
@ -80,69 +77,6 @@ class Supplier extends Entity
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленные номера телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @return Collection
|
|
||||||
*/
|
|
||||||
public function getPhones(): Collection
|
|
||||||
{
|
|
||||||
return $this->phones;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает массив номеров телефонов
|
|
||||||
*
|
|
||||||
* @todo вытащить в трейт
|
|
||||||
* @param array|Collection|null $phones
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidPhoneException
|
|
||||||
*/
|
|
||||||
public function setPhones(array|Collection|null $phones): self
|
|
||||||
{
|
|
||||||
if (!is_null($phones)) {
|
|
||||||
$phones = is_array($phones) ? collect($phones) : $phones;
|
|
||||||
$phones->each(function ($phone) {
|
|
||||||
$phone = preg_replace('/[^\d]/', '', trim($phone));
|
|
||||||
if (preg_match(Constraints::PATTERN_PHONE, $phone) != 1) {
|
|
||||||
throw new InvalidPhoneException($phone);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$this->phones = empty($phones) ? collect() : $phones;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Возвращает установленный ИНН
|
|
||||||
*
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public function getInn(): ?string
|
|
||||||
{
|
|
||||||
return $this->inn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Устанавливает ИНН
|
|
||||||
*
|
|
||||||
* @param string|null $inn
|
|
||||||
* @return $this
|
|
||||||
* @throws InvalidInnLengthException Некорректная длина ИНН
|
|
||||||
*/
|
|
||||||
public function setInn(?string $inn): self
|
|
||||||
{
|
|
||||||
if (is_string($inn)) {
|
|
||||||
$inn = preg_replace('/[^\d]/', '', trim($inn));
|
|
||||||
if (preg_match_all(Constraints::PATTERN_INN, $inn) === 0) {
|
|
||||||
throw new InvalidInnLengthException($inn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->inn = empty($inn) ? null : $inn;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
@ -14,13 +14,17 @@ namespace AtolOnline\Entities;
|
|||||||
use AtolOnline\Enums\VatTypes;
|
use AtolOnline\Enums\VatTypes;
|
||||||
use AtolOnline\Exceptions\InvalidEnumValueException;
|
use AtolOnline\Exceptions\InvalidEnumValueException;
|
||||||
use AtolOnline\Helpers;
|
use AtolOnline\Helpers;
|
||||||
|
use JetBrains\PhpStorm\{
|
||||||
|
ArrayShape,
|
||||||
|
Pure
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Класс, описывающий ставку НДС
|
* Класс, описывающий ставку НДС
|
||||||
*
|
*
|
||||||
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 25, 31
|
* @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 25, 31
|
||||||
*/
|
*/
|
||||||
class Vat extends Entity
|
final class Vat extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string Тип ставки НДС (1199, 1105, 1104, 1103, 1102, 1107, 1106)
|
* @var string Тип ставки НДС (1199, 1105, 1104, 1103, 1102, 1107, 1106)
|
||||||
@ -37,6 +41,7 @@ class Vat extends Entity
|
|||||||
*
|
*
|
||||||
* @param string $type Тип ставки НДС (1199, 1105, 1104, 1103, 1102, 1107, 1106)
|
* @param string $type Тип ставки НДС (1199, 1105, 1104, 1103, 1102, 1107, 1106)
|
||||||
* @param float $rubles Исходная сумма в рублях, от которой нужно расчитать размер НДС
|
* @param float $rubles Исходная сумма в рублях, от которой нужно расчитать размер НДС
|
||||||
|
* @throws InvalidEnumValueException
|
||||||
*/
|
*/
|
||||||
public function __construct(string $type, float $rubles)
|
public function __construct(string $type, float $rubles)
|
||||||
{
|
{
|
||||||
@ -99,16 +104,16 @@ class Vat extends Entity
|
|||||||
* @see https://glavkniga.ru/situations/k500734
|
* @see https://glavkniga.ru/situations/k500734
|
||||||
* @see https://www.b-kontur.ru/nds-kalkuljator-online
|
* @see https://www.b-kontur.ru/nds-kalkuljator-online
|
||||||
*/
|
*/
|
||||||
|
#[Pure]
|
||||||
public function getCalculated(): float
|
public function getCalculated(): float
|
||||||
{
|
{
|
||||||
$kopeks = Helpers::toKop($this->sum);
|
|
||||||
return Helpers::toRub(match ($this->getType()) {
|
return Helpers::toRub(match ($this->getType()) {
|
||||||
VatTypes::VAT10 => $kopeks * 10 / 100,
|
VatTypes::VAT10 => Helpers::toKop($this->sum) * 10 / 100,
|
||||||
VatTypes::VAT18 => $kopeks * 18 / 100,
|
VatTypes::VAT18 => Helpers::toKop($this->sum) * 18 / 100,
|
||||||
VatTypes::VAT20 => $kopeks * 20 / 100,
|
VatTypes::VAT20 => Helpers::toKop($this->sum) * 20 / 100,
|
||||||
VatTypes::VAT110 => $kopeks * 10 / 110,
|
VatTypes::VAT110 => Helpers::toKop($this->sum) * 10 / 110,
|
||||||
VatTypes::VAT118 => $kopeks * 18 / 118,
|
VatTypes::VAT118 => Helpers::toKop($this->sum) * 18 / 118,
|
||||||
VatTypes::VAT120 => $kopeks * 20 / 120,
|
VatTypes::VAT120 => Helpers::toKop($this->sum) * 20 / 120,
|
||||||
default => 0,
|
default => 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -128,6 +133,8 @@ class Vat extends Entity
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
#[Pure]
|
||||||
|
#[ArrayShape(['type' => 'string', 'sum' => 'float'])]
|
||||||
public function jsonSerialize(): array
|
public function jsonSerialize(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@ -12,9 +12,9 @@ declare(strict_types = 1);
|
|||||||
namespace AtolOnline\Entities;
|
namespace AtolOnline\Entities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Класс CorrectionInfo, описывающий данные чек коррекции
|
* Класс todoCorrectionInfo, описывающий данные чек коррекции
|
||||||
*/
|
*/
|
||||||
class CorrectionInfo extends Entity
|
class todoCorrectionInfo extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string Тип коррекции. Тег ФФД - 1173.
|
* @var string Тип коррекции. Тег ФФД - 1173.
|
||||||
@ -32,7 +32,7 @@ class CorrectionInfo extends Entity
|
|||||||
protected string $base_number;
|
protected string $base_number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CorrectionInfo constructor.
|
* todoCorrectionInfo constructor.
|
||||||
*
|
*
|
||||||
* @param string|null $type Тип коррекции
|
* @param string|null $type Тип коррекции
|
||||||
* @param string|null $base_date Дата документа
|
* @param string|null $base_date Дата документа
|
||||||
@ -66,7 +66,7 @@ class CorrectionInfo extends Entity
|
|||||||
* @param string $number
|
* @param string $number
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setNumber(string $number): CorrectionInfo
|
public function setNumber(string $number): todoCorrectionInfo
|
||||||
{
|
{
|
||||||
$this->base_number = trim($number);
|
$this->base_number = trim($number);
|
||||||
return $this;
|
return $this;
|
||||||
@ -90,7 +90,7 @@ class CorrectionInfo extends Entity
|
|||||||
* @param string $date Строка в формате d.m.Y
|
* @param string $date Строка в формате d.m.Y
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setDate(string $date): CorrectionInfo
|
public function setDate(string $date): todoCorrectionInfo
|
||||||
{
|
{
|
||||||
$this->base_date = $date;
|
$this->base_date = $date;
|
||||||
return $this;
|
return $this;
|
||||||
@ -114,7 +114,7 @@ class CorrectionInfo extends Entity
|
|||||||
* @param string $type
|
* @param string $type
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setType(string $type): CorrectionInfo
|
public function setType(string $type): todoCorrectionInfo
|
||||||
{
|
{
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
return $this;
|
return $this;
|
@ -35,7 +35,7 @@ use Exception;
|
|||||||
*
|
*
|
||||||
* @package AtolOnline\Entities
|
* @package AtolOnline\Entities
|
||||||
*/
|
*/
|
||||||
class Document extends Entity
|
class todoDocument extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var ItemArray Массив предметов расчёта
|
* @var ItemArray Массив предметов расчёта
|
||||||
@ -73,12 +73,12 @@ class Document extends Entity
|
|||||||
protected string $cashier;
|
protected string $cashier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var CorrectionInfo Данные коррекции
|
* @var todoCorrectionInfo Данные коррекции
|
||||||
*/
|
*/
|
||||||
protected CorrectionInfo $correction_info;
|
protected todoCorrectionInfo $correction_info;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document constructor.
|
* todoDocument constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ class Document extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooManyVatsException Слишком много ставок НДС
|
* @throws TooManyVatsException Слишком много ставок НДС
|
||||||
*/
|
*/
|
||||||
public function clearVats(): Document
|
public function clearVats(): todoDocument
|
||||||
{
|
{
|
||||||
$this->setVats([]);
|
$this->setVats([]);
|
||||||
return $this;
|
return $this;
|
||||||
@ -106,7 +106,7 @@ class Document extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooManyVatsException Слишком много ставок НДС
|
* @throws TooManyVatsException Слишком много ставок НДС
|
||||||
*/
|
*/
|
||||||
public function addVat(Vat $vat): Document
|
public function addVat(Vat $vat): todoDocument
|
||||||
{
|
{
|
||||||
$this->vats->add($vat);
|
$this->vats->add($vat);
|
||||||
return $this;
|
return $this;
|
||||||
@ -130,7 +130,7 @@ class Document extends Entity
|
|||||||
* @throws TooManyVatsException Слишком много ставок НДС
|
* @throws TooManyVatsException Слишком много ставок НДС
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function setVats(array $vats): Document
|
public function setVats(array $vats): todoDocument
|
||||||
{
|
{
|
||||||
$this->vats->set($vats);
|
$this->vats->set($vats);
|
||||||
return $this;
|
return $this;
|
||||||
@ -139,12 +139,12 @@ class Document extends Entity
|
|||||||
/**
|
/**
|
||||||
* Добавляет новую оплату в массив оплат
|
* Добавляет новую оплату в массив оплат
|
||||||
*
|
*
|
||||||
* @param Payment $payment Объект оплаты
|
* @param todoPayment $payment Объект оплаты
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @throws TooManyPaymentsException Слишком много оплат
|
* @throws TooManyPaymentsException Слишком много оплат
|
||||||
*/
|
*/
|
||||||
public function addPayment(Payment $payment): Document
|
public function addPayment(todoPayment $payment): todoDocument
|
||||||
{
|
{
|
||||||
if (count($this->getPayments()) == 0 && !$payment->getSum()) {
|
if (count($this->getPayments()) == 0 && !$payment->getSum()) {
|
||||||
$payment->setSum($this->calcTotal());
|
$payment->setSum($this->calcTotal());
|
||||||
@ -156,7 +156,7 @@ class Document extends Entity
|
|||||||
/**
|
/**
|
||||||
* Возвращает массив оплат
|
* Возвращает массив оплат
|
||||||
*
|
*
|
||||||
* @return Payment[]
|
* @return todoPayment[]
|
||||||
*/
|
*/
|
||||||
public function getPayments(): array
|
public function getPayments(): array
|
||||||
{
|
{
|
||||||
@ -166,11 +166,11 @@ class Document extends Entity
|
|||||||
/**
|
/**
|
||||||
* Устанавливает массив оплат
|
* Устанавливает массив оплат
|
||||||
*
|
*
|
||||||
* @param Payment[] $payments Массив оплат
|
* @param todoPayment[] $payments Массив оплат
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooManyPaymentsException Слишком много оплат
|
* @throws TooManyPaymentsException Слишком много оплат
|
||||||
*/
|
*/
|
||||||
public function setPayments(array $payments): Document
|
public function setPayments(array $payments): todoDocument
|
||||||
{
|
{
|
||||||
$this->payments->set($payments);
|
$this->payments->set($payments);
|
||||||
return $this;
|
return $this;
|
||||||
@ -183,7 +183,7 @@ class Document extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooManyItemsException Слишком много предметов расчёта
|
* @throws TooManyItemsException Слишком много предметов расчёта
|
||||||
*/
|
*/
|
||||||
public function addItem(Item $item): Document
|
public function addItem(Item $item): todoDocument
|
||||||
{
|
{
|
||||||
$this->items->add($item);
|
$this->items->add($item);
|
||||||
return $this;
|
return $this;
|
||||||
@ -206,7 +206,7 @@ class Document extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooManyItemsException Слишком много предметов расчёта
|
* @throws TooManyItemsException Слишком много предметов расчёта
|
||||||
*/
|
*/
|
||||||
public function setItems(array $items): Document
|
public function setItems(array $items): todoDocument
|
||||||
{
|
{
|
||||||
$this->items->set($items);
|
$this->items->set($items);
|
||||||
return $this;
|
return $this;
|
||||||
@ -228,7 +228,7 @@ class Document extends Entity
|
|||||||
* @param Client|null $client
|
* @param Client|null $client
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setClient(?Client $client): Document
|
public function setClient(?Client $client): todoDocument
|
||||||
{
|
{
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
return $this;
|
return $this;
|
||||||
@ -250,7 +250,7 @@ class Document extends Entity
|
|||||||
* @param Company|null $company
|
* @param Company|null $company
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCompany(?Company $company): Document
|
public function setCompany(?Company $company): todoDocument
|
||||||
{
|
{
|
||||||
$this->company = $company;
|
$this->company = $company;
|
||||||
return $this;
|
return $this;
|
||||||
@ -273,7 +273,7 @@ class Document extends Entity
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws TooLongCashierException
|
* @throws TooLongCashierException
|
||||||
*/
|
*/
|
||||||
public function setCashier(?string $cashier): Document
|
public function setCashier(?string $cashier): todoDocument
|
||||||
{
|
{
|
||||||
if ($cashier !== null) {
|
if ($cashier !== null) {
|
||||||
$cashier = trim($cashier);
|
$cashier = trim($cashier);
|
||||||
@ -288,9 +288,9 @@ class Document extends Entity
|
|||||||
/**
|
/**
|
||||||
* Возвращает данные коррекции
|
* Возвращает данные коррекции
|
||||||
*
|
*
|
||||||
* @return CorrectionInfo|null
|
* @return todoCorrectionInfo|null
|
||||||
*/
|
*/
|
||||||
public function getCorrectionInfo(): ?CorrectionInfo
|
public function getCorrectionInfo(): ?todoCorrectionInfo
|
||||||
{
|
{
|
||||||
return $this->correction_info;
|
return $this->correction_info;
|
||||||
}
|
}
|
||||||
@ -298,10 +298,10 @@ class Document extends Entity
|
|||||||
/**
|
/**
|
||||||
* Устанавливает данные коррекции
|
* Устанавливает данные коррекции
|
||||||
*
|
*
|
||||||
* @param CorrectionInfo|null $correction_info
|
* @param todoCorrectionInfo|null $correction_info
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCorrectionInfo(?CorrectionInfo $correction_info): Document
|
public function setCorrectionInfo(?todoCorrectionInfo $correction_info): todoDocument
|
||||||
{
|
{
|
||||||
$this->correction_info = $correction_info;
|
$this->correction_info = $correction_info;
|
||||||
return $this;
|
return $this;
|
||||||
@ -338,7 +338,7 @@ class Document extends Entity
|
|||||||
* Собирает объект документа из сырой json-строки
|
* Собирает объект документа из сырой json-строки
|
||||||
*
|
*
|
||||||
* @param string $json
|
* @param string $json
|
||||||
* @return Document
|
* @return todoDocument
|
||||||
* @throws TooLongEmailException
|
* @throws TooLongEmailException
|
||||||
* @throws InvalidEmailException
|
* @throws InvalidEmailException
|
||||||
* @throws AtolException
|
* @throws AtolException
|
||||||
@ -355,7 +355,7 @@ class Document extends Entity
|
|||||||
* @throws TooLongUserdataException
|
* @throws TooLongUserdataException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function fromRaw(string $json): Document
|
public static function fromRaw(string $json): todoDocument
|
||||||
{
|
{
|
||||||
$array = json_decode($json, true);
|
$array = json_decode($json, true);
|
||||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||||
@ -379,7 +379,7 @@ class Document extends Entity
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
if (isset($array['correction_info'])) {
|
if (isset($array['correction_info'])) {
|
||||||
$doc->setCorrectionInfo(new CorrectionInfo(
|
$doc->setCorrectionInfo(new todoCorrectionInfo(
|
||||||
$array['correction_info']['type'] ?? null,
|
$array['correction_info']['type'] ?? null,
|
||||||
$array['correction_info']['base_date'] ?? null,
|
$array['correction_info']['base_date'] ?? null,
|
||||||
$array['correction_info']['base_number'] ?? null,
|
$array['correction_info']['base_number'] ?? null,
|
||||||
@ -405,7 +405,7 @@ class Document extends Entity
|
|||||||
}
|
}
|
||||||
if (isset($array['payments'])) {
|
if (isset($array['payments'])) {
|
||||||
foreach ($array['payments'] as $ar_payment) {
|
foreach ($array['payments'] as $ar_payment) {
|
||||||
$payment = new Payment();
|
$payment = new todoPayment();
|
||||||
if (isset($ar_payment['type'])) {
|
if (isset($ar_payment['type'])) {
|
||||||
$payment->setType($ar_payment['type']);
|
$payment->setType($ar_payment['type']);
|
||||||
}
|
}
|
@ -18,30 +18,30 @@ use AtolOnline\Enums\PaymentTypes;
|
|||||||
*
|
*
|
||||||
* @package AtolOnline\Entities
|
* @package AtolOnline\Entities
|
||||||
*/
|
*/
|
||||||
class Payment extends Entity
|
class todoPayment extends Entity
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var int Тип оплаты
|
* @var int Тип оплаты
|
||||||
*/
|
*/
|
||||||
protected int $type;
|
protected int $type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var float Сумма оплаты
|
* @var float Сумма оплаты
|
||||||
*/
|
*/
|
||||||
protected float $sum;
|
protected float $sum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment constructor.
|
* todoPayment constructor.
|
||||||
*
|
*
|
||||||
* @param int $payment_type Тип оплаты
|
* @param int $payment_type Тип оплаты
|
||||||
* @param float $sum Сумма оплаты
|
* @param float $sum Сумма оплаты
|
||||||
*/
|
*/
|
||||||
public function __construct(int $payment_type = PaymentTypes::ELECTRON, float $sum = 0.0)
|
public function __construct(int $payment_type = PaymentTypes::ELECTRON, float $sum = 0.0)
|
||||||
{
|
{
|
||||||
$this->setType($payment_type);
|
$this->setType($payment_type);
|
||||||
$this->setSum($sum);
|
$this->setSum($sum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает тип оплаты. Тег ФФД - 1031, 1081, 1215, 1216, 1217.
|
* Возвращает тип оплаты. Тег ФФД - 1031, 1081, 1215, 1216, 1217.
|
||||||
*
|
*
|
||||||
@ -51,19 +51,19 @@ class Payment extends Entity
|
|||||||
{
|
{
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Устанавливает тип оплаты. Тег ФФД - 1031, 1081, 1215, 1216, 1217.
|
* Устанавливает тип оплаты. Тег ФФД - 1031, 1081, 1215, 1216, 1217.
|
||||||
*
|
*
|
||||||
* @param int $type
|
* @param int $type
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setType(int $type): Payment
|
public function setType(int $type): todoPayment
|
||||||
{
|
{
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает сумму оплаты
|
* Возвращает сумму оплаты
|
||||||
*
|
*
|
||||||
@ -73,19 +73,19 @@ class Payment extends Entity
|
|||||||
{
|
{
|
||||||
return $this->sum;
|
return $this->sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Устанавливает сумму оплаты
|
* Устанавливает сумму оплаты
|
||||||
*
|
*
|
||||||
* @param float $sum
|
* @param float $sum
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setSum(float $sum): Payment
|
public function setSum(float $sum): todoPayment
|
||||||
{
|
{
|
||||||
$this->sum = $sum;
|
$this->sum = $sum;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
57
src/Traits/HasEmail.php
Normal file
57
src/Traits/HasEmail.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
|
||||||
|
*
|
||||||
|
* This code is licensed under MIT.
|
||||||
|
* Этот код распространяется по лицензии MIT.
|
||||||
|
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace AtolOnline\Traits;
|
||||||
|
|
||||||
|
use AtolOnline\Constants\Constraints;
|
||||||
|
use AtolOnline\Exceptions\InvalidEmailException;
|
||||||
|
use AtolOnline\Exceptions\TooLongEmailException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Трейт для сущностей, которые могут иметь email
|
||||||
|
*/
|
||||||
|
trait HasEmail
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string|null Email (1008, 1117)
|
||||||
|
*/
|
||||||
|
protected ?string $email = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Устанавливает email
|
||||||
|
*
|
||||||
|
* @param string|null $email
|
||||||
|
* @return $this
|
||||||
|
* @throws TooLongEmailException
|
||||||
|
* @throws InvalidEmailException
|
||||||
|
*/
|
||||||
|
public function setEmail(?string $email): static
|
||||||
|
{
|
||||||
|
if (is_string($email)) {
|
||||||
|
$email = preg_replace('/[\n\r\t]/', '', trim($email));
|
||||||
|
if (mb_strlen($email) > Constraints::MAX_LENGTH_EMAIL) {
|
||||||
|
throw new TooLongEmailException($email);
|
||||||
|
} elseif (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
|
||||||
|
throw new InvalidEmailException($email);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->email = empty($email) ? null : $email;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Возвращает установленный email
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getEmail(): ?string
|
||||||
|
{
|
||||||
|
return $this->email;
|
||||||
|
}
|
||||||
|
}
|
53
src/Traits/HasInn.php
Normal file
53
src/Traits/HasInn.php
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
|
||||||
|
*
|
||||||
|
* This code is licensed under MIT.
|
||||||
|
* Этот код распространяется по лицензии MIT.
|
||||||
|
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace AtolOnline\Traits;
|
||||||
|
|
||||||
|
use AtolOnline\Constants\Constraints;
|
||||||
|
use AtolOnline\Exceptions\InvalidInnLengthException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Трейт для сущностей, которые могут иметь ИНН
|
||||||
|
*/
|
||||||
|
trait HasInn
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string|null ИНН (1226, 1228, 1018)
|
||||||
|
*/
|
||||||
|
protected ?string $inn = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Устанавливает ИНН
|
||||||
|
*
|
||||||
|
* @param string|null $inn
|
||||||
|
* @return $this
|
||||||
|
* @throws InvalidInnLengthException
|
||||||
|
*/
|
||||||
|
public function setInn(?string $inn): static
|
||||||
|
{
|
||||||
|
if (is_string($inn)) {
|
||||||
|
$inn = preg_replace('/[^\d]/', '', trim($inn));
|
||||||
|
if (preg_match_all(Constraints::PATTERN_INN, $inn) === 0) {
|
||||||
|
throw new InvalidInnLengthException($inn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->inn = empty($inn) ? null : $inn;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Возвращает установленный ИНН
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getInn(): ?string
|
||||||
|
{
|
||||||
|
return $this->inn;
|
||||||
|
}
|
||||||
|
}
|
57
src/Traits/HasPhones.php
Normal file
57
src/Traits/HasPhones.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
|
||||||
|
*
|
||||||
|
* This code is licensed under MIT.
|
||||||
|
* Этот код распространяется по лицензии MIT.
|
||||||
|
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace AtolOnline\Traits;
|
||||||
|
|
||||||
|
use AtolOnline\Constants\Constraints;
|
||||||
|
use AtolOnline\Exceptions\InvalidPhoneException;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Трейт для сущностей, которые могут иметь массив номеров телефонов
|
||||||
|
*/
|
||||||
|
trait HasPhones
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Collection Телефоны платёжного агента (1073), поставщика (1171), оператора по приёму платежей (1074)
|
||||||
|
*/
|
||||||
|
protected Collection $phones;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Устанавливает массив номеров телефонов
|
||||||
|
*
|
||||||
|
* @param array|Collection|null $phones
|
||||||
|
* @return $this
|
||||||
|
* @throws InvalidPhoneException
|
||||||
|
*/
|
||||||
|
public function setPhones(array|Collection|null $phones): static
|
||||||
|
{
|
||||||
|
if (!is_null($phones)) {
|
||||||
|
$phones = is_array($phones) ? collect($phones) : $phones;
|
||||||
|
$phones->each(function ($phone) {
|
||||||
|
$phone = preg_replace('/[^\d]/', '', trim($phone));
|
||||||
|
if (preg_match(Constraints::PATTERN_PHONE, $phone) != 1) {
|
||||||
|
throw new InvalidPhoneException($phone);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$this->phones = empty($phones) ? collect() : $phones;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Возвращает установленные номера телефонов
|
||||||
|
*
|
||||||
|
* @return Collection
|
||||||
|
*/
|
||||||
|
public function getPhones(): Collection
|
||||||
|
{
|
||||||
|
return $this->phones;
|
||||||
|
}
|
||||||
|
}
|
@ -63,9 +63,9 @@ class AgentInfoTest extends BasicTestCase
|
|||||||
{
|
{
|
||||||
$this->assertAtolable(new AgentInfo(null), []);
|
$this->assertAtolable(new AgentInfo(null), []);
|
||||||
$this->assertAtolable(new AgentInfo(AgentTypes::ANOTHER), ['type' => AgentTypes::ANOTHER]);
|
$this->assertAtolable(new AgentInfo(AgentTypes::ANOTHER), ['type' => AgentTypes::ANOTHER]);
|
||||||
$this->assertAtolable(new AgentInfo(paying_agent: new PayingAgent()), []);
|
$this->assertAtolable(new AgentInfo(pagent: new PayingAgent()), []);
|
||||||
$this->assertAtolable(new AgentInfo(money_transfer_operator: new MoneyTransferOperator()), []);
|
$this->assertAtolable(new AgentInfo(mt_operator: new MoneyTransferOperator()), []);
|
||||||
$this->assertAtolable(new AgentInfo(receive_payments_operator: new ReceivePaymentsOperator()), []);
|
$this->assertAtolable(new AgentInfo(rp_operator: new ReceivePaymentsOperator()), []);
|
||||||
|
|
||||||
$this->assertAtolable(new AgentInfo(
|
$this->assertAtolable(new AgentInfo(
|
||||||
AgentTypes::ANOTHER,
|
AgentTypes::ANOTHER,
|
||||||
|
Loading…
Reference in New Issue
Block a user