diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ef668e..44408a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,9 @@ "@shared": "Shared", "exceptions": "Error" }, + "material-icon-theme.files.associations": { + "*.spec.php": "test-ts" + }, "cSpell.words": [ "agrupadores", "aliquota", diff --git a/php/.gitignore b/php/.gitignore index 5f6fd2a..406abd8 100644 --- a/php/.gitignore +++ b/php/.gitignore @@ -1,2 +1,3 @@ # Dependencies vendor/ +.phpunit.cache/ diff --git a/php/composer.json b/php/composer.json index 9c3b405..d4e78b9 100644 --- a/php/composer.json +++ b/php/composer.json @@ -2,14 +2,15 @@ "name": "alebatistella/bling-erp-api", "description": "Pacote de integração com a API do Bling ERP", "type": "library", + "version": "0.0.1", "license": "MIT", "autoload": { "psr-4": { - "AleBatistella\\BlingErpApi\\": "src/", - "AleBatistella\\BlingErpApi\\Entities\\Shared": "src/entities/@shared" + "AleBatistella\\BlingErpApi\\": "./src/", + "AleBatistella\\BlingErpApi\\Entities\\Shared\\": "./src/Entities/@shared/" }, "files": [ - "src/Helpers/functions.php" + "./src/Helpers/functions.php" ] }, "authors": [ @@ -22,6 +23,8 @@ "guzzlehttp/guzzle": "^7.8" }, "require-dev": { - "laravel/laravel": "^10.2" + "laravel/laravel": "^10.2", + "phpunit/phpunit": "^10.5", + "fakerphp/faker": "^1.23" } } \ No newline at end of file diff --git a/php/composer.lock b/php/composer.lock index 182ac66..e446716 100644 --- a/php/composer.lock +++ b/php/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": "d2e2b2f931e5f215d1f02383fbd76a21", + "content-hash": "c8a3c37070516bd3412271302dfbde91", "packages": [ { "name": "guzzlehttp/guzzle", @@ -661,26 +661,26 @@ }, { "name": "carbonphp/carbon-doctrine-types", - "version": "3.1.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "a31d3358a2a5d6ae947df1691d1f321418a5f3d5" + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/a31d3358a2a5d6ae947df1691d1f321418a5f3d5", - "reference": "a31d3358a2a5d6ae947df1691d1f321418a5f3d5", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^7.4 || ^8.0" }, "conflict": { - "doctrine/dbal": "<4.0.0 || >=5.0.0" + "doctrine/dbal": "<3.7.0 || >=4.0.0" }, "require-dev": { - "doctrine/dbal": "^4.0.0", + "doctrine/dbal": "^3.7.0", "nesbot/carbon": "^2.71.0 || ^3.0.0", "phpunit/phpunit": "^10.3" }, @@ -710,7 +710,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.1.0" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0" }, "funding": [ { @@ -726,7 +726,7 @@ "type": "tidelift" } ], - "time": "2023-12-10T15:33:53+00:00" + "time": "2023-12-11T17:09:12+00:00" }, { "name": "dflydev/dot-access-data", @@ -1099,6 +1099,74 @@ ], "time": "2023-10-06T06:47:41+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e3daa170d00fde61ea7719ef47bb09bb8f1d9b01", + "reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.21-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.23.0" + }, + "time": "2023-06-12T08:44:38+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.3.0", @@ -1320,16 +1388,16 @@ }, { "name": "laravel/framework", - "version": "v10.37.3", + "version": "v10.38.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "996375dd61f8c6e4ac262b57ed485655d71fcbdc" + "reference": "43da808391da3540d44a8dfeb4e46da4ad8f5723" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/996375dd61f8c6e4ac262b57ed485655d71fcbdc", - "reference": "996375dd61f8c6e4ac262b57ed485655d71fcbdc", + "url": "https://api.github.com/repos/laravel/framework/zipball/43da808391da3540d44a8dfeb4e46da4ad8f5723", + "reference": "43da808391da3540d44a8dfeb4e46da4ad8f5723", "shasum": "" }, "require": { @@ -1375,6 +1443,8 @@ "voku/portable-ascii": "^2.0" }, "conflict": { + "carbonphp/carbon-doctrine-types": ">=3.0", + "doctrine/dbal": ">=4.0", "tightenco/collect": "<5.5.33" }, "provide": { @@ -1486,6 +1556,7 @@ "files": [ "src/Illuminate/Collections/helpers.php", "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" ], @@ -1518,20 +1589,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-13T20:10:58+00:00" + "time": "2023-12-22T14:39:10+00:00" }, { "name": "laravel/laravel", - "version": "v10.2.10", + "version": "v10.3.0", "source": { "type": "git", "url": "https://github.com/laravel/laravel.git", - "reference": "d6a2d8b837fc86af6ba9f57ea6bd2bac1e386e39" + "reference": "647c9bc29e7ff2dd5d3455e925c33445c8400b79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/laravel/zipball/d6a2d8b837fc86af6ba9f57ea6bd2bac1e386e39", - "reference": "d6a2d8b837fc86af6ba9f57ea6bd2bac1e386e39", + "url": "https://api.github.com/repos/laravel/laravel/zipball/647c9bc29e7ff2dd5d3455e925c33445c8400b79", + "reference": "647c9bc29e7ff2dd5d3455e925c33445c8400b79", "shasum": "" }, "require": { @@ -1573,9 +1644,9 @@ "laravel" ], "support": { - "source": "https://github.com/laravel/laravel/tree/v10.2.10" + "source": "https://github.com/laravel/laravel/tree/v10.3.0" }, - "time": "2023-11-30T22:35:41+00:00" + "time": "2023-12-19T14:44:37+00:00" }, { "name": "laravel/prompts", @@ -2324,6 +2395,65 @@ ], "time": "2023-10-27T15:32:31+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, { "name": "nesbot/carbon", "version": "2.72.1", @@ -2721,6 +2851,117 @@ ], "time": "2023-02-08T01:06:31+00:00" }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.2", @@ -2797,182 +3038,501 @@ "time": "2023-11-12T21:59:55+00:00" }, { - "name": "psr/clock", - "version": "1.0.0", + "name": "phpunit/php-code-coverage", + "version": "10.1.11", "source": { "type": "git", - "url": "https://github.com/php-fig/clock.git", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145", "shasum": "" }, "require": { - "php": "^7.0 || ^8.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", - "autoload": { - "psr-4": { - "Psr\\Clock\\": "src/" + "extra": { + "branch-alias": { + "dev-main": "10.1-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for reading the clock.", - "homepage": "https://github.com/php-fig/clock", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "clock", - "now", - "psr", - "psr-20", - "time" + "coverage", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/php-fig/clock/issues", - "source": "https://github.com/php-fig/clock/tree/1.0.0" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" }, - "time": "2022-11-25T14:36:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T15:38:30+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "phpunit/php-file-iterator", + "version": "4.1.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "4.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "filesystem", + "iterator" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, - "time": "2021-11-05T16:47:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "phpunit/php-invoker", + "version": "4.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "4.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.5.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6fce887c71076a73f32fd3e0774a6833fc5c7f19", + "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.5", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.3" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2023-12-13T07:25:23+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Standard interfaces for event handling.", + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", "keywords": [ - "events", + "clock", + "now", "psr", - "psr-14" + "psr-20", + "time" ], "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" }, - "time": "2019-01-08T18:20:26+00:00" + "time": "2022-11-25T14:36:26+00:00" }, { - "name": "psr/log", - "version": "3.0.0", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2985,329 +3545,1347 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "log", - "psr", - "psr-3" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "psr/simple-cache", - "version": "3.0.0", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\SimpleCache\\": "src/" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "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": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.11.22", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^4.0 || ^3.1", + "php": "^8.0 || ^7.0.8", + "symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-0.11": "0.11.x-dev" + }, + "bamarni-bin": { + "bin-links": false, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" + }, + "time": "2023-10-14T21:56:36+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.5", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "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-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", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.5" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2023-11-08T05:53:05+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:15+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-14T13:18:12+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T10:55:06+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-04-11T05:39:26+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-09-24T13:22:09+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-07-19T07:19:23+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, - "time": "2021-10-29T13:26:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" }, { - "name": "psy/psysh", - "version": "v0.11.22", + "name": "sebastian/recursion-context", + "version": "5.0.0", "source": { "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "ext-json": "*", - "ext-tokenizer": "*", - "nikic/php-parser": "^4.0 || ^3.1", - "php": "^8.0 || ^7.0.8", - "symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4", - "symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4" - }, - "conflict": { - "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + "php": ">=8.1" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." + "phpunit/phpunit": "^10.0" }, - "bin": [ - "bin/psysh" - ], "type": "library", "extra": { "branch-alias": { - "dev-0.11": "0.11.x-dev" - }, - "bamarni-bin": { - "bin-links": false, - "forward-command": false + "dev-main": "5.0-dev" } }, "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Psy\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, - "time": "2023-10-14T21:56:36+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:05:40+00:00" }, { - "name": "ramsey/collection", - "version": "2.0.0", + "name": "sebastian/type", + "version": "4.0.0", "source": { "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": "^8.1" + "php": ">=8.1" }, "require-dev": { - "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", - "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { - "captainhook": { - "force-install": true - }, - "ramsey/conventional-commits": { - "configFile": "conventional-commits.json" + "branch-alias": { + "dev-main": "4.0-dev" } }, "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/2.0.0" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { - "url": "https://github.com/ramsey", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" } ], - "time": "2022-12-31T21:50:55+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { - "name": "ramsey/uuid", - "version": "4.7.5", + "name": "sebastian/version", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", - "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", - "ext-json": "*", - "php": "^8.0", - "ramsey/collection": "^1.2 || ^2.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "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-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", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + "php": ">=8.1" }, "type": "library", "extra": { - "captainhook": { - "force-install": true + "branch-alias": { + "dev-main": "4.0-dev" } }, "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "guid", - "identifier", - "uuid" + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.5" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { - "url": "https://github.com/ramsey", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" } ], - "time": "2023-11-08T05:53:05+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "symfony/console", @@ -5499,6 +7077,56 @@ ], "time": "2023-11-09T08:28:32+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2023-11-20T00:12:19+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.2.7", diff --git a/php/phpunit.xml b/php/phpunit.xml new file mode 100644 index 0000000..d37a64a --- /dev/null +++ b/php/phpunit.xml @@ -0,0 +1,18 @@ + + + + + + ./src + + + + + + + ./src + + + \ No newline at end of file diff --git a/php/src/Contracts/IResponseObject.php b/php/src/Contracts/IResponseObject.php new file mode 100644 index 0000000..a493c88 --- /dev/null +++ b/php/src/Contracts/IResponseObject.php @@ -0,0 +1,25 @@ + $content - */ - protected function __construct(protected array $content) - { - } - - /** - * Transforma o conteúdo em _array_. - * - * @return array - */ - public function toArray(): array - { - return isset($this->content) ? $this->content : []; - } -} diff --git a/php/src/Entities/@shared/DTO/Error/Error.php b/php/src/Entities/@shared/DTO/Error/Error.php index fdd9eb5..2659062 100644 --- a/php/src/Entities/@shared/DTO/Error/Error.php +++ b/php/src/Entities/@shared/DTO/Error/Error.php @@ -2,10 +2,12 @@ namespace AleBatistella\BlingErpApi\Entities\Shared\DTO\Error; +use AleBatistella\BlingErpApi\Contracts\IResponseObject; + /** * Objeto de erro da requisição. */ -class Error +readonly final class Error implements IResponseObject { /** * Constrói o objeto. @@ -15,11 +17,43 @@ class Error * @param string $description * @param ?ErrorField[] $fields */ - public function __construct( + private function __construct( public string $type, public string $message, public string $description, public ?array $fields = [] ) { } + + /** + * @inheritDoc + */ + public static function from(array $attributes): static + { + return new self( + type: $attributes['type'], + message: $attributes['message'], + description: $attributes['description'], + fields: array_key_exists('fields', $attributes) ? array_map( + fn(array $item): ErrorField => ErrorField::from($item), + $attributes['fields'] + ) : null, + ); + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return [ + 'type' => $this->type, + 'message' => $this->message, + 'description' => $this->description, + 'fields' => array_map( + static fn(ErrorField $response): array => $response->toArray(), + $this->fields + ), + ]; + } } diff --git a/php/src/Entities/@shared/DTO/Error/ErrorField.php b/php/src/Entities/@shared/DTO/Error/ErrorField.php index c5c02ef..7e5638f 100644 --- a/php/src/Entities/@shared/DTO/Error/ErrorField.php +++ b/php/src/Entities/@shared/DTO/Error/ErrorField.php @@ -2,10 +2,12 @@ namespace AleBatistella\BlingErpApi\Entities\Shared\DTO\Error; +use AleBatistella\BlingErpApi\Contracts\IResponseObject; + /** * Objeto de erro para um campo da requisição. */ -class ErrorField +readonly final class ErrorField implements IResponseObject { /** * Constrói o objeto. @@ -16,7 +18,7 @@ class ErrorField * @param ?string $namespace * @param ?ErrorFieldCollection[] $collection */ - public function __construct( + private function __construct( public int $code, public string $msg, public ?string $element = null, @@ -24,4 +26,38 @@ public function __construct( public ?array $collection = [] ) { } + + /** + * @inheritDoc + */ + public static function from(array $attributes): static + { + return new self( + code: $attributes['code'], + msg: $attributes['msg'], + element: $attributes['element'], + namespace: $attributes['namespace'], + collection: array_key_exists('collection', $attributes) ? array_map( + fn(array $item): ErrorFieldCollection => ErrorFieldCollection::from($item), + $attributes['collection'] + ) : null, + ); + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return [ + 'code' => $this->code, + 'msg' => $this->msg, + 'element' => $this->element, + 'namespace' => $this->namespace, + 'collection' => array_map( + static fn(ErrorFieldCollection $response): array => $response->toArray(), + $this->collection + ), + ]; + } } diff --git a/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php b/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php index c20a3f1..59bb99c 100644 --- a/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php +++ b/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php @@ -2,10 +2,12 @@ namespace AleBatistella\BlingErpApi\Entities\Shared\DTO\Error; +use AleBatistella\BlingErpApi\Contracts\IResponseObject; + /** * Item da coleção de erros para um campo da requisição. */ -class ErrorFieldCollection +readonly final class ErrorFieldCollection implements IResponseObject { /** * Constrói o objeto. @@ -16,7 +18,7 @@ class ErrorFieldCollection * @param ?string $element * @param ?string $namespace */ - public function __construct( + private function __construct( public int $index, public int $code, public string $msg, @@ -24,4 +26,32 @@ public function __construct( public ?string $namespace = null, ) { } + + /** + * @inheritDoc + */ + public static function from(array $attributes): static + { + return new self( + index: $attributes['index'], + code: $attributes['code'], + msg: $attributes['msg'], + element: $attributes['element'], + namespace: $attributes['namespace'], + ); + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return [ + 'index' => $this->index, + 'code' => $this->code, + 'msg' => $this->msg, + 'element' => $this->element, + 'namespace' => $this->namespace, + ]; + } } diff --git a/php/src/Entities/@shared/DTO/Error/ErrorResponse.php b/php/src/Entities/@shared/DTO/Error/ErrorResponse.php index 3fbc551..515ad87 100644 --- a/php/src/Entities/@shared/DTO/Error/ErrorResponse.php +++ b/php/src/Entities/@shared/DTO/Error/ErrorResponse.php @@ -2,17 +2,48 @@ namespace AleBatistella\BlingErpApi\Entities\Shared\DTO\Error; +use AleBatistella\BlingErpApi\Contracts\IResponseRootObject; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\ResponseOptions; + /** * Objeto representativo da resposta da requisição com erro. */ -class ErrorResponse +readonly final class ErrorResponse implements IResponseRootObject { /** * Constrói o objeto. * * @param Error $error */ - public function __construct(public Error $error) + private function __construct(public Error $error) + { + } + + /** + * @inheritDoc + */ + public static function fromResponse(ResponseOptions $response): static + { + return self::from($response->body->content); + } + + /** + * @inheritDoc + */ + public static function from(array $attributes): static + { + return new self( + error: Error::from($attributes['error']) + ); + } + + /** + * @inheritDoc + */ + public function toArray(): array { + return [ + 'error' => $this->error->toArray(), + ]; } } diff --git a/php/src/Entities/@shared/DTO/Error/ErrorResponseTest.spec.php b/php/src/Entities/@shared/DTO/Error/ErrorResponseTest.spec.php new file mode 100644 index 0000000..c48f853 --- /dev/null +++ b/php/src/Entities/@shared/DTO/Error/ErrorResponseTest.spec.php @@ -0,0 +1,136 @@ +assertInstanceOf($expected, $actual); + } + + /** + * Testa a instanciação a partir de um `ResponseOptions`. + * + * @return void + */ + public function testShouldInstantiateFromResponseOptions(): void + { + $rawResponse = '{ + "error": { + "type": "VALIDATION_ERROR", + "message": "Não foi possível salvar a venda", + "description": "A venda não pode ser salva, pois ocorreram problemas em sua validação.", + "fields": [ + { + "code": 49, + "msg": "Uma ou mais parcelas da venda possuem erros de validação", + "element": "parcelas", + "namespace": "VENDAS", + "collection": [ + { + "index": 1, + "code": 12, + "msg": "Id da forma de pagamento inválido.", + "element": "formaPagamento", + "namespace": "VENDAS" + } + ] + } + ] + } + }'; + $rawResponseArray = json_decode($rawResponse, true); + $response = new class (endpoint: fake()->word(), + method: fake()->word(), + status: 200, + body: new class ($rawResponseArray) extends Body { }, + ) extends ResponseOptions { + }; + $expected = ErrorResponse::class; + + $actual = ErrorResponse::fromResponse($response); + + $this->assertInstanceOf($expected, $actual); + } + + /** + * Testa a formatação em _array_. + * + * @return void + */ + public function testShouldConvertToArray(): void + { + $rawExpected = '{ + "error": { + "type": "VALIDATION_ERROR", + "message": "Não foi possível salvar a venda", + "description": "A venda não pode ser salva, pois ocorreram problemas em sua validação.", + "fields": [ + { + "code": 49, + "msg": "Uma ou mais parcelas da venda possuem erros de validação", + "element": "parcelas", + "namespace": "VENDAS", + "collection": [ + { + "index": 1, + "code": 12, + "msg": "Id da forma de pagamento inválido.", + "element": "formaPagamento", + "namespace": "VENDAS" + } + ] + } + ] + } + }'; + $expected = json_decode($rawExpected, true); + + $actual = ErrorResponse::from($expected); + + $this->assertEquals($expected, $actual->toArray()); + } +} diff --git a/php/src/Entities/@shared/DTO/Headers.php b/php/src/Entities/@shared/DTO/Headers.php deleted file mode 100644 index bf63d38..0000000 --- a/php/src/Entities/@shared/DTO/Headers.php +++ /dev/null @@ -1,28 +0,0 @@ - $content - */ - protected function __construct(protected array $content) - { - } - - /** - * Transforma o conteúdo em _array_. - * - * @return array - */ - public function toArray(): array - { - return isset($this->content) ? $this->content : []; - } -} diff --git a/php/src/Entities/@shared/DTO/QueryParams.php b/php/src/Entities/@shared/DTO/QueryParams.php deleted file mode 100644 index 2c2d4d2..0000000 --- a/php/src/Entities/@shared/DTO/QueryParams.php +++ /dev/null @@ -1,28 +0,0 @@ - $content - */ - protected function __construct(protected array $content) - { - } - - /** - * Transforma o conteúdo em _array_. - * - * @return array - */ - public function toArray(): array - { - return isset($this->content) ? $this->content : []; - } -} diff --git a/php/src/Entities/@shared/DTO/Request/Body.php b/php/src/Entities/@shared/DTO/Request/Body.php new file mode 100644 index 0000000..c99f4b0 --- /dev/null +++ b/php/src/Entities/@shared/DTO/Request/Body.php @@ -0,0 +1,20 @@ + $content + * + * @return self + */ + public function __construct(public readonly array $content) + { + } +} diff --git a/php/src/Entities/@shared/DTO/Request/Headers.php b/php/src/Entities/@shared/DTO/Request/Headers.php new file mode 100644 index 0000000..a2c5a60 --- /dev/null +++ b/php/src/Entities/@shared/DTO/Request/Headers.php @@ -0,0 +1,18 @@ + $content + */ + public function __construct(public array $content) + { + } +} diff --git a/php/src/Entities/@shared/DTO/Request/QueryParams.php b/php/src/Entities/@shared/DTO/Request/QueryParams.php new file mode 100644 index 0000000..be75569 --- /dev/null +++ b/php/src/Entities/@shared/DTO/Request/QueryParams.php @@ -0,0 +1,18 @@ + $content + */ + public function __construct(public array $content) + { + } +} diff --git a/php/src/Entities/@shared/DTO/RequestOptions.php b/php/src/Entities/@shared/DTO/Request/RequestOptions.php similarity index 86% rename from php/src/Entities/@shared/DTO/RequestOptions.php rename to php/src/Entities/@shared/DTO/Request/RequestOptions.php index 5b839f6..4d4d15e 100644 --- a/php/src/Entities/@shared/DTO/RequestOptions.php +++ b/php/src/Entities/@shared/DTO/Request/RequestOptions.php @@ -1,6 +1,6 @@ = 400) { + try { + $errorResponse = ErrorResponse::fromResponse($this); + throw new BlingApiException(rawResponse: $errorResponse, status: $status); + } catch (\TypeError $e) { + throw new BlingInternalException( + message: "Não foi possível realizar a chamada HTTP: $method $endpoint", + code: $status, + previous: $e + ); + } + } + } +} diff --git a/php/src/Entities/@shared/DTO/Request/ResponseOptionsTest.spec.php b/php/src/Entities/@shared/DTO/Request/ResponseOptionsTest.spec.php new file mode 100644 index 0000000..dca3667 --- /dev/null +++ b/php/src/Entities/@shared/DTO/Request/ResponseOptionsTest.spec.php @@ -0,0 +1,98 @@ +word(), + method: fake()->word(), + status: 200 + ) extends ResponseOptions { + }; + + $this->assertInstanceOf($expected, $actual); + } + + /** + * Testa o lançamento de erro para requisição mal-sucedida e corpo esperado. + * + * @return void + */ + public function testShouldInstantiateWithErrorAndExpectedBody(): void + { + $this->expectException(BlingApiException::class); + $this->expectExceptionMessage("A venda não pode ser salva, pois ocorreram problemas em sua validação."); + $rawResponse = '{ + "error": { + "type": "VALIDATION_ERROR", + "message": "Não foi possível salvar a venda", + "description": "A venda não pode ser salva, pois ocorreram problemas em sua validação.", + "fields": [ + { + "code": 49, + "msg": "Uma ou mais parcelas da venda possuem erros de validação", + "element": "parcelas", + "namespace": "VENDAS", + "collection": [ + { + "index": 1, + "code": 12, + "msg": "Id da forma de pagamento inválido.", + "element": "formaPagamento", + "namespace": "VENDAS" + } + ] + } + ] + } + }'; + $rawResponseArray = json_decode($rawResponse, true); + + new class (endpoint: fake()->word(), + method: fake()->word(), + status: 400, + body: new class ($rawResponseArray) extends Body { } + ) extends ResponseOptions { + }; + } + + /** + * Testa o lançamento de erro para requisição mal-sucedida e corpo inesperado. + * + * @return void + */ + public function testShouldInstantiateWithErrorAndNotExpectedBody(): void + { + $endpoint = fake()->word(); + $method = fake()->word(); + $this->expectException(BlingInternalException::class); + $this->expectExceptionMessage("Não foi possível realizar a chamada HTTP: $method $endpoint"); + + new class (endpoint: $endpoint, + method: $method, + status: 400, + body: new class (['teste' => '123']) extends Body { } + ) extends ResponseOptions { + }; + } +} diff --git a/php/src/Entities/@shared/DTO/ResponseOptions.php b/php/src/Entities/@shared/DTO/ResponseOptions.php deleted file mode 100644 index 212b45c..0000000 --- a/php/src/Entities/@shared/DTO/ResponseOptions.php +++ /dev/null @@ -1,22 +0,0 @@ - $this->id, + ]; + } +} diff --git a/php/src/Entities/@shared/TestResponseTrait.php b/php/src/Entities/@shared/TestResponseTrait.php new file mode 100644 index 0000000..4438b81 --- /dev/null +++ b/php/src/Entities/@shared/TestResponseTrait.php @@ -0,0 +1,39 @@ +word(), + method: $method ?? fake()->word(), + status: $status ?? fake()->numberBetween(200, 500), + headers: $headers, + body: $body, + ) extends ResponseOptions { + }; + } +} diff --git a/php/src/Entities/Borderos/Borderos.php b/php/src/Entities/Borderos/Borderos.php index 1efd365..d8333b4 100644 --- a/php/src/Entities/Borderos/Borderos.php +++ b/php/src/Entities/Borderos/Borderos.php @@ -2,8 +2,11 @@ namespace AleBatistella\BlingErpApi\Entities\Borderos; +use AleBatistella\BlingErpApi\Entities\Borderos\Schema\Find\FindResponse; use AleBatistella\BlingErpApi\Entities\Shared\BaseEntity; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\RequestOptions; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\RequestOptions; +use AleBatistella\BlingErpApi\Exceptions\BlingApiException; +use AleBatistella\BlingErpApi\Exceptions\BlingInternalException; /** * Entidade para interação com borderôs. @@ -18,15 +21,17 @@ class Borderos extends BaseEntity * @param int $idBordero ID para deleção. * * @return null Não há retorno. - * @throws {BlingApiException|BlingInternalException} + * @throws BlingApiException|BlingInternalException * * @see https://developer.bling.com.br/referencia#/Border%C3%B4s/delete_borderos__idBordero_ */ public function delete(int $idBordero): null { - return $this->repository->destroy(new RequestOptions( + $response = $this->repository->destroy(new RequestOptions( endpoint: "borderos/$idBordero" )); + + return $response->body; } /** @@ -34,15 +39,17 @@ public function delete(int $idBordero): null * * @param params Parâmetros para a busca (somente o ID). * - * @return {Promise} Os dados do borderô pesquisado. - * @throws {BlingApiException|BlingInternalException} + * @return FindResponse Os dados do borderô pesquisado. + * @throws BlingApiException|BlingInternalException * * @see https://developer.bling.com.br/referencia#/Border%C3%B4s/get_borderos__idBordero_ */ - public function find(int $idBordero) + public function find(int $idBordero): FindResponse { - return $this->repository->show(new RequestOptions( + $response = $this->repository->show(new RequestOptions( endpoint: "borderos/$idBordero" )); + + return FindResponse::fromResponse($response); } } diff --git a/php/src/Entities/Borderos/BorderosTest.spec.php b/php/src/Entities/Borderos/BorderosTest.spec.php new file mode 100644 index 0000000..45c626d --- /dev/null +++ b/php/src/Entities/Borderos/BorderosTest.spec.php @@ -0,0 +1,51 @@ +randomNumber(); + $repository = $this->getMockBuilder(IBlingRepository::class)->getMock(); + $repository->expects($this->once()) + ->method('destroy') + ->with($this->callback(fn(RequestOptions $requestOptions) => + $requestOptions->endpoint === "borderos/$idBordero" + )) + ->willReturn($this->buildResponse(status: 200, body: null)); + $repository = $this->createMock(IBlingRepository::class); + + $response = $this->getInstance($repository)->delete($idBordero); + + $this->assertNull($response); + } +} diff --git a/php/src/Entities/Borderos/Schema/BorderoFindSuccessResponseBody.php b/php/src/Entities/Borderos/Schema/BorderoFindSuccessResponseBody.php deleted file mode 100644 index ed179cb..0000000 --- a/php/src/Entities/Borderos/Schema/BorderoFindSuccessResponseBody.php +++ /dev/null @@ -1,13 +0,0 @@ -body->content); + } + + /** + * @inheritDoc + */ + public static function from(array $attributes): static + { + return new self( + data: FindResponseData::from($attributes) + ); + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return [ + 'data' => $this->data->toArray(), + ]; + } +} diff --git a/php/src/Entities/Borderos/Schema/Find/FindResponseData.php b/php/src/Entities/Borderos/Schema/Find/FindResponseData.php new file mode 100644 index 0000000..5dee921 --- /dev/null +++ b/php/src/Entities/Borderos/Schema/Find/FindResponseData.php @@ -0,0 +1,65 @@ + $this->id, + 'data' => $this->data, + 'historico' => $this->historico, + 'portador' => $this->portador, + 'categoria' => $this->categoria, + 'pagamentos' => array_map( + static fn(FindResponseDataPagamentos $response): array => $response->toArray(), + $this->pagamentos + ), + ]; + } +} diff --git a/php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php b/php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php new file mode 100644 index 0000000..29401fa --- /dev/null +++ b/php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php @@ -0,0 +1,66 @@ + $this->contato->toArray(), + 'numeroDocumento' => $this->numeroDocumento, + 'valorPago' => $this->valorPago, + 'juros' => $this->juros, + 'desconto' => $this->desconto, + 'acrescimo' => $this->acrescimo, + 'tarifa' => $this->tarifa, + ]; + } +} diff --git a/php/src/Exceptions/BlingApiException.php b/php/src/Exceptions/BlingApiException.php index c6c5645..8d601d7 100644 --- a/php/src/Exceptions/BlingApiException.php +++ b/php/src/Exceptions/BlingApiException.php @@ -9,19 +9,17 @@ */ class BlingApiException extends \Exception { - /** @property-read ErrorResponse $rawResponse A resposta da requisição. */ - private readonly ErrorResponse $rawResponse; - /** * Constrói o objeto. * * @param ErrorResponse $rawResponse A resposta crua da requisição. + * @param int $status O _status_ HTTP da resposta. */ - public function __construct(ErrorResponse $rawResponse) - { - $this->rawResponse = $rawResponse; - - parent::__construct($rawResponse->error->description); + public function __construct( + private ErrorResponse $rawResponse, + private int $status + ) { + parent::__construct($rawResponse->error->description, $status); } /** @@ -31,4 +29,14 @@ public function getResponse(): ErrorResponse { return $this->rawResponse; } + + /** + * Obtém o _status_ HTTP. + * + * @return int + */ + public function getHttpStatus(): int + { + return $this->status; + } } diff --git a/php/src/Helpers/functions.php b/php/src/Helpers/functions.php index ee582e9..cc16b4b 100644 --- a/php/src/Helpers/functions.php +++ b/php/src/Helpers/functions.php @@ -13,3 +13,15 @@ function convertDateToString(\DateTimeInterface $date): string return $date->format('Y-m-d'); } } + +if (!function_exists('fake')) { + /** + * Cria objeto para dados _fake_. + * + * @return \Faker\Generator + */ + function fake(): \Faker\Generator + { + return \Faker\Factory::create(); + } +} diff --git a/php/src/Repositories/BlingRepository.php b/php/src/Repositories/BlingRepository.php index bd6a37c..08f9d31 100644 --- a/php/src/Repositories/BlingRepository.php +++ b/php/src/Repositories/BlingRepository.php @@ -2,10 +2,10 @@ namespace AleBatistella\BlingErpApi\Repositories; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\Body; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\Headers; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\RequestOptions; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\ResponseOptions; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\Body; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\Headers; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\RequestOptions; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\ResponseOptions; use GuzzleHttp\Client; /** @@ -42,11 +42,12 @@ public function index(RequestOptions $options): ResponseOptions 'headers' => $options->headers?->content, ]); - $rawResponseBody = $response->getBody()->getContents(); - return new ResponseOptions( - body: new Body(json_decode($rawResponseBody, true)), - headers: new Headers($response->getHeaders()) + endpoint: $options->endpoint, + method: 'GET', + status: $response->getStatusCode(), + headers: new Headers($response->getHeaders()), + body: $this->buildResponseBody($response->getBody()->getContents()), ); } @@ -69,11 +70,12 @@ public function store(RequestOptions $options): ResponseOptions 'headers' => $options->headers?->content, ]); - $rawResponseBody = $response->getBody()->getContents(); - return new ResponseOptions( - body: new Body(json_decode($rawResponseBody, true)), - headers: new Headers($response->getHeaders()) + endpoint: $options->endpoint, + method: 'POST', + status: $response->getStatusCode(), + headers: new Headers($response->getHeaders()), + body: $this->buildResponseBody($response->getBody()->getContents()), ); } @@ -88,11 +90,12 @@ public function update(RequestOptions $options): ResponseOptions 'headers' => $options->headers?->content, ]); - $rawResponseBody = $response->getBody()->getContents(); - return new ResponseOptions( - body: new Body(json_decode($rawResponseBody, true)), - headers: new Headers($response->getHeaders()) + endpoint: $options->endpoint, + method: 'PATCH', + status: $response->getStatusCode(), + headers: new Headers($response->getHeaders()), + body: $this->buildResponseBody($response->getBody()->getContents()), ); } @@ -107,11 +110,12 @@ public function replace(RequestOptions $options): ResponseOptions 'headers' => $options->headers?->content, ]); - $rawResponseBody = $response->getBody()->getContents(); - return new ResponseOptions( - body: new Body(json_decode($rawResponseBody, true)), - headers: new Headers($response->getHeaders()) + endpoint: $options->endpoint, + method: 'PUT', + status: $response->getStatusCode(), + headers: new Headers($response->getHeaders()), + body: $this->buildResponseBody($response->getBody()->getContents()), ); } @@ -126,11 +130,31 @@ public function destroy(RequestOptions $options): ResponseOptions 'headers' => $options->headers?->content, ]); - $rawResponseBody = $response->getBody()->getContents(); - return new ResponseOptions( - body: new Body(json_decode($rawResponseBody, true)), - headers: new Headers($response->getHeaders()) + endpoint: $options->endpoint, + method: 'DELETE', + status: $response->getStatusCode(), + headers: new Headers($response->getHeaders()), + body: $this->buildResponseBody($response->getBody()->getContents()), ); } + + /** + * Monta o corpo da resposta. + * + * @param mixed $contents + * + * @return ?Body + */ + private function buildResponseBody(mixed $contents): ?Body + { + $body = null; + + if (!is_null($contents)) { + $arrResponseBody = json_decode($contents, true); + $body = is_array($arrResponseBody) ? new Body(json_decode($contents, true)) : null; + } + + return $body; + } } diff --git a/php/src/Repositories/IBlingRepository.php b/php/src/Repositories/IBlingRepository.php index 98557cc..d950ce5 100644 --- a/php/src/Repositories/IBlingRepository.php +++ b/php/src/Repositories/IBlingRepository.php @@ -2,8 +2,8 @@ namespace AleBatistella\BlingErpApi\Repositories; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\RequestOptions; -use AleBatistella\BlingErpApi\Entities\Shared\DTO\ResponseOptions; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\RequestOptions; +use AleBatistella\BlingErpApi\Entities\Shared\DTO\Request\ResponseOptions; interface IBlingRepository {