diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 8a69ddc..24fef4f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ -#github: anthonyaxenov -patreon: anthonyaxenov -liberapay: anthonyaxenov -custom: [ 'https://yoomoney.ru/to/41001685237530' ] +custom: [ + 'https://www.buymeacoffee.com/axenov', + 'https://yoomoney.ru/to/41001685237530' +] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04162f3..e82d29a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,6 @@ jobs: strategy: matrix: php-version: - - 8.0 - 8.1 steps: diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..3e59b32 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,25 @@ +in(__DIR__) + ->exclude('docs') + ->notPath('test.php'); + +return (new PhpCsFixer\Config()) + ->setFinder($finder) + ->setIndent(' ') + ->setRules([ + '@PSR12' => true, + 'array_syntax' => ['syntax' => 'short'], + 'group_to_single_imports' => false, + ]); diff --git a/README.md b/README.md index 64baa5b..cf404a0 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,19 @@ [![codecov](https://codecov.io/gh/anthonyaxenov/atol-online/branch/master/graph/badge.svg?token=WR2IV7FTF0)](https://codecov.io/gh/anthonyaxenov/atol-online) [![Stable Version](https://img.shields.io/packagist/v/axenov/atol-online?label=stable)](https://packagist.org/packages/axenov/atol-online) [![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/axenov/atol-online?color=%23787cb4)](https://packagist.org/packages/axenov/atol-online) -[![Liberapay](https://img.shields.io/liberapay/patrons/AnthonyAxenov.svg?logo=liberapay)](https://liberapay.com/AnthonyAxenov/donate) [![License](https://img.shields.io/packagist/l/axenov/atol-online?color=%23369883)](LICENSE) +[![buymeacoffee](https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/axenov) **[Документация](/docs/readme.md)** Текущие поддерживаемые версии АТОЛ Онлайн: -| Протокол | API | ФФД | Статус | -|----------|-----|------|----------------| -| v4 | 5.8 | 1.05 | Поддерживается | -| v5 | 2.0 | 1.2 | В планах | +| Протокол | API | ФФД | Статус | +|----------|------|------|----------------| +| v4 | 5.10 | 1.05 | Поддерживается | +| v5 | 3.0 | 1.2 | В планах | -## Плюшечки +Поддерживаемые возможности: * Мониторинг ККТ и ФН * Фискализация документов на облачной ККТ @@ -28,13 +28,13 @@ ## Системные требования -* `php v8.0` и выше +* `php v8.1` и выше * `php-json` -* `php-curl` * `php-mbstring` -* `php-tokenizer` * [composer](https://getcomposer.org/) +> Для использования на php8.0 используйте версии библиотеки до 1.0.2 включительно. + ## Начало работы ### Подключение библиотеки @@ -50,6 +50,17 @@ где `$project_root` — абсолютный путь к корневой директории вашего проекта. > При использовании фреймворков это обычно не требуется. +### Использование библиотеки + +Вы имеете право использовать и распространять код на условиях **[лицензии MIT](LICENSE)**. + +Дополнительная информация может быть найдена здесь: + +1. [Документации к библиотеке](/docs) +2. [Документация АТОЛ Онлайн](https://online.atol.ru/lib/) +3. [Исходный код](/src), докблоки +4. [Тесты](/tests/AtolOnline/Tests) + ### Тестирование кода библиотеки Файлы тестов находятся в директории `/tests` корня репозитория. @@ -57,24 +68,11 @@ Для запуска тестов необходимо перейти в корень репозитория и выполнить одну из команд: ```bash -composer test # обычное тестирование -composer coverage # тестирование с покрытием +composer psalm # статический анализ +composer phpcs # синтаксический анализ +composer test # полное тестирование без покрытия +composer coverage # полное тестирование с покрытием ``` -После тестирования с покрытием создаётся отчёт в директории `.coverage` в корне репозитория. - -### Использование библиотеки - -Весь исходный код находится в директории [`/src`](/src). -Вы имеете право использовать и распространять его на условиях **[лицензии MIT](LICENSE)**. - -1. Обращайтесь к [документации библиотеки](/docs) -2. Обращайтесь к [исходному коду](/src) и описанным докблокам -3. Обращайтесь к [тестам](/tests/AtolOnline/Tests) -4. Используйте нормальную IDE - -## Дополнительные ресурсы - -* [Документация АТОЛ Онлайн](https://online.atol.ru/lib/) - -[![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/AnthonyAxenov/donate) +После тестирования с покрытием в корне репозитория создаётся отчёт, который сохраняется в директории `.coverage`. +Для тестирования с покрытием необходим `php-xdebug` с параметром `xdebug.mode = coverage,...`. diff --git a/composer.json b/composer.json index dc34250..8eb6e45 100644 --- a/composer.json +++ b/composer.json @@ -5,22 +5,18 @@ "type": "library", "keywords": [ "api", - "e-commerce", - "54-fz", - "54-фз", - "kkt", - "ккт", - "cash", - "cash register", - "payment", - "payment system", + "чек", "atol", "атол", + "payment", + "e-commerce", "atol online", "атол онлайн", - "fiscalization", + "atol-online", + "атол-онлайн", "фискализация", - "чек" + "fiscalization", + "payment system" ], "homepage": "https://github.com/anthonyaxenov/atol-online", "readme": "https://github.com/anthonyaxenov/atol-online/blob/master/README.md", @@ -39,28 +35,31 @@ "docs": "https://github.com/anthonyaxenov/atol-online/blob/master/docs/readme.md" }, "funding": [ - { - "type": "Patreon", - "url": "https://www.patreon.com/anthonyaxenov" - }, { "type": "Yoomoney", "url": "https://yoomoney.ru/to/41001685237530" + }, + { + "type": "Buy Me a Coffee", + "url": "https://www.buymeacoffee.com/axenov" } ], "require": { - "php": ">=8.0", + "php": ">=8.1", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/guzzle": "^7.5", "psr/log": "^3", - "ramsey/uuid": "^4.2", - "myclabs/php-enum": "^1.8", - "illuminate/collections": "^8.70", + "ramsey/uuid": "^4.6", + "illuminate/collections": "^v9.43", "jetbrains/phpstorm-attributes": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "friendsofphp/php-cs-fixer": "^3.13", + "phpunit/phpunit": "^9.5", + "psalm/plugin-phpunit": "^0.18", + "squizlabs/php_codesniffer": "^3.7", + "vimeo/psalm": "^4.30" }, "autoload": { "psr-4": { @@ -73,6 +72,8 @@ ] }, "scripts": { + "phpcs": "vendor/bin/phpcs", + "psalm": "vendor/bin/psalm", "test": "vendor/bin/phpunit --colors=always", "coverage": "php -dxdebug.mode=coverage vendor/bin/phpunit --coverage-html .coverage" }, diff --git a/composer.lock b/composer.lock index f6da316..771cf47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4877f27cd59b6558eea01644e2d520ef", + "content-hash": "12536d59b784fed8182176d26f24985e", "packages": [ { "name": "brick/math", @@ -64,16 +64,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.5", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", "shasum": "" }, "require": { @@ -88,10 +88,10 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -101,8 +101,12 @@ }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -168,7 +172,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.5" + "source": "https://github.com/guzzle/guzzle/tree/7.5.0" }, "funding": [ { @@ -184,20 +188,20 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:13+00:00" + "time": "2022-08-28T15:39:27+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "b94b2807d85443f9719887892882d0329d1e2598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", "shasum": "" }, "require": { @@ -252,7 +256,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/1.5.2" }, "funding": [ { @@ -268,20 +272,20 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2022-08-28T14:55:35+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.4.0", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "13388f00956b1503577598873fffb5ae994b5737" + "reference": "67c26b443f348a51926030c83481b85718457d3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", - "reference": "13388f00956b1503577598873fffb5ae994b5737", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", + "reference": "67c26b443f348a51926030c83481b85718457d3d", "shasum": "" }, "require": { @@ -295,15 +299,19 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { "dev-master": "2.4-dev" } @@ -367,7 +375,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.0" + "source": "https://github.com/guzzle/psr7/tree/2.4.3" }, "funding": [ { @@ -383,34 +391,35 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:11+00:00" + "time": "2022-10-26T14:07:24+00:00" }, { "name": "illuminate/collections", - "version": "v8.83.23", + "version": "v9.43.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4" + "reference": "7a8afa0875d7de162f30865d9fae33c8fb235fa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/705a4e1ef93cd492c45b9b3e7911cccc990a07f4", - "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4", + "url": "https://api.github.com/repos/illuminate/collections/zipball/7a8afa0875d7de162f30865d9fae33c8fb235fa2", + "reference": "7a8afa0875d7de162f30865d9fae33c8fb235fa2", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "php": "^8.0.2" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -437,31 +446,77 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-06-23T15:29:49+00:00" + "time": "2022-12-02T18:48:05+00:00" }, { - "name": "illuminate/contracts", - "version": "v8.83.23", + "name": "illuminate/conditionable", + "version": "v9.43.0", "source": { "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" + "url": "https://github.com/illuminate/conditionable.git", + "reference": "5b40f51ccb07e0e7b1ec5559d8db9e0e2dc51883" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", - "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/5b40f51ccb07e0e7b1ec5559d8db9e0e2dc51883", + "reference": "5b40f51ccb07e0e7b1ec5559d8db9e0e2dc51883", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Conditionable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-07-29T19:44:19+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v9.43.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "c7cc6e6198cac6dfdead111f9758de25413188b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/c7cc6e6198cac6dfdead111f9758de25413188b7", + "reference": "c7cc6e6198cac6dfdead111f9758de25413188b7", + "shasum": "" + }, + "require": { + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" } }, "autoload": { @@ -485,29 +540,29 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-13T14:47:47+00:00" + "time": "2022-10-31T22:25:40+00:00" }, { "name": "illuminate/macroable", - "version": "v8.83.23", + "version": "v9.43.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "aed81891a6e046fdee72edd497f822190f61c162" + "reference": "e3bfaf6401742a9c6abca61b9b10e998e5b6449a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", - "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/e3bfaf6401742a9c6abca61b9b10e998e5b6449a", + "reference": "e3bfaf6401742a9c6abca61b9b10e998e5b6449a", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -531,7 +586,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-11-16T13:57:03+00:00" + "time": "2022-08-09T13:29:29+00:00" }, { "name": "jetbrains/phpstorm-attributes", @@ -575,87 +630,29 @@ }, "time": "2020-11-17T11:09:47+00:00" }, - { - "name": "myclabs/php-enum", - "version": "1.8.4", - "source": { - "type": "git", - "url": "https://github.com/myclabs/php-enum.git", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.6.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "MyCLabs\\Enum\\": "src/" - }, - "classmap": [ - "stubs/Stringable.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP Enum contributors", - "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" - } - ], - "description": "PHP Enum implementation", - "homepage": "http://github.com/myclabs/php-enum", - "keywords": [ - "enum" - ], - "support": { - "issues": "https://github.com/myclabs/php-enum/issues", - "source": "https://github.com/myclabs/php-enum/tree/1.8.4" - }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", - "type": "tidelift" - } - ], - "time": "2022-08-04T09:53:51+00:00" - }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -682,9 +679,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/http-client", @@ -898,25 +895,25 @@ }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -931,7 +928,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -943,9 +940,9 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2021-10-29T13:26:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -1072,21 +1069,20 @@ }, { "name": "ramsey/uuid", - "version": "4.4.0", + "version": "4.6.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a" + "reference": "ad63bc700e7d021039e30ce464eba384c4a1d40f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/373f7bacfcf3de038778ff27dcce5672ddbf4c8a", - "reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/ad63bc700e7d021039e30ce464eba384c4a1d40f", + "reference": "ad63bc700e7d021039e30ce464eba384c4a1d40f", "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9 || ^0.10", - "ext-ctype": "*", + "brick/math": "^0.8.8 || ^0.9 || ^0.10", "ext-json": "*", "php": "^8.0", "ramsey/collection": "^1.0" @@ -1106,18 +1102,18 @@ "php-mock/php-mock-mockery": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.1", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.9" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -1149,7 +1145,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.4.0" + "source": "https://github.com/ramsey/uuid/tree/4.6.0" }, "funding": [ { @@ -1161,20 +1157,20 @@ "type": "tidelift" } ], - "time": "2022-08-05T17:58:37+00:00" + "time": "2022-11-05T23:03:38+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -1183,7 +1179,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -1212,7 +1208,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -1228,20 +1224,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", "shasum": "" }, "require": { @@ -1250,7 +1246,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1291,7 +1287,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" }, "funding": [ { @@ -1307,10 +1303,623 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.6.2", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^7 | ^8 | ^9", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ], + "psr-4": { + "Amp\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "https://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/v2.6.2" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2022-02-20T17:52:18+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Amp\\ByteStream\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T17:13:30+00:00" + }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.5", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-17T14:14:24+00:00" + }, + { + "name": "composer/pcre", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-11-17T09:50:14+00:00" + }, + { + "name": "composer/semver", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-04-01T19:23:25+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.14.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51", + "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1 || ^2", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.14.1" + }, + "time": "2022-12-12T12:46:12+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -1381,6 +1990,274 @@ ], "time": "2022-03-03T08:28:38+00:00" }, + { + "name": "doctrine/lexer", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "3cf140b81e55d5d640f73367d829db7e3023ef69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/3cf140b81e55d5d640f73367d829db7e3023ef69", + "reference": "3cf140b81e55d5d640f73367d829db7e3023ef69", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-12-11T10:51:23+00:00" + }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.5.2", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" + }, + "time": "2022-03-02T22:36:06+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.13.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a6232229a8309e8811dc751c28b91cb34b2943e1", + "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1", + "shasum": "" + }, + "require": { + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.0", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2022-10-31T19:28:50+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.11.0", @@ -1441,17 +2318,68 @@ "time": "2022-03-03T13:19:32+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.14.0", + "name": "netresearch/jsonmapper", + "version": "v4.1.0", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" + }, + "time": "2022-12-08T20:46:14+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -1492,9 +2420,62 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-11-12T15:38:23+00:00" + }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, + "time": "2019-03-29T20:06:56+00:00" }, { "name": "phar-io/manifest", @@ -1719,25 +2700,30 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -1763,96 +2749,29 @@ "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.6.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-10-14T12:47:21+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1901,7 +2820,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" }, "funding": [ { @@ -1909,7 +2828,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-12-14T13:26:54+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2154,16 +3073,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", "shasum": "" }, "require": { @@ -2178,7 +3097,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -2186,19 +3104,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -2240,7 +3155,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" }, "funding": [ { @@ -2250,9 +3165,172 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2022-12-09T07:31:23+00:00" + }, + { + "name": "psalm/plugin-phpunit", + "version": "0.18.4", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-phpunit.git", + "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", + "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.10", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "ext-simplexml": "*", + "php": "^7.1 || ^8.0", + "vimeo/psalm": "dev-master || dev-4.x || ^4.7.1 || ^5@beta || ^5.0" + }, + "conflict": { + "phpunit/phpunit": "<7.5" + }, + "require-dev": { + "codeception/codeception": "^4.0.3", + "php": "^7.3 || ^8.0", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.3.1", + "weirdan/codeception-psalm-module": "^0.11.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\PhpUnitPlugin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "Psalm plugin for PHPUnit", + "support": { + "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.18.4" + }, + "time": "2022-12-03T07:47:07+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" }, { "name": "sebastian/cli-parser", @@ -2423,16 +3501,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -2485,7 +3563,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -2493,7 +3571,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -2683,16 +3761,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -2748,7 +3826,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -2756,7 +3834,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -3111,16 +4189,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -3132,7 +4210,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -3155,7 +4233,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -3163,7 +4241,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -3218,6 +4296,1221 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2022-06-18T07:21:10+00:00" + }, + { + "name": "symfony/console", + "version": "v6.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f", + "reference": "58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-12-01T13:44:20+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "9efb1618fabee89515fe031314e8ed5625f85a53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9efb1618fabee89515fe031314e8ed5625f85a53", + "reference": "9efb1618fabee89515fe031314e8ed5625f85a53", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^5.4|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-02T09:08:04+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.3-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-25T10:21:52+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/50b2523c874605cf3d4acf7a9e2b30b6a440a016", + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-20T13:01:27+00:00" + }, + { + "name": "symfony/finder", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/eb2355f69519e4ef33f1835bca4c935f5d42e570", + "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-10-09T08:55:40+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "d28f02acde71ff75e957082cd36e973df395f626" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d28f02acde71ff75e957082cd36e973df395f626", + "reference": "d28f02acde71ff75e957082cd36e973df395f626", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-02T09:08:04+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/process", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/ba6e55359f8f755fe996c58a81e00eaa67a35877", + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-02T09:08:04+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/925e713fe8fcacf6bc05e936edd8dd5441a21239", + "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.1.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-30T19:18:58+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/266636bb8f3fbdccc302491df7b3a1b9a8c238a7", + "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-09-28T16:00:52+00:00" + }, + { + "name": "symfony/string", + "version": "v6.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "145702685e0d12f81d755c71127bfff7582fdd36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/145702685e0d12f81d755c71127bfff7582fdd36", + "reference": "145702685e0d12f81d755c71127bfff7582fdd36", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-30T17:13:47+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -3268,6 +5561,114 @@ ], "time": "2021-07-28T10:34:58+00:00" }, + { + "name": "vimeo/psalm", + "version": "4.30.0", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.4.2", + "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.8.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.13", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.25", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0||^6.0", + "ext-curl": "*", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", + "phpspec/prophecy": ">=1.9.0", + "phpstan/phpdoc-parser": "1.2.* || 1.6.4", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3 || ^5.0 || ^6.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "suggest": { + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ], + "psr-4": { + "Psalm\\": "src/Psalm/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/4.30.0" + }, + "time": "2022-11-06T20:37:08+00:00" + }, { "name": "webmozart/assert", "version": "1.11.0", @@ -3325,6 +5726,57 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/2.3.0" + }, + "abandoned": "symfony/filesystem", + "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], @@ -3333,7 +5785,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0", + "php": ">=8.1", "ext-json": "*", "ext-mbstring": "*" }, diff --git a/docs/collection.md b/docs/collection.md index 1c0a8b6..a229135 100644 --- a/docs/collection.md +++ b/docs/collection.md @@ -4,11 +4,11 @@ --- -Коллекциями являются объекты, способные хранить в себе [сущности](entity.md). Они унаследованы -от `Illuminate/Support/Collection` и полностью поддерживают все -[стандартные методы коллекций Laravel](https://laravel.com/docs/master/collections). +Коллекциями являются объекты, способные хранить в себе [сущности](entity.md). +Они унаследованы от `Illuminate/Support/Collection` и полностью поддерживают все +[стандартные методы](https://laravel.com/docs/master/collections) коллекций Laravel. -Помимо этого, они валидируют количество и вид сущностей, которые могут хранить в себе, согласно схеме АТОЛ Онлайн API. +Помимо этого, они валидируют количество и вид сущностей, которые могут хранить в себе, согласно схеме API АТОЛ Онлайн. Коллекции ведут себя аналогично самим сущностям в части приведения к массивам и json-ификации. diff --git a/docs/entity.md b/docs/entity.md index 76c79bc..234c9d2 100644 --- a/docs/entity.md +++ b/docs/entity.md @@ -4,10 +4,10 @@ --- -Сущностями являются все классы, которые необходимы для взаимодействия с API. Они находятся в директори `src/Entities` и -расширяют абстрактный класс `AtolOnline\Entities\Entity`. +Сущностями являются все классы, которые необходимы для взаимодействия с API. +Они находятся в директори `src/Entities` и расширяют абстрактный класс `AtolOnline\Entities\Entity`. -Каждая сущность содержит в себе только те данные, которые необходимы согласно схемы АТОЛ Онлайн API. +Каждая сущность содержит в себе только те данные, которые необходимы согласно схемы API АТОЛ Онлайн. Ниже перечислены возможности сущностей. diff --git a/docs/monitoring.md b/docs/monitoring.md index 3bb81ce..84f9550 100644 --- a/docs/monitoring.md +++ b/docs/monitoring.md @@ -48,7 +48,8 @@ $monitor->setTestMode(false); $kkts = $monitor->getAll(); ``` -В ответе будет итерируемая коллекция объектов `AtolOnline\Entities\Kkt`. Каждый из этих объектов содержит атрибуты: +В ответе будет итерируемая коллекция объектов `AtolOnline\Entities\Kkt`. +Каждый из этих объектов содержит атрибуты: ```php // для примера получим первую ККТ из всех diff --git a/docs/readme.md b/docs/readme.md index 9b95680..54a68ce 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,7 +1,6 @@ # Документация к библиотеке - ## Содержание * [Общий алгоритм](#getstarted) @@ -14,11 +13,10 @@ Если вы нашли опечатку или какое-то несоответствие — делайте pull-request. - ## Общий алгоритм -1. Создать документ `AtolOnline\Entities\Receipt` или `AtolOnline\Entities\Correction`, добавив в него все необходимые - данные +1. Создать документ `AtolOnline\Entities\Receipt` или `AtolOnline\Entities\Correction`, +добавив в него все необходимые данные 2. Отправить документ на регистрацию: 2.1. *Необязательно:* при отправке задать `callback_url`, на который АТОЛ отправит HTTP POST о состоянии документа; 2.2. *Необязательно:* при отправке задать `external_id`, чтобы присвоить свой уникальный идентификатор документа; @@ -26,8 +24,8 @@ > Если с документом был передан `callback_url`, то ответ придёт на этот самый URL. > Он должен быть обработан вашим сервисом в соответствии с бизнес-процессом. - > Если с документом **не был** передан `callback_url` **либо** callback от АТОЛа не пришёл в течение 300 секунд - > (5 минут), нужно запрашивать вручную по `uuid`, пришедшему от АТОЛа в ответ на регистрацию документа. + > Если с документом **не был** передан `callback_url` **либо** callback от АТОЛа не был получен/обработан в течение + > 300 секунд (5 минут), нужно запрашивать вручную по `uuid`, пришедшему от АТОЛа в ответ на регистрацию документа. 4. Проверить состояние документа: 4.1. взять `uuid` ответа, полученного на запрос фискализации; 4.2. отправить его в запросе состояния документа. diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..0243bc0 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,26 @@ + + + + + atol-online coding standards + + src + tests + + */docs/* + */vendor/* + + + + + + + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..6c53030 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Api/AtolClient.php b/src/Api/AtolClient.php index 08caa92..c4558a2 100644 --- a/src/Api/AtolClient.php +++ b/src/Api/AtolClient.php @@ -1,4 +1,5 @@ 'int', 'headers' => 'array|\string[][]', 'body' => 'mixed', diff --git a/src/Api/Fiscalizer.php b/src/Api/Fiscalizer.php index 17c90b5..75547a8 100644 --- a/src/Api/Fiscalizer.php +++ b/src/Api/Fiscalizer.php @@ -1,4 +1,5 @@ isTestMode() && $document->getCompany() diff --git a/src/Api/Monitor.php b/src/Api/Monitor.php index 77ecaf8..3e4df05 100644 --- a/src/Api/Monitor.php +++ b/src/Api/Monitor.php @@ -1,4 +1,5 @@ fetchAll($limit, $offset)->getContent()); - return $collection->map(fn($data) => new Kkt($data)); + return $collection->map(fn ($data) => new Kkt($data)); } /** diff --git a/src/Collections/EntityCollection.php b/src/Collections/EntityCollection.php index 7c92f0d..8868c53 100644 --- a/src/Collections/EntityCollection.php +++ b/src/Collections/EntityCollection.php @@ -1,4 +1,5 @@ isEmpty() && throw new (static::EMPTY_EXCEPTION_CLASS)(); $this->count() > static::MAX_COUNT && throw new (static::TOO_MANY_EXCEPTION_CLASS)(static::MAX_COUNT); + return $this; } /** * Проверяет корректность класса элемента коллекции * * @param mixed $item - * @return void + * @return static * @throws InvalidEntityInCollectionException */ - public function checkItemClass(mixed $item): void + public function checkItemClass(mixed $item): static { if (!is_object($item) || $item::class !== static::ENTITY_CLASS) { throw new InvalidEntityInCollectionException(static::class, static::ENTITY_CLASS, $item); } + return $this; } /** * Проверяет корректность классов элементов коллекции * - * @return $this + * @return static * @throws InvalidEntityInCollectionException */ - public function checkItemsClasses(): self + public function checkItemsClasses(): static { - return $this->each(fn($item) => $this->checkItemClass($item)); + return $this->each(fn ($item) => $this->checkItemClass($item)); } } diff --git a/src/Collections/Items.php b/src/Collections/Items.php index 62a1d06..a891482 100644 --- a/src/Collections/Items.php +++ b/src/Collections/Items.php @@ -1,4 +1,5 @@ setName($name)->setValue($value); } diff --git a/src/Entities/AgentInfo.php b/src/Entities/AgentInfo.php index 4607734..f30bc93 100644 --- a/src/Entities/AgentInfo.php +++ b/src/Entities/AgentInfo.php @@ -1,4 +1,5 @@ setType($type); - !is_null($pagent) && $this->setPayingAgent($pagent); - !is_null($rp_operator) && $this->setReceivePaymentsOperator($rp_operator); - !is_null($mt_operator) && $this->setMoneyTransferOperator($mt_operator); + $this->setType($type); } /** * Возвращает установленный признак оператора * - * @return string|null + * @return AgentType|null */ - public function getType(): ?string + public function getType(): ?AgentType { return $this->type; } @@ -75,24 +51,23 @@ final class AgentInfo extends Entity /** * Устанавливает признак оператора * - * @param string|null $type + * @param AgentType|null $type * @return AgentInfo - * @throws InvalidEnumValueException */ - public function setType(?string $type): self + public function setType(?AgentType $type): self { - AgentTypes::isValid($type) && $this->type = $type; + $this->type = $type; return $this; } /** - * Взвращает установленного платёжного агента + * Возвращает установленного платёжного агента * * @return PayingAgent|null */ public function getPayingAgent(): ?PayingAgent { - return $this->paying_agent; + return $this->payingAgent; } /** @@ -103,7 +78,7 @@ final class AgentInfo extends Entity */ public function setPayingAgent(?PayingAgent $agent): self { - $this->paying_agent = $agent; + $this->payingAgent = $agent; return $this; } @@ -114,7 +89,7 @@ final class AgentInfo extends Entity */ public function getReceivePaymentsOperator(): ?ReceivePaymentsOperator { - return $this->receive_payments_operator; + return $this->receivePaymentsOperator; } /** @@ -125,7 +100,7 @@ final class AgentInfo extends Entity */ public function setReceivePaymentsOperator(?ReceivePaymentsOperator $operator): self { - $this->receive_payments_operator = $operator; + $this->receivePaymentsOperator = $operator; return $this; } @@ -136,7 +111,7 @@ final class AgentInfo extends Entity */ public function getMoneyTransferOperator(): ?MoneyTransferOperator { - return $this->money_transfer_operator; + return $this->moneyTransferOperator; } /** @@ -147,7 +122,7 @@ final class AgentInfo extends Entity */ public function setMoneyTransferOperator(?MoneyTransferOperator $operator): self { - $this->money_transfer_operator = $operator; + $this->moneyTransferOperator = $operator; return $this; } @@ -157,13 +132,18 @@ final class AgentInfo extends Entity public function jsonSerialize(): array { $json = []; - $this->getType() && $json['type'] = $this->getType(); - $this->getPayingAgent()?->jsonSerialize() && $json['paying_agent'] = $this - ->getPayingAgent()->jsonSerialize(); - $this->getReceivePaymentsOperator()?->jsonSerialize() && $json['receive_payments_operator'] = $this - ->getReceivePaymentsOperator()->jsonSerialize(); - $this->getMoneyTransferOperator()?->jsonSerialize() && $json['money_transfer_operator'] = $this - ->getMoneyTransferOperator()->jsonSerialize(); + if ($this?->type) { + $json['type'] = $this->getType(); + } + if ($this->payingAgent?->jsonSerialize()) { + $json['paying_agent'] = $this->payingAgent->jsonSerialize(); + } + if ($this->receivePaymentsOperator?->jsonSerialize()) { + $json['receive_payments_operator'] = $this->receivePaymentsOperator->jsonSerialize(); + } + if ($this->moneyTransferOperator?->jsonSerialize()) { + $json['money_transfer_operator'] = $this->moneyTransferOperator->jsonSerialize(); + } return $json; } } diff --git a/src/Entities/Client.php b/src/Entities/Client.php index 8011274..23f796f 100644 --- a/src/Entities/Client.php +++ b/src/Entities/Client.php @@ -1,4 +1,5 @@ setName($name); @@ -116,8 +108,8 @@ final class Client extends Entity public function setPhone(?string $phone): self { if (is_string($phone)) { - $phone = preg_replace('/[^\d]/', '', trim($phone)); - if (preg_match(Constraints::PATTERN_PHONE, $phone) != 1) { + $phone = preg_replace('/\D/', '', trim($phone)); + if (preg_match(Constraints::PATTERN_PHONE, $phone) !== 1) { throw new InvalidPhoneException($phone); } } @@ -133,8 +125,8 @@ final class Client extends Entity { $json = []; !is_null($this->getName()) && $json['name'] = $this->getName(); - !is_null($this->getEmail()) && $json['email'] = $this->getEmail(); !is_null($this->getPhone()) && $json['phone'] = $this->getPhone(); + !is_null($this->getEmail()) && $json['email'] = $this->getEmail(); !is_null($this->getInn()) && $json['inn'] = $this->getInn(); return $json; } diff --git a/src/Entities/Company.php b/src/Entities/Company.php index e5b4b59..5329049 100644 --- a/src/Entities/Company.php +++ b/src/Entities/Company.php @@ -1,4 +1,5 @@ setEmail($email)->setSno($sno)->setInn($inn)->setPaymentAddress($payment_address); + $this->setInn($inn) + ->setPaymentAddress($paymentAddress) + ->setEmail($email); } /** * Возвращает установленный тип налогообложения * - * @return string + * @return SnoType */ - public function getSno(): string + public function getSno(): SnoType { return $this->sno; } @@ -82,14 +72,12 @@ final class Company extends Entity /** * Устанавливает тип налогообложения * - * @param string $sno + * @param SnoType $sno * @return $this - * @throws InvalidEnumValueException */ - public function setSno(string $sno): self + public function setSno(SnoType $sno): self { - $sno = trim($sno); - SnoTypes::isValid($sno) && $this->sno = $sno; + $this->sno = $sno; return $this; } @@ -100,57 +88,45 @@ final class Company extends Entity */ public function getPaymentAddress(): string { - return $this->payment_address; + return $this->paymentAddress; } /** * Устанавливает адрес места расчётов * - * @param string $payment_address + * @param string $paymentAddress * @return $this * @throws TooLongPaymentAddressException * @throws InvalidPaymentAddressException */ - public function setPaymentAddress(string $payment_address): self + public function setPaymentAddress(string $paymentAddress): self { - $payment_address = trim($payment_address); - if (empty($payment_address)) { + $paymentAddress = trim($paymentAddress); + if (empty($paymentAddress)) { throw new InvalidPaymentAddressException(); - } elseif (mb_strlen($payment_address) > Constraints::MAX_LENGTH_PAYMENT_ADDRESS) { - throw new TooLongPaymentAddressException($payment_address); + } elseif (mb_strlen($paymentAddress) > Constraints::MAX_LENGTH_PAYMENT_ADDRESS) { + throw new TooLongPaymentAddressException($paymentAddress); } - $this->payment_address = $payment_address; + $this->paymentAddress = $paymentAddress; return $this; } /** * @inheritDoc - * @throws InvalidEmailException - * @throws InvalidEnumValueException - * @throws InvalidInnLengthException - * @throws InvalidPaymentAddressException */ #[ArrayShape([ - 'email' => 'string', 'sno' => 'string', + 'email' => 'string', 'inn' => 'string', 'payment_address' => 'string', ])] public function jsonSerialize(): array { return [ - 'email' => $this->email - ? $this->getEmail() - : throw new InvalidEmailException(), - 'sno' => $this->sno - ? $this->getSno() - : throw new InvalidEnumValueException(SnoTypes::class, 'null'), - 'inn' => $this->inn - ? $this->getInn() - : throw new InvalidInnLengthException(), - 'payment_address' => $this->payment_address - ? $this->getPaymentAddress() - : throw new InvalidPaymentAddressException(), + 'inn' => $this->getInn(), + 'sno' => $this->getSno(), + 'payment_address' => $this->getPaymentAddress(), + 'email' => $this->getEmail(), ]; } } diff --git a/src/Entities/Correction.php b/src/Entities/Correction.php index 3e8fade..7185e2a 100644 --- a/src/Entities/Correction.php +++ b/src/Entities/Correction.php @@ -1,4 +1,5 @@ setCompany($company)->setCorrectionInfo($correction_info)->setPayments($payments)->setVats($vats); + $this->setCompany($company)->setCorrectionInfo($correctionInfo)->setPayments($payments)->setVats($vats); } /** @@ -143,18 +124,18 @@ final class Correction extends Entity */ public function getCorrectionInfo(): CorrectionInfo { - return $this->correction_info; + return $this->correctionInfo; } /** * Устанавливает данные коррекции * - * @param CorrectionInfo $correction_info + * @param CorrectionInfo $correctionInfo * @return Correction */ - public function setCorrectionInfo(CorrectionInfo $correction_info): Correction + public function setCorrectionInfo(CorrectionInfo $correctionInfo): Correction { - $this->correction_info = $correction_info; + $this->correctionInfo = $correctionInfo; return $this; } @@ -177,8 +158,7 @@ final class Correction extends Entity */ public function setPayments(Payments $payments): self { - $payments->checkCount(); - $payments->checkItemsClasses(); + $payments->checkCount()->checkItemsClasses(); $this->payments = $payments; return $this; } @@ -186,7 +166,7 @@ final class Correction extends Entity /** * Возвращает установленную коллекцию ставок НДС * - * @return Vats|null + * @return Vats */ public function getVats(): Vats { @@ -196,14 +176,13 @@ final class Correction extends Entity /** * Устанаваливает коллекцию ставок НДС * - * @param Vats|null $vats + * @param Vats $vats * @return $this * @throws Exception */ public function setVats(Vats $vats): self { - $vats->checkCount(); - $vats->checkItemsClasses(); + $vats->checkCount()->checkItemsClasses(); $this->vats = $vats; return $this; } diff --git a/src/Entities/CorrectionInfo.php b/src/Entities/CorrectionInfo.php index 2402640..3ffa566 100644 --- a/src/Entities/CorrectionInfo.php +++ b/src/Entities/CorrectionInfo.php @@ -1,4 +1,5 @@ setType($type)->setDate($date)->setNumber($number); + public function __construct( + protected CorrectionType $type, + DateTimeInterface | string $date, + protected string $number, + ) { + $this->setType($type) + ->setDate($date) + ->setNumber($number); } /** * Возвращает тип коррекции * - * @return string|null + * @return CorrectionType|null */ - public function getType(): ?string + public function getType(): ?CorrectionType { return $this->type; } @@ -73,23 +68,21 @@ final class CorrectionInfo extends Entity /** * Устанавливает тип коррекции * - * @param string $type + * @param CorrectionType $type * @return $this - * @throws InvalidEnumValueException */ - public function setType(string $type): self + public function setType(CorrectionType $type): self { - $type = trim($type); - CorrectionTypes::isValid($type) && $this->type = $type; + $this->type = $type; return $this; } /** * Возвращает дату документа основания для коррекции * - * @return string|null + * @return DateTimeImmutable */ - public function getDate(): ?string + public function getDate(): DateTimeImmutable { return $this->date; } @@ -97,17 +90,20 @@ final class CorrectionInfo extends Entity /** * Устанавливает дату документа основания для коррекции * - * @param DateTime|string $date Строковая дата в формате d.m.Y либо объект DateTime с датой + * @param DateTimeInterface|string $date Строковая дата в формате d.m.Y либо объект DateTime с датой * @return $this * @throws InvalidCorrectionDateException */ - public function setDate(DateTime|string $date): self + public function setDate(DateTimeInterface | string $date): self { try { if (is_string($date)) { - $date = new DateTime(trim($date)); + $this->date = new DateTimeImmutable(trim($date)); + } elseif ($date instanceof DateTime) { + $this->date = DateTimeImmutable::createFromMutable($date); + } elseif ($date instanceof DateTimeImmutable) { + $this->date = $date; } - $this->date = $date->format(Constraints::CORRECTION_DATE_FORMAT); } catch (Exception $e) { throw new InvalidCorrectionDateException($date, $e->getMessage()); } @@ -142,13 +138,16 @@ final class CorrectionInfo extends Entity /** * @inheritDoc */ - #[Pure] - #[ArrayShape(['type' => 'string', 'base_date' => 'string', 'base_number' => 'string'])] + #[ArrayShape([ + 'type' => 'string', + 'base_date' => 'string', + 'base_number' => 'string', + ])] public function jsonSerialize(): array { return [ 'type' => $this->getType(), - 'base_date' => $this->getDate(), + 'base_date' => $this->getDate()->format(Constraints::CORRECTION_DATE_FORMAT), 'base_number' => $this->getNumber(), ]; } diff --git a/src/Entities/Entity.php b/src/Entities/Entity.php index 86a13c7..9bc8fca 100644 --- a/src/Entities/Entity.php +++ b/src/Entities/Entity.php @@ -1,4 +1,5 @@ setName($name); !is_null($price) && $this->setPrice($price); @@ -160,13 +143,10 @@ final class Item extends Entity */ public function setName(string $name): self { - $name = trim($name); - if (mb_strlen($name) > Constraints::MAX_LENGTH_ITEM_NAME) { + if (mb_strlen($name = trim($name)) > Constraints::MAX_LENGTH_ITEM_NAME) { throw new TooLongItemNameException($name); } - if (empty($name)) { - throw new EmptyItemNameException(); - } + empty($name) && throw new EmptyItemNameException(); $this->name = $name; return $this; } @@ -193,12 +173,8 @@ final class Item extends Entity public function setPrice(float $price): self { $price = round($price, 2); - if ($price > Constraints::MAX_COUNT_ITEM_PRICE) { - throw new TooHighItemPriceException($this->getName(), $price); - } - if ($price < 0) { - throw new NegativeItemPriceException($this->getName(), $price); - } + $price > Constraints::MAX_COUNT_ITEM_PRICE && throw new TooHighItemPriceException($this->getName(), $price); + $price < 0 && throw new NegativeItemPriceException($this->getName(), $price); $this->price = $price; $this->getVat()?->setSum($this->getSum()); return $this; @@ -229,9 +205,7 @@ final class Item extends Entity if ($quantity > Constraints::MAX_COUNT_ITEM_QUANTITY) { throw new TooHighItemQuantityException($this->getName(), $quantity); } - if ($quantity < 0) { - throw new NegativeItemQuantityException($this->getName(), $quantity); - } + $quantity < 0 && throw new NegativeItemQuantityException($this->getName(), $quantity); $this->quantity = $quantity; $this->getVat()?->setSum($this->getSum()); return $this; @@ -296,7 +270,7 @@ final class Item extends Entity */ public function getCodeHex(): ?string { - return $this->code_hex; + return $this->codeHex; } /** @@ -318,57 +292,51 @@ final class Item extends Entity $hex_string = trim(preg_replace('/([\dA-Fa-f]{2})/', '$1 ', $hex)); } $this->code = $code ?: null; - $this->code_hex = $hex_string ?: null; + $this->codeHex = $hex_string ?: null; return $this; } /** * Возвращает признак способа оплаты * - * @return string|null + * @return PaymentMethod|null */ - public function getPaymentMethod(): ?string + public function getPaymentMethod(): ?PaymentMethod { - return $this->payment_method; + return $this->paymentMethod; } /** * Устанавливает признак способа оплаты * - * @param string|null $payment_method Признак способа оплаты + * @param PaymentMethod|null $paymentMethod Признак способа оплаты * @return $this - * @throws InvalidEnumValueException */ - public function setPaymentMethod(?string $payment_method): self + public function setPaymentMethod(?PaymentMethod $paymentMethod): self { - $payment_method = trim((string)$payment_method); - PaymentMethods::isValid($payment_method); - $this->payment_method = $payment_method ?: null; + $this->paymentMethod = $paymentMethod; return $this; } /** * Возвращает признак предмета расчёта * - * @return string|null + * @return PaymentObject|null */ - public function getPaymentObject(): ?string + public function getPaymentObject(): ?PaymentObject { - return $this->payment_object; + return $this->paymentObject; } /** * Устанавливает признак предмета расчёта * - * @param string|null $payment_object Признак предмета расчёта + * @param PaymentObject|null $paymentObject Признак предмета расчёта * @return $this - * @throws InvalidEnumValueException */ - public function setPaymentObject(?string $payment_object): self + public function setPaymentObject(?PaymentObject $paymentObject): self { - $payment_object = trim((string)$payment_object); - PaymentObjects::isValid($payment_object); - $this->payment_object = $payment_object ?: null; + $this->paymentObject = $paymentObject; return $this; } @@ -385,21 +353,19 @@ final class Item extends Entity /** * Устанавливает ставку НДС * - * @param Vat|string|null $vat Объект ставки, одно из значений VatTypes или null для удаления ставки + * @param Vat | VatType | null $vat Объект ставки, одно из значений VatTypes или null для удаления ставки * @return $this * @throws TooHighItemSumException - * @throws InvalidEnumValueException */ - public function setVat(Vat|string|null $vat): self + public function setVat(Vat | VatType | null $vat): self { - if (is_string($vat)) { - $vat = trim($vat); - empty($vat) - ? $this->vat = null - : VatTypes::isValid($vat) && $this->vat = new Vat($vat, $this->getSum()); + if (is_null($vat)) { + $this->vat = null; } elseif ($vat instanceof Vat) { $vat->setSum($this->getSum()); $this->vat = $vat; + } else { + $this->vat = new Vat($vat, $this->getSum()); } return $this; } @@ -411,18 +377,18 @@ final class Item extends Entity */ public function getAgentInfo(): ?AgentInfo { - return $this->agent_info; + return $this->agentInfo; } /** * Устанавливает атрибуты агента * - * @param AgentInfo|null $agent_info + * @param AgentInfo|null $agentInfo * @return Item */ - public function setAgentInfo(?AgentInfo $agent_info): self + public function setAgentInfo(?AgentInfo $agentInfo): self { - $this->agent_info = $agent_info; + $this->agentInfo = $agentInfo; return $this; } @@ -455,23 +421,23 @@ final class Item extends Entity */ public function getUserData(): ?string { - return $this->user_data; + return $this->userData; } /** * Устанавливает дополнительный реквизит * - * @param string|null $user_data Дополнительный реквизит + * @param string|null $userData Дополнительный реквизит * @return $this * @throws TooLongUserdataException */ - public function setUserData(?string $user_data): self + public function setUserData(?string $userData): self { - $user_data = trim((string)$user_data); - if (mb_strlen($user_data) > Constraints::MAX_LENGTH_USER_DATA) { - throw new TooLongUserdataException($user_data); + $userData = trim((string)$userData); + if (mb_strlen($userData) > Constraints::MAX_LENGTH_USER_DATA) { + throw new TooLongUserdataException($userData); } - $this->user_data = $user_data ?: null; + $this->userData = $userData ?: null; return $this; } @@ -512,25 +478,25 @@ final class Item extends Entity */ public function getCountryCode(): ?string { - return $this->country_code; + return $this->countryCode; } /** * Устанавливает код страны происхождения товара * - * @param string|null $country_code + * @param string|null $countryCode * @return Item * @throws InvalidOKSMCodeException * @see https://classifikators.ru/oksm * @see https://ru.wikipedia.org/wiki/Общероссийский_классификатор_стран_мира */ - public function setCountryCode(?string $country_code): self + public function setCountryCode(?string $countryCode): self { - $country_code = trim((string)$country_code); - if (preg_match(Constraints::PATTERN_OKSM_CODE, $country_code) != 1) { - throw new InvalidOKSMCodeException($country_code); + $countryCode = trim((string)$countryCode); + if (preg_match(Constraints::PATTERN_OKSM_CODE, $countryCode) != 1) { + throw new InvalidOKSMCodeException($countryCode); } - $this->country_code = $country_code ?: null; + $this->countryCode = $countryCode ?: null; return $this; } @@ -541,28 +507,27 @@ final class Item extends Entity */ public function getDeclarationNumber(): ?string { - return $this->declaration_number; + return $this->declarationNumber; } /** * Устанавливает код таможенной декларации * - * @param string|null $declaration_number + * @param string|null $declarationNumber * @return Item * @throws InvalidDeclarationNumberException */ - public function setDeclarationNumber(?string $declaration_number): self + public function setDeclarationNumber(?string $declarationNumber): self { - if (is_string($declaration_number)) { - $declaration_number = trim($declaration_number); - if ( - mb_strlen($declaration_number) < Constraints::MIN_LENGTH_DECLARATION_NUMBER - || mb_strlen($declaration_number) > Constraints::MAX_LENGTH_DECLARATION_NUMBER - ) { - throw new InvalidDeclarationNumberException($declaration_number); + if (is_string($declarationNumber)) { + $declarationNumber = trim($declarationNumber); + $is_short = mb_strlen($declarationNumber) < Constraints::MIN_LENGTH_DECLARATION_NUMBER; + $is_long = mb_strlen($declarationNumber) > Constraints::MAX_LENGTH_DECLARATION_NUMBER; + if ($is_short || $is_long) { + throw new InvalidDeclarationNumberException($declarationNumber); } } - $this->declaration_number = $declaration_number; + $this->declarationNumber = $declarationNumber; return $this; } diff --git a/src/Entities/Kkt.php b/src/Entities/Kkt.php index ba33358..0fca078 100644 --- a/src/Entities/Kkt.php +++ b/src/Entities/Kkt.php @@ -1,4 +1,5 @@ setName($name); $this->setInn($inn); diff --git a/src/Entities/PayingAgent.php b/src/Entities/PayingAgent.php index 7620382..7dca1b5 100644 --- a/src/Entities/PayingAgent.php +++ b/src/Entities/PayingAgent.php @@ -1,4 +1,5 @@ setOperation($operation); $this->setPhones($phones); diff --git a/src/Entities/Payment.php b/src/Entities/Payment.php index e4e57b4..c3aa3a0 100644 --- a/src/Entities/Payment.php +++ b/src/Entities/Payment.php @@ -1,4 +1,5 @@ setType($type)->setSum($sum); } /** * Возвращает установленный тип оплаты * - * @return int + * @return PaymentType */ - public function getType(): int + public function getType(): PaymentType { return $this->type; } @@ -69,13 +57,12 @@ final class Payment extends Entity /** * Устанавливает тип оплаты * - * @param int $type + * @param PaymentType $type * @return $this - * @throws InvalidEnumValueException */ - public function setType(int $type): self + public function setType(PaymentType $type): self { - PaymentTypes::isValid($type) && $this->type = $type; + $this->type = $type; return $this; } @@ -100,12 +87,8 @@ final class Payment extends Entity public function setSum(float $sum): self { $sum = round($sum, 2); - if ($sum > Constraints::MAX_COUNT_PAYMENT_SUM) { - throw new TooHighPaymentSumException($sum); - } - if ($sum < 0) { - throw new NegativePaymentSumException($sum); - } + $sum > Constraints::MAX_COUNT_PAYMENT_SUM && throw new TooHighPaymentSumException($sum); + $sum < 0 && throw new NegativePaymentSumException($sum); $this->sum = $sum; return $this; } diff --git a/src/Entities/Receipt.php b/src/Entities/Receipt.php index 67c7e59..c638bc3 100644 --- a/src/Entities/Receipt.php +++ b/src/Entities/Receipt.php @@ -1,4 +1,5 @@ checkCount(); $items->checkItemsClasses(); $this->items = $items; - $this->getItems()->each(fn($item) => $this->total += $item->getSum()); + $this->getItems()->each(fn ($item) => $this->total += $item->getSum()); $this->total = round($this->total, 2); return $this; } @@ -280,7 +281,7 @@ final class Receipt extends Entity $vats->checkItemsClasses(); $this->vats = $vats; /** @var Vat $vat */ - $this->getVats()->each(fn($vat) => $vat->setSum($this->getTotal())); + $this->getVats()->each(fn ($vat) => $vat->setSum($this->getTotal())); return $this; } diff --git a/src/Entities/ReceivePaymentsOperator.php b/src/Entities/ReceivePaymentsOperator.php index 83b52a3..92740b1 100644 --- a/src/Entities/ReceivePaymentsOperator.php +++ b/src/Entities/ReceivePaymentsOperator.php @@ -1,4 +1,5 @@ setPhones($phones); } diff --git a/src/Entities/Supplier.php b/src/Entities/Supplier.php index 579e241..65e18a5 100644 --- a/src/Entities/Supplier.php +++ b/src/Entities/Supplier.php @@ -1,4 +1,5 @@ setName($name); !is_null($inn) && $this->setInn($inn); diff --git a/src/Entities/Vat.php b/src/Entities/Vat.php index e65e829..51848ca 100644 --- a/src/Entities/Vat.php +++ b/src/Entities/Vat.php @@ -1,4 +1,5 @@ setType($type)->setSum($rubles); + public function __construct( + protected VatType $type, + protected float $sum, + ) { + $this->setType($type)->setSum($sum); } /** * Устанавливает тип ставки НДС * Автоматически пересчитывает итоговый размер НДС от исходной суммы. * - * @param string $type Тип ставки НДС + * @param VatType $type Тип ставки НДС * @return $this - * @throws InvalidEnumValueException */ - public function setType(string $type): self + public function setType(VatType $type): self { - $type = trim($type); - VatTypes::isValid($type) && $this->type = $type; + $this->type = $type; return $this; } /** * Возвращает тип ставки НДС * - * @return string + * @return VatType */ - public function getType(): string + public function getType(): VatType { return $this->type; } @@ -108,12 +97,12 @@ final class Vat extends Entity { return Helpers::toRub( match ($this->getType()) { - VatTypes::VAT10 => Helpers::toKop($this->sum) * 10 / 100, - VatTypes::VAT18 => Helpers::toKop($this->sum) * 18 / 100, - VatTypes::VAT20 => Helpers::toKop($this->sum) * 20 / 100, - VatTypes::VAT110 => Helpers::toKop($this->sum) * 10 / 110, - VatTypes::VAT118 => Helpers::toKop($this->sum) * 18 / 118, - VatTypes::VAT120 => Helpers::toKop($this->sum) * 20 / 120, + VatType::VAT10 => Helpers::toKop($this->sum) * 10 / 100, + VatType::VAT18 => Helpers::toKop($this->sum) * 18 / 100, + VatType::VAT20 => Helpers::toKop($this->sum) * 20 / 100, + VatType::VAT110 => Helpers::toKop($this->sum) * 10 / 110, + VatType::VAT118 => Helpers::toKop($this->sum) * 18 / 118, + VatType::VAT120 => Helpers::toKop($this->sum) * 20 / 120, default => 0, } ); diff --git a/src/Enums/AgentTypes.php b/src/Enums/AgentType.php similarity index 62% rename from src/Enums/AgentTypes.php rename to src/Enums/AgentType.php index 8d906dc..05c3166 100644 --- a/src/Enums/AgentTypes.php +++ b/src/Enums/AgentType.php @@ -1,4 +1,5 @@ assertEquals( + $this->assertSame( TestEnvParams::FFD105()['group'], (new Fiscalizer(group: 'group'))->getGroup() ); // prod mode - $this->assertEquals('group', (new Fiscalizer(false, group: 'group'))->getGroup()); + $this->assertSame('group', (new Fiscalizer(false, group: 'group'))->getGroup()); $this->assertNull((new Fiscalizer(false))->getGroup()); } @@ -164,7 +165,6 @@ class FiscalizerTest extends BasicTestCase * @throws EmptyLoginException * @throws EmptyPasswordException * @throws InvalidEntityInCollectionException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws NegativeItemPriceException @@ -176,12 +176,13 @@ class FiscalizerTest extends BasicTestCase * @throws TooLongPaymentAddressException * @throws TooManyException * @throws GuzzleException + * @throws InvalidEnumValueException */ public function testSell(): void { $fisc_result = $this->newReceipt()->sell(new Fiscalizer()); $this->assertTrue($fisc_result->isSuccessful()); - $this->assertEquals('wait', $fisc_result->getContent()->status); + $this->assertSame('wait', $fisc_result->getContent()->status); self::$registered_uuids[] = $fisc_result->getContent()->uuid; } @@ -201,7 +202,6 @@ class FiscalizerTest extends BasicTestCase * @throws EmptyLoginException * @throws EmptyPasswordException * @throws InvalidEntityInCollectionException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws NegativeItemPriceException @@ -213,12 +213,13 @@ class FiscalizerTest extends BasicTestCase * @throws TooLongPaymentAddressException * @throws TooManyException * @throws GuzzleException + * @throws InvalidEnumValueException */ public function testSellRefund(): void { $fisc_result = $this->newReceipt()->sellRefund(new Fiscalizer()); $this->assertTrue($fisc_result->isSuccessful()); - $this->assertEquals('wait', $fisc_result->getContent()->status); + $this->assertSame('wait', $fisc_result->getContent()->status); self::$registered_uuids[] = $fisc_result->getContent()->uuid; } @@ -237,7 +238,6 @@ class FiscalizerTest extends BasicTestCase * @throws EmptyPasswordException * @throws GuzzleException * @throws InvalidEntityInCollectionException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws NegativePaymentSumException @@ -245,12 +245,13 @@ class FiscalizerTest extends BasicTestCase * @throws TooLongPaymentAddressException * @throws EmptyCorrectionNumberException * @throws InvalidCorrectionDateException + * @throws InvalidEnumValueException */ public function testSellCorrect(): void { $fisc_result = $this->newCorrection()->sellCorrect(new Fiscalizer()); $this->assertTrue($fisc_result->isSuccessful()); - $this->assertEquals('wait', $fisc_result->getContent()->status); + $this->assertSame('wait', $fisc_result->getContent()->status); //self::$registered_uuids[] = $fisc_result->getContent()->uuid; } @@ -270,7 +271,6 @@ class FiscalizerTest extends BasicTestCase * @throws EmptyLoginException * @throws EmptyPasswordException * @throws InvalidEntityInCollectionException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws NegativeItemPriceException @@ -282,12 +282,13 @@ class FiscalizerTest extends BasicTestCase * @throws TooLongPaymentAddressException * @throws TooManyException * @throws GuzzleException + * @throws InvalidEnumValueException */ public function testBuy(): void { $fisc_result = $this->newReceipt()->buy(new Fiscalizer()); $this->assertTrue($fisc_result->isSuccessful()); - $this->assertEquals('wait', $fisc_result->getContent()->status); + $this->assertSame('wait', $fisc_result->getContent()->status); //self::$registered_uuids[] = $fisc_result->getContent()->uuid; } @@ -307,7 +308,6 @@ class FiscalizerTest extends BasicTestCase * @throws EmptyLoginException * @throws EmptyPasswordException * @throws InvalidEntityInCollectionException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws NegativeItemPriceException @@ -319,12 +319,13 @@ class FiscalizerTest extends BasicTestCase * @throws TooLongPaymentAddressException * @throws TooManyException * @throws GuzzleException + * @throws InvalidEnumValueException */ public function testBuyRefund(): void { $fisc_result = $this->newReceipt()->buyRefund(new Fiscalizer()); $this->assertTrue($fisc_result->isSuccessful()); - $this->assertEquals('wait', $fisc_result->getContent()->status); + $this->assertSame('wait', $fisc_result->getContent()->status); //self::$registered_uuids[] = $fisc_result->getContent()->uuid; } @@ -356,7 +357,7 @@ class FiscalizerTest extends BasicTestCase { $fisc_result = $this->newCorrection()->buyCorrect(new Fiscalizer()); $this->assertTrue($fisc_result->isSuccessful()); - $this->assertEquals('wait', $fisc_result->getContent()->status); + $this->assertSame('wait', $fisc_result->getContent()->status); //self::$registered_uuids[] = $fisc_result->getContent()->uuid; } @@ -395,6 +396,6 @@ class FiscalizerTest extends BasicTestCase { $fisc_status = (new Fiscalizer())->pollDocumentStatus(array_shift(self::$registered_uuids)); //$this->assertTrue($fisc_status->isSuccessful()); - $this->assertEquals('done', $fisc_status->getContent()->status); + $this->assertSame('done', $fisc_status->getContent()->status); } } diff --git a/tests/AtolOnline/Tests/Api/MonitorTest.php b/tests/AtolOnline/Tests/Api/MonitorTest.php index bebe25c..76a6248 100644 --- a/tests/AtolOnline/Tests/Api/MonitorTest.php +++ b/tests/AtolOnline/Tests/Api/MonitorTest.php @@ -1,4 +1,5 @@ assertEquals('login', $client->getLogin()); + $this->assertSame('login', $client->getLogin()); $client = new Monitor(); - $this->assertEquals(TestEnvParams::FFD105()['login'], $client->getLogin()); + $this->assertSame(TestEnvParams::FFD105()['login'], $client->getLogin()); $client->setLogin('login'); - $this->assertEquals(TestEnvParams::FFD105()['login'], $client->getLogin()); + $this->assertSame(TestEnvParams::FFD105()['login'], $client->getLogin()); } /** @@ -145,13 +146,13 @@ class MonitorTest extends BasicTestCase public function testPassword(): void { $client = new Monitor(false, password: 'password'); - $this->assertEquals('password', $client->getPassword()); + $this->assertSame('password', $client->getPassword()); $client = new Monitor(); - $this->assertEquals(TestEnvParams::FFD105()['password'], $client->getPassword()); + $this->assertSame(TestEnvParams::FFD105()['password'], $client->getPassword()); $client->setPassword('password'); - $this->assertEquals(TestEnvParams::FFD105()['password'], $client->getPassword()); + $this->assertSame(TestEnvParams::FFD105()['password'], $client->getPassword()); } /** @@ -204,9 +205,6 @@ class MonitorTest extends BasicTestCase $client = (new Monitor())->setTestMode(); $this->assertTrue($client->isTestMode()); - $client = (new Monitor())->setTestMode(true); - $this->assertTrue($client->isTestMode()); - $client = (new Monitor())->setTestMode(false); $this->assertFalse($client->isTestMode()); } @@ -302,7 +300,6 @@ class MonitorTest extends BasicTestCase $client = $this->newTestClient(); $client->auth(); $kkts = $client->getAll(); - $sss = $kkts->where('deviceNumber', 'KKT014034'); $this->assertNotEmpty($client->getLastResponse()->getContent()); $this->assertIsCollection($kkts); $this->assertTrue($kkts->count() > 0); @@ -342,6 +339,6 @@ class MonitorTest extends BasicTestCase $this->assertIsSameClass(Kkt::class, $kkt); $this->assertIsAtolable($kkt); $this->assertNotNull($kkt->serialNumber); - $this->assertEquals($serial_number, $kkt->serialNumber); + $this->assertSame($serial_number, $kkt->serialNumber); } } diff --git a/tests/AtolOnline/Tests/BasicTestCase.php b/tests/AtolOnline/Tests/BasicTestCase.php index 8f576d6..a1c5673 100644 --- a/tests/AtolOnline/Tests/BasicTestCase.php +++ b/tests/AtolOnline/Tests/BasicTestCase.php @@ -1,4 +1,5 @@ assertIsArray($entity->jsonSerialize()); $this->assertIsArray($entity->toArray()); - $this->assertEquals($entity->jsonSerialize(), $entity->toArray()); + $this->assertSame($entity->jsonSerialize(), $entity->toArray()); $this->assertIsString((string)$entity); $this->assertJson((string)$entity); - if (!is_null($json_structure)) { - $this->assertEquals(json_encode($json_structure), (string)$entity); + if (!empty($json_structure)) { + $this->assertSame(json_encode($json_structure), (string)$entity); } } @@ -134,7 +135,7 @@ class BasicTestCase extends TestCase * @param object|string $expected Ожидаемый класс * @param object|string $actual Фактический класс */ - public function assertIsSameClass(object|string $expected, object|string $actual): void + public function assertIsSameClass(object | string $expected, object | string $actual): void { $this->assertTrue($this->checkisSameClass($expected, $actual)); } @@ -146,7 +147,7 @@ class BasicTestCase extends TestCase * @param object|string $class2 * @return bool */ - private function checkisSameClass(object|string $class1, object|string $class2): bool + private function checkisSameClass(object | string $class1, object | string $class2): bool { return (is_object($class1) ? $class1::class : $class1) === (is_object($class2) ? $class2::class : $class2); @@ -158,7 +159,7 @@ class BasicTestCase extends TestCase * @param array $expected Массив ожидаемых имён классов-родителей * @param object|string $actual Объект или имя класса для проверки */ - public function assertExtendsClasses(array $expected, object|string $actual): void + public function assertExtendsClasses(array $expected, object | string $actual): void { $this->assertTrue($this->checkExtendsClasses($expected, $actual)); } @@ -169,7 +170,7 @@ class BasicTestCase extends TestCase * @param string[] $parents Имена классов-родителей * @param object|string $class Объект или имя класса для проверки */ - private function checkExtendsClasses(array $parents, object|string $class): bool + private function checkExtendsClasses(array $parents, object | string $class): bool { return !empty(array_intersect($parents, is_object($class) ? class_parents($class) : [$class])); } @@ -180,7 +181,7 @@ class BasicTestCase extends TestCase * @param string[] $expected Массив ожидаемых имён интерфейсов * @param object|string $actual Объект или имя класса для проверки */ - public function assertImplementsInterfaces(array $expected, object|string $actual): void + public function assertImplementsInterfaces(array $expected, object | string $actual): void { $this->assertTrue($this->checkImplementsInterfaces($expected, $actual)); } @@ -192,7 +193,7 @@ class BasicTestCase extends TestCase * @param object|string $class Объект или имя класса для проверки * @see https://www.php.net/manual/ru/function.class-implements.php */ - private function checkImplementsInterfaces(array $interfaces, object|string $class): bool + private function checkImplementsInterfaces(array $interfaces, object | string $class): bool { return !empty(array_intersect($interfaces, is_object($class) ? class_implements($class) : [$class])); } @@ -203,7 +204,7 @@ class BasicTestCase extends TestCase * @param string[] $expected Массив ожидаемых имён трейтов * @param object|string $actual Объект или имя класса для проверки */ - public function assertUsesTraits(array $expected, object|string $actual): void + public function assertUsesTraits(array $expected, object | string $actual): void { $this->assertTrue($this->checkUsesTraits($expected, $actual)); } @@ -216,15 +217,15 @@ class BasicTestCase extends TestCase * @return bool * @see https://www.php.net/manual/ru/function.class-uses.php#110752 */ - private function checkUsesTraits(array $traits, object|string $class): bool + private function checkUsesTraits(array $traits, object | string $class): bool { $found_traits = []; $check_class = is_object($class) ? $class::class : $class; do { - $found_traits = array_merge(class_uses($check_class, true), $found_traits); + $found_traits = array_merge(class_uses($check_class), $found_traits); } while ($check_class = get_parent_class($check_class)); foreach ($found_traits as $trait => $same) { - $found_traits = array_merge(class_uses($trait, true), $found_traits); + $found_traits = array_merge(class_uses($trait), $found_traits); } return !empty(array_intersect(array_unique($found_traits), $traits)); } @@ -349,13 +350,11 @@ class BasicTestCase extends TestCase * @throws TooManyException * @throws Exception */ - protected function generateItemObjects(int $count = 1): array + protected function generateItemObjects(int $count = 1): iterable { - $result = []; for ($i = 0; $i < abs($count); ++$i) { - $result[] = new Item(Helpers::randomStr(), random_int(1, 100), random_int(1, 10)); + yield new Item(Helpers::randomStr(), random_int(1, 100), random_int(1, 10)); } - return $result; } /** @@ -363,22 +362,19 @@ class BasicTestCase extends TestCase * * @param int $count * @return Payment[] - * @throws InvalidEnumValueException * @throws NegativePaymentSumException * @throws TooHighPaymentSumException * @throws Exception */ - protected function generatePaymentObjects(int $count = 1): array + protected function generatePaymentObjects(int $count = 1): iterable { - $types = PaymentTypes::toArray(); - $result = []; + $types = PaymentType::cases(); for ($i = 0; $i < abs($count); ++$i) { - $result[] = new Payment( - array_values($types)[random_int(min($types), max($types))], + yield new Payment( + $types[random_int(0, count($types) - 1)], random_int(1, 100) * 2 / 3 ); } - return $result; } /** @@ -389,17 +385,15 @@ class BasicTestCase extends TestCase * @throws InvalidEnumValueException * @throws Exception */ - protected function generateVatObjects(int $count = 1): array + protected function generateVatObjects(int $count = 1): iterable { - $types = VatTypes::toArray(); - $result = []; + $types = VatType::cases(); for ($i = 0; $i < abs($count); ++$i) { - $result[] = new Vat( - array_values($types)[random_int(0, count($types) - 1)], + yield new Vat( + $types[random_int(0, count($types) - 1)], random_int(1, 100) * 2 / 3 ); } - return $result; } /** @@ -409,7 +403,6 @@ class BasicTestCase extends TestCase * @throws EmptyItemNameException * @throws EmptyItemsException * @throws InvalidEntityInCollectionException - * @throws InvalidEnumValueException * @throws NegativeItemPriceException * @throws NegativeItemQuantityException * @throws NegativePaymentSumException @@ -421,8 +414,8 @@ class BasicTestCase extends TestCase protected function newReceipt(): Receipt { return new Receipt( - new Client('John Doe', 'john@example.com', '+79501234567', '1234567890'), - new Company('company@example.com', SnoTypes::OSN, '1234567890', 'https://example.com'), + new Client('John Doe', '+79501234567', 'john@example.com', '1234567890'), + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@example.com'), new Items($this->generateItemObjects(2)), new Payments($this->generatePaymentObjects()) ); @@ -442,8 +435,8 @@ class BasicTestCase extends TestCase protected function newCorrection(): Correction { return new Correction( - new Company('company@example.com', SnoTypes::OSN, '1234567890', 'https://example.com'), - new CorrectionInfo(CorrectionTypes::SELF, '01.01.2021', Helpers::randomStr()), + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@example.com'), + new CorrectionInfo(CorrectionType::SELF, '01.01.2021', Helpers::randomStr()), new Payments($this->generatePaymentObjects(2)), new Vats($this->generateVatObjects(2)), ); diff --git a/tests/AtolOnline/Tests/Collections/ItemsTest.php b/tests/AtolOnline/Tests/Collections/ItemsTest.php index 6cc9ace..cdf146f 100644 --- a/tests/AtolOnline/Tests/Collections/ItemsTest.php +++ b/tests/AtolOnline/Tests/Collections/ItemsTest.php @@ -1,4 +1,5 @@ generateVatObjects(3)); $this->assertIsCollection($vats); - $this->assertEquals(3, $vats->count()); + $this->assertSame(3, $vats->count()); $this->assertIsAtolable($vats); } @@ -89,6 +90,7 @@ class VatsTest extends BasicTestCase * @covers \AtolOnline\Exceptions\InvalidEntityInCollectionException * @throws InvalidEnumValueException * @throws Exception + * @noinspection PhpParamsInspection */ public function testInvalidCollectionItemExceptionScalar(): void { @@ -115,7 +117,7 @@ class VatsTest extends BasicTestCase $this->expectException(InvalidEntityInCollectionException::class); $this->expectExceptionMessage(Payment::class); (new Vats($this->generateVatObjects())) - ->merge([new Payment(PaymentTypes::PREPAID, 1)]) + ->merge([new Payment(PaymentType::PREPAID, 1)]) ->jsonSerialize(); } } diff --git a/tests/AtolOnline/Tests/Entities/AdditionalUserPropsTest.php b/tests/AtolOnline/Tests/Entities/AdditionalUserPropsTest.php index 8ee0f58..476c1e8 100644 --- a/tests/AtolOnline/Tests/Entities/AdditionalUserPropsTest.php +++ b/tests/AtolOnline/Tests/Entities/AdditionalUserPropsTest.php @@ -1,4 +1,5 @@ assertIsAtolable(new AgentInfo(), []); + $this->assertIsAtolable(new AgentInfo()); } /** @@ -58,63 +58,64 @@ class AgentInfoTest extends BasicTestCase * @throws InvalidPhoneException * @throws TooLongPayingAgentOperationException * @throws InvalidInnLengthException - * @throws InvalidEnumValueException * @throws Exception */ public function testConstructorWithArgs(): void { - $this->assertIsAtolable(new AgentInfo(null), []); - $this->assertIsAtolable(new AgentInfo(AgentTypes::ANOTHER), ['type' => AgentTypes::ANOTHER]); - $this->assertIsAtolable(new AgentInfo(pagent: new PayingAgent()), []); - $this->assertIsAtolable(new AgentInfo(mt_operator: new MoneyTransferOperator()), []); - $this->assertIsAtolable(new AgentInfo(rp_operator: new ReceivePaymentsOperator()), []); + $this->assertIsAtolable(new AgentInfo(null)); + $this->assertIsAtolable( + new AgentInfo(AgentType::ANOTHER), + ['type' => AgentType::ANOTHER] + ); + $this->assertIsAtolable( + new AgentInfo(payingAgent: new PayingAgent()) + ); + $this->assertIsAtolable( + new AgentInfo(moneyTransferOperator: new MoneyTransferOperator()) + ); + $this->assertIsAtolable( + new AgentInfo(receivePaymentsOperator: new ReceivePaymentsOperator()) + ); - $this->assertIsAtolable(new AgentInfo( - AgentTypes::ANOTHER, - new PayingAgent(), - new ReceivePaymentsOperator(), - new MoneyTransferOperator(), - ), ['type' => AgentTypes::ANOTHER]); + $this->assertIsAtolable( + new AgentInfo( + AgentType::ANOTHER, + new PayingAgent(), + new ReceivePaymentsOperator(), + new MoneyTransferOperator(), + ), + ['type' => AgentType::ANOTHER] + ); - $this->assertIsAtolable(new AgentInfo( - AgentTypes::ANOTHER, - new PayingAgent('test', ['+79518888888']), - new ReceivePaymentsOperator(['+79519999999']), - new MoneyTransferOperator('MTO Name', '9876543210', 'London', ['+79517777777']), - ), [ - 'type' => AgentTypes::ANOTHER, - 'paying_agent' => [ - 'operation' => 'test', - 'phones' => [ - '+79518888888', + $this->assertIsAtolable( + new AgentInfo( + AgentType::ANOTHER, + new PayingAgent('test', ['+79518888888']), + new ReceivePaymentsOperator(['+79519999999']), + new MoneyTransferOperator('MTO Name', '9876543210', 'London', ['+79517777777']), + ), + [ + 'type' => AgentType::ANOTHER, + 'paying_agent' => [ + 'operation' => 'test', + 'phones' => [ + '+79518888888', + ], ], - ], - 'receive_payments_operator' => [ - 'phones' => [ - '+79519999999', + 'receive_payments_operator' => [ + 'phones' => [ + '+79519999999', + ], ], - ], - 'money_transfer_operator' => [ - 'name' => 'MTO Name', - 'inn' => '9876543210', - 'address' => 'London', - 'phones' => [ - "+79517777777", + 'money_transfer_operator' => [ + 'name' => 'MTO Name', + 'inn' => '9876543210', + 'address' => 'London', + 'phones' => [ + '+79517777777', + ], ], - ], - ]); - } - - /** - * Тестирует исключение при некорректном типе - * - * @covers \AtolOnline\Entities\AgentInfo - * @covers \AtolOnline\Enums\AgentTypes::isValid - * @covers \AtolOnline\Exceptions\InvalidEnumValueException - */ - public function testInvalidEnumValueException(): void - { - $this->expectException(InvalidEnumValueException::class); - new AgentInfo('qwerty'); + ] + ); } } diff --git a/tests/AtolOnline/Tests/Entities/ClientTest.php b/tests/AtolOnline/Tests/Entities/ClientTest.php index b68c8c3..102f57a 100644 --- a/tests/AtolOnline/Tests/Entities/ClientTest.php +++ b/tests/AtolOnline/Tests/Entities/ClientTest.php @@ -1,4 +1,5 @@ assertIsAtolable(new Client(), []); + $this->assertIsAtolable(new Client()); } /** @@ -56,19 +57,20 @@ class ClientTest extends BasicTestCase public function testConstructorWithArgs(): void { $this->assertIsAtolable(new Client('John Doe'), ['name' => 'John Doe']); - $this->assertIsAtolable(new Client(email: 'john@example.com'), ['email' => 'john@example.com']); $this->assertIsAtolable(new Client(phone: '+1/22/99*73s dsdas654 5s6'), ['phone' => '+122997365456']); + $this->assertIsAtolable(new Client(email: 'john@example.com'), ['email' => 'john@example.com']); $this->assertIsAtolable(new Client(inn: '+fasd3\qe3fs_=nac99013928czc'), ['inn' => '3399013928']); $this->assertIsAtolable( new Client( 'John Doe', - 'john@example.com', '+1/22/99*73s dsdas654 5s6', // +122997365456 + 'john@example.com', '+fasd3\qe3fs_=nac99013928czc' // 3399013928 - ), [ + ), + [ 'name' => 'John Doe', - 'email' => 'john@example.com', 'phone' => '+122997365456', + 'email' => 'john@example.com', 'inn' => '3399013928', ] ); @@ -100,7 +102,7 @@ class ClientTest extends BasicTestCase public function testValidName(): void { $name = Helpers::randomStr(); - $this->assertEquals($name, (new Client())->setName($name)->getName()); + $this->assertSame($name, (new Client())->setName($name)->getName()); } /** @@ -143,7 +145,7 @@ class ClientTest extends BasicTestCase */ public function testValidPhone(string $input, string $output): void { - $this->assertEquals($output, (new Client())->setPhone($input)->getPhone()); + $this->assertSame($output, (new Client())->setPhone($input)->getPhone()); } /** @@ -174,7 +176,7 @@ class ClientTest extends BasicTestCase */ public function testValidEmails(mixed $email): void { - $this->assertEquals($email, (new Client())->setEmail($email)->getEmail()); + $this->assertSame($email, (new Client())->setEmail($email)->getEmail()); } /** @@ -219,8 +221,8 @@ class ClientTest extends BasicTestCase */ public function testValidInn(): void { - $this->assertEquals('1234567890', (new Client())->setInn('1234567890')->getInn()); - $this->assertEquals('123456789012', (new Client())->setInn('123456789012')->getInn()); + $this->assertSame('1234567890', (new Client())->setInn('1234567890')->getInn()); + $this->assertSame('123456789012', (new Client())->setInn('123456789012')->getInn()); } /** @@ -261,7 +263,7 @@ class ClientTest extends BasicTestCase public function testOffsetGetExists(): void { $client = new Client('John Doe'); - $this->assertEquals('John Doe', $client['name']); + $this->assertSame('John Doe', $client['name']); $this->assertTrue(isset($client['name'])); $this->assertFalse(isset($client['qwerty'])); } diff --git a/tests/AtolOnline/Tests/Entities/CompanyTest.php b/tests/AtolOnline/Tests/Entities/CompanyTest.php index 862c68e..5d0fc47 100644 --- a/tests/AtolOnline/Tests/Entities/CompanyTest.php +++ b/tests/AtolOnline/Tests/Entities/CompanyTest.php @@ -1,4 +1,5 @@ assertIsAtolable(new Company( - $email = 'company@example.com', - $sno = SnoTypes::OSN, - $inn = '1234567890', - $payment_address = 'https://example.com', - ), [ - 'email' => $email, - 'sno' => $sno, - 'inn' => $inn, - 'payment_address' => $payment_address, - ]); + $this->assertIsAtolable( + new Company( + $inn = '1234567890', + $sno = SnoType::OSN, + $paymentAddress = 'https://example.com', + $email = 'company@example.com', + ), + [ + 'inn' => $inn, + 'sno' => $sno, + 'payment_address' => $paymentAddress, + 'email' => $email, + ] + ); } /** @@ -64,7 +67,6 @@ class CompanyTest extends BasicTestCase * @covers \AtolOnline\Entities\Company::setEmail * @covers \AtolOnline\Exceptions\TooLongEmailException * @throws InvalidEmailException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws TooLongEmailException @@ -73,7 +75,7 @@ class CompanyTest extends BasicTestCase public function testEmailTooLongException() { $this->expectException(TooLongEmailException::class); - new Company(Helpers::randomStr(65), SnoTypes::OSN, '1234567890', 'https://example.com'); + new Company('1234567890', SnoType::OSN, 'https://example.com', Helpers::randomStr(65)); } /** @@ -86,20 +88,7 @@ class CompanyTest extends BasicTestCase public function testInvalidEmailException() { $this->expectException(InvalidEmailException::class); - new Company('company@examas%^*.com', SnoTypes::OSN, '1234567890', 'https://example.com'); - } - - /** - * Тестирует исключение о слишком длинном платёжном адресе - * - * @covers \AtolOnline\Entities\Company - * @covers \AtolOnline\Entities\Company::setSno - * @covers \AtolOnline\Exceptions\InvalidEnumValueException - */ - public function testInvalidSnoException() - { - $this->expectException(InvalidEnumValueException::class); - new Company('company@example.com', 'test', '1234567890', 'https://example.com'); + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@examas%^*.com'); } /** @@ -109,7 +98,6 @@ class CompanyTest extends BasicTestCase * @covers \AtolOnline\Entities\Company::setInn * @covers \AtolOnline\Exceptions\InvalidInnLengthException * @throws InvalidEmailException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws TooLongEmailException @@ -118,7 +106,7 @@ class CompanyTest extends BasicTestCase public function testInvalidInnLengthException() { $this->expectException(InvalidInnLengthException::class); - new Company('company@example.com', SnoTypes::OSN, Helpers::randomStr(13), 'https://example.com'); + new Company(Helpers::randomStr(13), SnoType::OSN, 'https://example.com', 'company@example.com'); } /** @@ -128,7 +116,6 @@ class CompanyTest extends BasicTestCase * @covers \AtolOnline\Entities\Company::setPaymentAddress * @covers \AtolOnline\Exceptions\TooLongPaymentAddressException * @throws InvalidEmailException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPaymentAddressException * @throws TooLongEmailException @@ -137,7 +124,7 @@ class CompanyTest extends BasicTestCase public function testTooLongPaymentAddressException() { $this->expectException(TooLongPaymentAddressException::class); - new Company('company@example.com', SnoTypes::OSN, '1234567890', Helpers::randomStr(257)); + new Company('1234567890', SnoType::OSN, Helpers::randomStr(257), 'company@example.com'); } /** @@ -150,6 +137,6 @@ class CompanyTest extends BasicTestCase public function testInvalidPaymentAddressException() { $this->expectException(InvalidPaymentAddressException::class); - new Company('company@example.com', SnoTypes::OSN, '1234567890', ''); + new Company('1234567890', SnoType::OSN, '', 'company@example.com'); } } diff --git a/tests/AtolOnline/Tests/Entities/CorrectionInfoTest.php b/tests/AtolOnline/Tests/Entities/CorrectionInfoTest.php index 3cf7e8d..cdf3e13 100644 --- a/tests/AtolOnline/Tests/Entities/CorrectionInfoTest.php +++ b/tests/AtolOnline/Tests/Entities/CorrectionInfoTest.php @@ -1,4 +1,5 @@ assertIsAtolable( - new CorrectionInfo(CorrectionTypes::SELF, '01.01.2021', $number = Helpers::randomStr()), + new CorrectionInfo(CorrectionType::SELF, '01.01.2021', $number = Helpers::randomStr()), [ - 'type' => CorrectionTypes::SELF, + 'type' => CorrectionType::SELF, 'base_date' => '01.01.2021', 'base_number' => $number, ] ); - } - /** - * Тестирует исключение при некорректном типе - * - * @covers \AtolOnline\Entities\CorrectionInfo - * @covers \AtolOnline\Entities\CorrectionInfo::setType - * @covers \AtolOnline\Enums\CorrectionTypes::isValid - * @covers \AtolOnline\Exceptions\InvalidEnumValueException - * @return void - * @throws EmptyCorrectionNumberException - * @throws InvalidCorrectionDateException - * @throws InvalidEnumValueException - */ - public function testInvalidEnumValueException(): void - { - $this->expectException(InvalidEnumValueException::class); - $this->expectExceptionMessage('Некорректное значение AtolOnline\Enums\CorrectionTypes::wrong_value'); - new CorrectionInfo('wrong_value', '01.01.2021', Helpers::randomStr()); + $this->assertIsAtolable( + new CorrectionInfo(CorrectionType::SELF, new DateTime('02.02.2022'), $number = Helpers::randomStr()), + [ + 'type' => CorrectionType::SELF, + 'base_date' => '02.02.2022', + 'base_number' => $number, + ] + ); + + $this->assertIsAtolable( + new CorrectionInfo( + CorrectionType::SELF, + new DateTimeImmutable('03.03.2023'), + $number = Helpers::randomStr() + ), + [ + 'type' => CorrectionType::SELF, + 'base_date' => '03.03.2023', + 'base_number' => $number, + ] + ); } /** @@ -77,17 +81,15 @@ class CorrectionInfoTest extends BasicTestCase * * @covers \AtolOnline\Entities\CorrectionInfo * @covers \AtolOnline\Entities\CorrectionInfo::setDate - * @covers \AtolOnline\Enums\CorrectionTypes::isValid * @covers \AtolOnline\Exceptions\InvalidCorrectionDateException * @return void * @throws EmptyCorrectionNumberException * @throws InvalidCorrectionDateException - * @throws InvalidEnumValueException */ public function testInvalidCorrectionDateException(): void { $this->expectException(InvalidCorrectionDateException::class); - new CorrectionInfo(CorrectionTypes::SELF, Helpers::randomStr(), Helpers::randomStr()); + new CorrectionInfo(CorrectionType::SELF, Helpers::randomStr(), Helpers::randomStr()); } /** @@ -95,13 +97,12 @@ class CorrectionInfoTest extends BasicTestCase * * @covers \AtolOnline\Entities\CorrectionInfo * @covers \AtolOnline\Entities\CorrectionInfo::setNumber - * @covers \AtolOnline\Enums\CorrectionTypes::isValid * @covers \AtolOnline\Exceptions\EmptyCorrectionNumberException * @return void */ public function testEmptyCorrectionNumberException(): void { $this->expectException(EmptyCorrectionNumberException::class); - new CorrectionInfo(CorrectionTypes::SELF, '01.01.2021', "\n\r\t\0"); + new CorrectionInfo(CorrectionType::SELF, '01.01.2021', "\n\r\t\0"); } } diff --git a/tests/AtolOnline/Tests/Entities/CorrectionTest.php b/tests/AtolOnline/Tests/Entities/CorrectionTest.php index 7cef2b2..398568b 100644 --- a/tests/AtolOnline/Tests/Entities/CorrectionTest.php +++ b/tests/AtolOnline/Tests/Entities/CorrectionTest.php @@ -1,4 +1,5 @@ newCorrection()->setCashier(Helpers::randomStr()); $this->assertArrayHasKey('cashier', $correction->jsonSerialize()); - $this->assertEquals($correction->getCashier(), $correction->jsonSerialize()['cashier']); + $this->assertSame($correction->getCashier(), $correction->jsonSerialize()['cashier']); } /** diff --git a/tests/AtolOnline/Tests/Entities/ItemTest.php b/tests/AtolOnline/Tests/Entities/ItemTest.php index 3be1b50..9950f83 100644 --- a/tests/AtolOnline/Tests/Entities/ItemTest.php +++ b/tests/AtolOnline/Tests/Entities/ItemTest.php @@ -1,4 +1,5 @@ assertEquals( - PaymentMethods::ADVANCE, - $item->setPaymentMethod(PaymentMethods::ADVANCE)->getPaymentMethod() + $this->assertSame( + PaymentMethod::ADVANCE, + $item->setPaymentMethod(PaymentMethod::ADVANCE)->getPaymentMethod() ); - $this->assertEquals( - PaymentObjects::COMMODITY, - $item->setPaymentObject(PaymentObjects::COMMODITY)->getPaymentObject() + $this->assertSame( + PaymentObject::COMMODITY, + $item->setPaymentObject(PaymentObject::COMMODITY)->getPaymentObject() ); $this->assertIsAtolable($item, [ 'name' => 'test item', @@ -287,80 +289,6 @@ class ItemTest extends BasicTestCase ]); } - /** - * Тестирует установку невалидного способа оплаты - * - * @covers \AtolOnline\Entities\Item::setPaymentMethod - * @covers \AtolOnline\Exceptions\InvalidEnumValueException - * @throws EmptyItemNameException - * @throws InvalidEnumValueException - * @throws TooManyException - * @throws NegativeItemPriceException - * @throws TooHighItemPriceException - * @throws NegativeItemQuantityException - * @throws TooLongItemNameException - */ - public function testInvalidPaymentMethod(): void - { - $this->expectException(InvalidEnumValueException::class); - $this->expectExceptionMessage('Некорректное значение AtolOnline\Enums\PaymentMethods::wrong_value'); - (new Item('test item', 2, 3))->setPaymentMethod('wrong_value'); - } - - /** - * Тестирует установку невалидного предмета расчёта - * - * @covers \AtolOnline\Entities\Item::setPaymentObject - * @covers \AtolOnline\Exceptions\InvalidEnumValueException - * @throws EmptyItemNameException - * @throws InvalidEnumValueException - * @throws TooManyException - * @throws NegativeItemPriceException - * @throws TooHighItemPriceException - * @throws NegativeItemQuantityException - * @throws TooLongItemNameException - */ - public function testInvalidPaymentObject(): void - { - $this->expectException(InvalidEnumValueException::class); - $this->expectExceptionMessage('Некорректное значение AtolOnline\Enums\PaymentObjects::wrong_value'); - (new Item('test item', 2, 3))->setPaymentObject('wrong_value'); - } - - /** - * Тестирует установку ставки НДС по строковой константе типа ставки - * - * @covers \AtolOnline\Entities\Item::setVat - * @covers \AtolOnline\Entities\Item::getVat - * @covers \AtolOnline\Entities\Item::jsonSerialize - * @throws EmptyItemNameException - * @throws InvalidEnumValueException - * @throws NegativeItemPriceException - * @throws NegativeItemQuantityException - * @throws TooHighItemPriceException - * @throws TooHighItemSumException - * @throws TooLongItemNameException - * @throws TooManyException - * @throws Exception - */ - public function testValidVatByString(): void - { - $item = (new Item('test item', 2, 3))->setVat(VatTypes::VAT20); - $this->assertIsSameClass(Vat::class, $item->getVat()); - $this->assertEquals(VatTypes::VAT20, $item->getVat()->getType()); - $this->assertEquals($item->getSum(), $item->getVat()->getSum()); - $this->assertIsAtolable($item, [ - 'name' => 'test item', - 'price' => 2, - 'quantity' => 3, - 'sum' => 6, - 'vat' => [ - 'type' => 'vat20', - 'sum' => 1.2, - ], - ]); - } - /** * Тестирует установку ставки НДС объектом * @@ -368,7 +296,6 @@ class ItemTest extends BasicTestCase * @covers \AtolOnline\Entities\Item::getVat * @covers \AtolOnline\Entities\Item::jsonSerialize * @throws EmptyItemNameException - * @throws InvalidEnumValueException * @throws NegativeItemPriceException * @throws NegativeItemQuantityException * @throws TooHighItemPriceException @@ -379,11 +306,11 @@ class ItemTest extends BasicTestCase */ public function testValidVatByObject(): void { - $vat = new Vat(VatTypes::VAT20, 4000); + $vat = new Vat(VatType::VAT20, 4000); $item = (new Item('test item', 2, 3))->setVat($vat); $this->assertIsSameClass(Vat::class, $item->getVat()); - $this->assertEquals(VatTypes::VAT20, $item->getVat()->getType()); - $this->assertEquals($item->getSum(), $item->getVat()->getSum()); + $this->assertSame(VatType::VAT20, $item->getVat()->getType()); + $this->assertSame($item->getSum(), $item->getVat()->getSum()); $this->assertIsAtolable($item, [ 'name' => 'test item', 'price' => 2, @@ -396,28 +323,6 @@ class ItemTest extends BasicTestCase ]); } - /** - * Тестирует обнуление ставки НДС - * - * @param mixed $vat - * @dataProvider providerNullableStrings - * @covers \AtolOnline\Entities\Item::setVat - * @covers \AtolOnline\Entities\Item::getVat - * @covers \AtolOnline\Entities\Item::jsonSerialize - * @throws EmptyItemNameException - * @throws NegativeItemPriceException - * @throws NegativeItemQuantityException - * @throws TooHighItemPriceException - * @throws TooLongItemNameException - * @throws TooManyException - * @throws InvalidEnumValueException - */ - public function testNullableVatByString(mixed $vat): void - { - $item = (new Item('test item', 2, 3))->setVat($vat); - $this->assertNull($item->getVat()); - } - /** * Тестирует установку атрибутов агента * @@ -425,7 +330,6 @@ class ItemTest extends BasicTestCase * @covers \AtolOnline\Entities\Item::getAgentInfo * @covers \AtolOnline\Entities\Item::jsonSerialize * @throws EmptyItemNameException - * @throws InvalidEnumValueException * @throws InvalidInnLengthException * @throws InvalidPhoneException * @throws NegativeItemPriceException @@ -438,13 +342,13 @@ class ItemTest extends BasicTestCase public function testAgentInfo(): void { $agent_info = new AgentInfo( - AgentTypes::ANOTHER, + AgentType::ANOTHER, new PayingAgent('test', ['+79518888888']), new ReceivePaymentsOperator(['+79519999999']), new MoneyTransferOperator('MTO Name', '9876543210', 'London', ['+79517777777']), ); $item = (new Item('test item', 2, 3))->setAgentInfo($agent_info); - $this->assertEquals($agent_info, $item->getAgentInfo()); + $this->assertSame($agent_info, $item->getAgentInfo()); } /** @@ -471,7 +375,7 @@ class ItemTest extends BasicTestCase ['+122997365456'], ); $item = (new Item('test item', 2, 3))->setSupplier($supplier); - $this->assertEquals($supplier, $item->getSupplier()); + $this->assertSame($supplier, $item->getSupplier()); $this->assertIsAtolable($item, [ 'name' => 'test item', 'price' => 2, @@ -744,11 +648,11 @@ class ItemTest extends BasicTestCase $encoded = trim(preg_replace('/([\dA-Fa-f]{2})/', '$1 ', bin2hex($code))); $item = (new Item('test item', 2, 3))->setCode($code); - $this->assertEquals($code, $item->getCode()); - $this->assertEquals($encoded, $item->getCodeHex()); + $this->assertSame($code, $item->getCode()); + $this->assertSame($encoded, $item->getCodeHex()); $decoded = hex2bin(str_replace(' ', '', $item->getCodeHex())); - $this->assertEquals($decoded, $item->getCode()); + $this->assertSame($decoded, $item->getCode()); $this->assertIsAtolable($item, [ 'name' => 'test item', diff --git a/tests/AtolOnline/Tests/Entities/KktEntityTest.php b/tests/AtolOnline/Tests/Entities/KktEntityTest.php index f27758e..a6b88d3 100644 --- a/tests/AtolOnline/Tests/Entities/KktEntityTest.php +++ b/tests/AtolOnline/Tests/Entities/KktEntityTest.php @@ -1,4 +1,5 @@ expectException(NotEnoughMonitorDataException::class); - new Kkt((object)[ - 'fiscalizationDate' => '2021-11-20T10:21:00+00:00', - ]); + new Kkt( + (object)[ + 'fiscalizationDate' => '2021-11-20T10:21:00+00:00', + ] + ); } /** @@ -104,7 +107,7 @@ class KktEntityTest extends BasicTestCase // string $this->assertNotNull($kkt->serialNumber); $this->assertIsString($kkt->serialNumber); - $this->assertEquals($this->sample_data['serialNumber'], $kkt->serialNumber); + $this->assertSame($this->sample_data['serialNumber'], $kkt->serialNumber); // int $this->assertNotNull($kkt->signedDocuments); diff --git a/tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php b/tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php index f077466..31ebdc1 100644 --- a/tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php +++ b/tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php @@ -1,4 +1,5 @@ assertEquals('[]', (string)(new MoneyTransferOperator())); + $this->assertSame('[]', (string)(new MoneyTransferOperator())); } /** @@ -52,20 +53,26 @@ class MoneyTransferOperatorTest extends BasicTestCase public function testConstructorWithArgs(): void { $this->assertIsAtolable(new MoneyTransferOperator('some name'), ['name' => 'some name']); - $this->assertIsAtolable(new MoneyTransferOperator(inn: '+fasd3\qe3fs_=nac99013928czc'), ['inn' => '3399013928']); + $this->assertIsAtolable( + new MoneyTransferOperator(inn: '+fasd3\qe3fs_=nac99013928czc'), + ['inn' => '3399013928'] + ); $this->assertIsAtolable(new MoneyTransferOperator(address: 'London'), ['address' => 'London']); $this->assertIsAtolable(new MoneyTransferOperator(phones: ['+122997365456']), ['phones' => ['+122997365456']]); - $this->assertIsAtolable(new MoneyTransferOperator( - 'some name', - '+fasd3\qe3fs_=nac99013928czc', - 'London', - ['+122997365456'], - ), [ - 'name' => 'some name', - 'inn' => '3399013928', - 'address' => 'London', - 'phones' => ['+122997365456'], - ]); + $this->assertIsAtolable( + new MoneyTransferOperator( + 'some name', + '+fasd3\qe3fs_=nac99013928czc', + 'London', + ['+122997365456'], + ), + [ + 'name' => 'some name', + 'inn' => '3399013928', + 'address' => 'London', + 'phones' => ['+122997365456'], + ] + ); } /** @@ -145,8 +152,8 @@ class MoneyTransferOperatorTest extends BasicTestCase */ public function testValidInn(): void { - $this->assertEquals('1234567890', (new MoneyTransferOperator())->setInn('1234567890')->getInn()); - $this->assertEquals('123456789012', (new MoneyTransferOperator())->setInn('123456789012')->getInn()); + $this->assertSame('1234567890', (new MoneyTransferOperator())->setInn('1234567890')->getInn()); + $this->assertSame('123456789012', (new MoneyTransferOperator())->setInn('123456789012')->getInn()); } /** diff --git a/tests/AtolOnline/Tests/Entities/PayingAgentTest.php b/tests/AtolOnline/Tests/Entities/PayingAgentTest.php index 62ed0a4..7f2fe6a 100644 --- a/tests/AtolOnline/Tests/Entities/PayingAgentTest.php +++ b/tests/AtolOnline/Tests/Entities/PayingAgentTest.php @@ -1,4 +1,5 @@ assertEquals('[]', (string)(new PayingAgent())); + $this->assertSame('[]', (string)(new PayingAgent())); } /** @@ -49,13 +50,16 @@ class PayingAgentTest extends BasicTestCase public function testConstructorWithArgs(): void { $operation = Helpers::randomStr(); - $this->assertIsAtolable(new PayingAgent( - $operation, - ['+122997365456'], - ), [ - 'operation' => $operation, - 'phones' => ['+122997365456'], - ]); + $this->assertIsAtolable( + new PayingAgent( + $operation, + ['+122997365456'], + ), + [ + 'operation' => $operation, + 'phones' => ['+122997365456'], + ] + ); $this->assertIsAtolable( new PayingAgent($operation), ['operation' => $operation] diff --git a/tests/AtolOnline/Tests/Entities/PaymentTest.php b/tests/AtolOnline/Tests/Entities/PaymentTest.php index da58d5a..d441518 100644 --- a/tests/AtolOnline/Tests/Entities/PaymentTest.php +++ b/tests/AtolOnline/Tests/Entities/PaymentTest.php @@ -1,4 +1,5 @@ assertIsAtolable( - new Payment(PaymentTypes::ELECTRON, 123.456789), + new Payment(PaymentType::ELECTRON, 123.456789), [ - 'type' => PaymentTypes::ELECTRON, + 'type' => PaymentType::ELECTRON, 'sum' => 123.46, ] ); } - /** - * Тестирует исключение при некорректном типе - * - * @covers \AtolOnline\Entities\Payment - * @covers \AtolOnline\Entities\Payment::setType - * @covers \AtolOnline\Enums\PaymentTypes::isValid - * @covers \AtolOnline\Exceptions\InvalidEnumValueException - * @return void - * @throws InvalidEnumValueException - * @throws NegativePaymentSumException - * @throws TooHighPaymentSumException - */ - public function testInvalidEnumValueException(): void - { - $this->expectException(InvalidEnumValueException::class); - $this->expectExceptionMessage('Некорректное значение AtolOnline\Enums\PaymentTypes::123'); - new Payment(123, 123.456789); - } - /** * Тестирует исключение при слишком большой сумме * @@ -77,13 +57,12 @@ class PaymentTest extends BasicTestCase * @covers \AtolOnline\Entities\Payment::setSum * @covers \AtolOnline\Exceptions\TooHighPaymentSumException * @return void - * @throws InvalidEnumValueException * @throws NegativePaymentSumException */ public function testTooHighPaymentSumException(): void { $this->expectException(TooHighPaymentSumException::class); - new Payment(PaymentTypes::ELECTRON, Constraints::MAX_COUNT_PAYMENT_SUM + 1); + new Payment(PaymentType::ELECTRON, Constraints::MAX_COUNT_PAYMENT_SUM + 1); } /** @@ -93,13 +72,12 @@ class PaymentTest extends BasicTestCase * @covers \AtolOnline\Entities\Payment::setSum * @covers \AtolOnline\Exceptions\NegativePaymentSumException * @return void - * @throws InvalidEnumValueException * @throws NegativePaymentSumException * @throws TooHighPaymentSumException */ public function testNegativePaymentSumException(): void { $this->expectException(NegativePaymentSumException::class); - new Payment(PaymentTypes::ELECTRON, -1); + new Payment(PaymentType::ELECTRON, -1); } } diff --git a/tests/AtolOnline/Tests/Entities/ReceiptTest.php b/tests/AtolOnline/Tests/Entities/ReceiptTest.php index ce3151b..403243b 100644 --- a/tests/AtolOnline/Tests/Entities/ReceiptTest.php +++ b/tests/AtolOnline/Tests/Entities/ReceiptTest.php @@ -1,4 +1,5 @@ newReceipt()->setAgentInfo($agent_info); $this->assertArrayHasKey('agent_info', $receipt->jsonSerialize()); - $this->assertEquals($receipt->getAgentInfo()->jsonSerialize(), $receipt->jsonSerialize()['agent_info']); + $this->assertSame($receipt->getAgentInfo()->jsonSerialize(), $receipt->jsonSerialize()['agent_info']); $this->assertArrayNotHasKey('agent_info', $receipt->setAgentInfo(null)->jsonSerialize()); } @@ -159,7 +160,7 @@ class ReceiptTest extends BasicTestCase $supplier = new Supplier('some name', '+fasd3\qe3fs_=nac99013928czc', ['+122997365456']); $receipt = $this->newReceipt()->setSupplier($supplier); $this->assertArrayHasKey('supplier_info', $receipt->jsonSerialize()); - $this->assertEquals($receipt->getSupplier()->jsonSerialize(), $receipt->jsonSerialize()['supplier_info']); + $this->assertSame($receipt->getSupplier()->jsonSerialize(), $receipt->jsonSerialize()['supplier_info']); $this->assertArrayNotHasKey('supplier_info', $receipt->setSupplier(null)->jsonSerialize()); } @@ -181,8 +182,8 @@ class ReceiptTest extends BasicTestCase { $this->expectException(EmptyItemsException::class); new Receipt( - new Client('John Doe', 'john@example.com', '+1/22/99*73s dsdas654 5s6', '+fasd3\qe3fs_=nac99013928czc'), - new Company('company@example.com', SnoTypes::OSN, '1234567890', 'https://example.com'), + new Client('John Doe', '+1/22/99*73s dsdas654 5s6', 'john@example.com', '+fasd3\qe3fs_=nac99013928czc'), + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@example.com'), new Items([]), new Payments($this->generatePaymentObjects()) ); @@ -211,8 +212,8 @@ class ReceiptTest extends BasicTestCase 'Коллекция AtolOnline\Collections\Items должна содержать объекты AtolOnline\Entities\Item' ); new Receipt( - new Client('John Doe', 'john@example.com', '+1/22/99*73s dsdas654 5s6', '+fasd3\qe3fs_=nac99013928czc'), - new Company('company@example.com', SnoTypes::OSN, '1234567890', 'https://example.com'), + new Client('John Doe', '+1/22/99*73s dsdas654 5s6', 'john@example.com', '+fasd3\qe3fs_=nac99013928czc'), + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@example.com'), new Items(['qwerty']), new Payments($this->generatePaymentObjects()) ); @@ -240,8 +241,8 @@ class ReceiptTest extends BasicTestCase { $this->expectException(EmptyPaymentsException::class); new Receipt( - new Client('John Doe', 'john@example.com', '+1/22/99*73s dsdas654 5s6', '+fasd3\qe3fs_=nac99013928czc'), - new Company('company@example.com', SnoTypes::OSN, '1234567890', 'https://example.com'), + new Client('John Doe', '+1/22/99*73s dsdas654 5s6', 'john@example.com', '+fasd3\qe3fs_=nac99013928czc'), + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@example.com'), new Items([new Item('test item', 2, 3)]), new Payments([]) ); @@ -273,8 +274,8 @@ class ReceiptTest extends BasicTestCase 'Коллекция AtolOnline\Collections\Payments должна содержать объекты AtolOnline\Entities\Payment' ); (string)new Receipt( - new Client('John Doe', 'john@example.com', '+1/22/99*73s dsdas654 5s6', '+fasd3\qe3fs_=nac99013928czc'), - new Company('company@example.com', SnoTypes::OSN, '1234567890', 'https://example.com'), + new Client('John Doe', '+1/22/99*73s dsdas654 5s6', 'john@example.com', '+fasd3\qe3fs_=nac99013928czc'), + new Company('1234567890', SnoType::OSN, 'https://example.com', 'company@example.com'), new Items([new Item('test item', 2, 3)]), new Payments(['qwerty']) ); @@ -365,11 +366,11 @@ class ReceiptTest extends BasicTestCase { $receipt = $this->newReceipt(); $items_total = $receipt->getItems()->pluck('sum')->sum(); - $this->assertEquals($items_total, $receipt->getTotal()); + $this->assertSame($items_total, $receipt->getTotal()); /** @var Vat $vat */ $receipt->setVats(new Vats($this->generateVatObjects(2)))->getVats() - ->each(fn($vat) => $this->assertEquals($items_total, $vat->getSum())); + ->each(fn ($vat) => $this->assertSame($items_total, $vat->getSum())); } /** @@ -398,7 +399,7 @@ class ReceiptTest extends BasicTestCase { $receipt = $this->newReceipt()->setCashier(Helpers::randomStr()); $this->assertArrayHasKey('cashier', $receipt->jsonSerialize()); - $this->assertEquals($receipt->getCashier(), $receipt->jsonSerialize()['cashier']); + $this->assertSame($receipt->getCashier(), $receipt->jsonSerialize()['cashier']); } /** @@ -480,7 +481,7 @@ class ReceiptTest extends BasicTestCase { $receipt = $this->newReceipt()->setAddCheckProps(Helpers::randomStr()); $this->assertArrayHasKey('additional_check_props', $receipt->jsonSerialize()); - $this->assertEquals($receipt->getAddCheckProps(), $receipt->jsonSerialize()['additional_check_props']); + $this->assertSame($receipt->getAddCheckProps(), $receipt->jsonSerialize()['additional_check_props']); } /** @@ -562,7 +563,7 @@ class ReceiptTest extends BasicTestCase $aup = new AdditionalUserProps('name', 'value'); $receipt = $this->newReceipt()->setAddUserProps($aup); $this->assertArrayHasKey('additional_user_props', $receipt->jsonSerialize()); - $this->assertEquals( + $this->assertSame( $receipt->getAddUserProps()->jsonSerialize(), $receipt->jsonSerialize()['additional_user_props'] ); diff --git a/tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php b/tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php index 8ed134d..b0f897a 100644 --- a/tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php +++ b/tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php @@ -1,4 +1,5 @@ assertEquals('[]', (string)(new ReceivePaymentsOperator())); + $this->assertSame('[]', (string)(new ReceivePaymentsOperator())); } /** diff --git a/tests/AtolOnline/Tests/Entities/SupplierTest.php b/tests/AtolOnline/Tests/Entities/SupplierTest.php index c14720c..5d775ae 100644 --- a/tests/AtolOnline/Tests/Entities/SupplierTest.php +++ b/tests/AtolOnline/Tests/Entities/SupplierTest.php @@ -1,4 +1,5 @@ assertEquals('[]', (string)(new Supplier())); + $this->assertSame('[]', (string)(new Supplier())); } /** @@ -52,15 +53,18 @@ class SupplierTest extends BasicTestCase $this->assertIsAtolable(new Supplier('some name'), ['name' => 'some name']); $this->assertIsAtolable(new Supplier(inn: '+fasd3\qe3fs_=nac99013928czc'), ['inn' => '3399013928']); $this->assertIsAtolable(new Supplier(phones: ['+122997365456']), ['phones' => ['+122997365456']]); - $this->assertIsAtolable(new Supplier( - 'some name', - '+fasd3\qe3fs_=nac99013928czc', - ['+122997365456'], - ), [ - 'name' => 'some name', - 'inn' => '3399013928', - 'phones' => ['+122997365456'], - ]); + $this->assertIsAtolable( + new Supplier( + 'some name', + '+fasd3\qe3fs_=nac99013928czc', + ['+122997365456'], + ), + [ + 'name' => 'some name', + 'inn' => '3399013928', + 'phones' => ['+122997365456'], + ] + ); } /** @@ -140,8 +144,8 @@ class SupplierTest extends BasicTestCase */ public function testValidInn(): void { - $this->assertEquals('1234567890', (new Supplier())->setInn('1234567890')->getInn()); - $this->assertEquals('123456789012', (new Supplier())->setInn('123456789012')->getInn()); + $this->assertSame('1234567890', (new Supplier())->setInn('1234567890')->getInn()); + $this->assertSame('123456789012', (new Supplier())->setInn('123456789012')->getInn()); } /** diff --git a/tests/AtolOnline/Tests/Entities/VatTest.php b/tests/AtolOnline/Tests/Entities/VatTest.php index 33d39cd..6012cc5 100644 --- a/tests/AtolOnline/Tests/Entities/VatTest.php +++ b/tests/AtolOnline/Tests/Entities/VatTest.php @@ -1,4 +1,5 @@ assertIsAtolable($vat, [ 'type' => $vat->getType(), 'sum' => $vat->getCalculated(), ]); - $this->assertEquals($type, $vat->getType()); - $this->assertEquals($sum, $vat->getSum()); + $this->assertSame($type, $vat->getType()); + $this->assertSame($sum, $vat->getSum()); } /** * Тестирует расчёт суммы НДС от суммы 100+20р и 100-20р * * @dataProvider providerVatsAdd - * @param string $type Тип НДС + * @param VatType $type Тип НДС * @param float $after_plus Результат после +20р * @param float $after_minus Результат после -20р * @covers \AtolOnline\Entities\Vat::addSum * @covers \AtolOnline\Entities\Vat::getCalculated - * @throws InvalidEnumValueException */ - public function testVatAdd(string $type, float $after_plus, float $after_minus) + public function testVatAdd(VatType $type, float $after_plus, float $after_minus) { $vat = (new Vat($type, 100))->addSum(20); // 120р - $this->assertEquals($after_plus, $vat->getCalculated()); + $this->assertSame($after_plus, $vat->getCalculated()); $vat->addSum(-20); // 100р - $this->assertEquals($after_minus, $vat->getCalculated()); + $this->assertSame($after_minus, $vat->getCalculated()); } } diff --git a/tests/AtolOnline/Tests/HelpersTest.php b/tests/AtolOnline/Tests/HelpersTest.php index 79e90c9..c66064f 100644 --- a/tests/AtolOnline/Tests/HelpersTest.php +++ b/tests/AtolOnline/Tests/HelpersTest.php @@ -1,4 +1,5 @@ assertIsFloat($result); - $this->assertEquals($result, $rubles); + $this->assertSame($result, $rubles); } /** @@ -103,7 +104,7 @@ class HelpersTest extends BasicTestCase { $result = Helpers::toKop($rubles); $this->assertIsInt($result); - $this->assertEquals($result, $kopeks); + $this->assertSame($result, $kopeks); } /** @@ -117,7 +118,7 @@ class HelpersTest extends BasicTestCase { $result = Helpers::randomStr($input); $this->assertIsString($result); - $this->assertEquals($output, strlen($result)); + $this->assertSame($output, strlen($result)); // тестировать на наличие цифр быссмысленно } }