From f9a99b146e3bbfcdad5c3be63bb8cf14b46410a6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 09:44:42 +1000 Subject: [PATCH 01/22] Working on L10 upgrades --- composer.json | 25 +- composer.lock | 1758 +++++++++++++++---------------------------------- 2 files changed, 541 insertions(+), 1242 deletions(-) diff --git a/composer.json b/composer.json index d9bb6348f79c..8be79d304d86 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "bacon/bacon-qr-code": "^2.0", "beganovich/snappdf": "^3", "braintree/braintree_php": "^6.0", - "checkout/checkout-sdk-php": "^2.5", + "checkout/checkout-sdk-php": "^3.0", "cleverit/ubl_invoice": "^1.3", "doctrine/dbal": "^3.0", "eway/eway-rapid-php": "^1.3", @@ -52,18 +52,18 @@ "guzzlehttp/guzzle": "^7.2", "halaxa/json-machine": "^0.7.0", "hashids/hashids": "^4.0", - "hedii/laravel-gelf-logger": "^7.0", + "hedii/laravel-gelf-logger": "^8", "horstoeko/zugferd": "^1", "imdhemy/laravel-purchases": "^1.7", "intervention/image": "^2.5", - "invoiceninja/inspector": "^1.0", + "invoiceninja/inspector": "^2.0", "josemmo/facturae-php": "^1.7", "laracasts/presenter": "^0.2.1", - "laravel/framework": "^9.3", + "laravel/framework": "^10", "laravel/slack-notification-channel": "^2.2", "laravel/socialite": "^5", "laravel/tinker": "^2.7", - "laravel/ui": "^3.0", + "laravel/ui": "^4.0", "league/csv": "^9.6", "league/flysystem-aws-s3-v3": "^3.0", "league/fractal": "^0.17.0", @@ -91,8 +91,8 @@ "symfony/http-client": "^6.0", "symfony/mailgun-mailer": "^6.1", "symfony/postmark-mailer": "^6.1", - "turbo124/beacon": "^1.4", - "turbo124/predis": "1.1.11", + "turbo124/beacon": "^1.5", + "predis/predis": "^2", "twilio/sdk": "^6.40", "webpatser/laravel-countries": "dev-master#75992ad", "wepay/php-sdk": "^0.3", @@ -102,19 +102,18 @@ "php": "^8.1", "barryvdh/laravel-debugbar": "^3.6", "barryvdh/laravel-ide-helper": "^2.13", - "brianium/paratest": "^6.1", + "brianium/paratest": "^7", "fakerphp/faker": "^1.14", "filp/whoops": "^2.7", "friendsofphp/php-cs-fixer": "^3.14", "laracasts/cypress": "^3.0", "mockery/mockery": "^1.4.4", - "nunomaduro/collision": "^6.1", + "nunomaduro/collision": "^7.0", "nunomaduro/larastan": "^2.0", "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ignition": "^1.0", - "spaze/phpstan-stripe": "^3.0", - "vimeo/psalm": "^4.24" + "phpunit/phpunit": "^10.0", + "spatie/laravel-ignition": "^2.0", + "spaze/phpstan-stripe": "^3.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 31584f8b7590..680c4948ec2b 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": "673ca66ddfdb05c3ea29012594a196d3", + "content-hash": "c54361d62a99c6382de6477fdc56cd7e", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -830,23 +830,23 @@ }, { "name": "checkout/checkout-sdk-php", - "version": "2.5.4", + "version": "3.0.13", "source": { "type": "git", "url": "https://github.com/checkout/checkout-sdk-php.git", - "reference": "5210b664536db8637f09c1e63484c0a47769b8b5" + "reference": "09f50d3df10f99681b535b53c395d2ee1ddab22b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/checkout/checkout-sdk-php/zipball/5210b664536db8637f09c1e63484c0a47769b8b5", - "reference": "5210b664536db8637f09c1e63484c0a47769b8b5", + "url": "https://api.github.com/repos/checkout/checkout-sdk-php/zipball/09f50d3df10f99681b535b53c395d2ee1ddab22b", + "reference": "09f50d3df10f99681b535b53c395d2ee1ddab22b", "shasum": "" }, "require": { "ext-fileinfo": "*", "ext-json": "*", "guzzlehttp/guzzle": "^6.5 || ^7.4", - "monolog/monolog": "^1.27 || ^2.4", + "monolog/monolog": "^1.27 || ^2.4 || ^3.0.0", "php": ">=5.6.0" }, "require-dev": { @@ -892,9 +892,9 @@ ], "support": { "issues": "https://github.com/checkout/checkout-sdk-php/issues", - "source": "https://github.com/checkout/checkout-sdk-php/tree/2.5.4" + "source": "https://github.com/checkout/checkout-sdk-php/tree/3.0.13" }, - "time": "2022-08-04T22:24:42+00:00" + "time": "2023-06-09T09:09:30+00:00" }, { "name": "cleverit/ubl_invoice", @@ -2750,36 +2750,31 @@ }, { "name": "graylog2/gelf-php", - "version": "1.7.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/bzikarsky/gelf-php.git", - "reference": "8dceab86227c184725479cc36ab5cae4da940f6e" + "reference": "29ef48fa6eac6c8787b588949483f1739c57ad4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bzikarsky/gelf-php/zipball/8dceab86227c184725479cc36ab5cae4da940f6e", - "reference": "8dceab86227c184725479cc36ab5cae4da940f6e", + "url": "https://api.github.com/repos/bzikarsky/gelf-php/zipball/29ef48fa6eac6c8787b588949483f1739c57ad4f", + "reference": "29ef48fa6eac6c8787b588949483f1739c57ad4f", "shasum": "" }, "require": { - "paragonie/constant_time_encoding": "^1|^2", - "php": ">=5.6", - "psr/log": "^1.0|^2.0" + "php": ">=8.0", + "psr/log": "^1|^2|^3" }, "provide": { - "psr/log-implementation": "~1.0" + "psr/log-implementation": "3.0.0" }, "require-dev": { - "phpunit/phpunit": "^5.7|^6.5|^7.5", - "squizlabs/php_codesniffer": "^3.3" + "phpunit/phpunit": "^9.6|^10.1", + "squizlabs/php_codesniffer": "^3.6", + "vimeo/psalm": "^5.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { "psr-4": { "Gelf\\": "src/Gelf" @@ -2792,7 +2787,7 @@ "authors": [ { "name": "Benjamin Zikarsky", - "email": "benjamin@zikarsky.de" + "email": "benjamin@familie-zikarsky.de" }, { "name": "gelf-php contributors", @@ -2802,9 +2797,9 @@ "description": "A php implementation to send log-messages to a GELF compatible backend like Graylog2.", "support": { "issues": "https://github.com/bzikarsky/gelf-php/issues", - "source": "https://github.com/bzikarsky/gelf-php/tree/1.7.1" + "source": "https://github.com/bzikarsky/gelf-php/tree/2.0.1" }, - "time": "2021-08-20T09:39:08+00:00" + "time": "2023-05-23T14:45:24+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3339,25 +3334,25 @@ }, { "name": "hedii/laravel-gelf-logger", - "version": "7.1.0", + "version": "8.1.1", "source": { "type": "git", "url": "https://github.com/hedii/laravel-gelf-logger.git", - "reference": "0554b5980d4d1d17606375af9fb76e9eaa31f10d" + "reference": "90c80b7eb5bc3dcd5694770a4d5c44c7173b2194" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hedii/laravel-gelf-logger/zipball/0554b5980d4d1d17606375af9fb76e9eaa31f10d", - "reference": "0554b5980d4d1d17606375af9fb76e9eaa31f10d", + "url": "https://api.github.com/repos/hedii/laravel-gelf-logger/zipball/90c80b7eb5bc3dcd5694770a4d5c44c7173b2194", + "reference": "90c80b7eb5bc3dcd5694770a4d5c44c7173b2194", "shasum": "" }, "require": { - "graylog2/gelf-php": "^1.7", - "illuminate/log": "^9.0", - "php": "^8.0" + "graylog2/gelf-php": "^2.0", + "illuminate/log": "^10.0", + "php": "^8.1" }, "require-dev": { - "orchestra/testbench": "^7.0" + "orchestra/testbench": "^8.0" }, "type": "library", "autoload": { @@ -3392,7 +3387,7 @@ "issues": "https://github.com/hedii/laravel-gelf-logger/issues", "source": "https://github.com/hedii/laravel-gelf-logger" }, - "time": "2022-03-16T16:40:58+00:00" + "time": "2023-08-14T19:20:53+00:00" }, { "name": "horstoeko/stringmanagement", @@ -3846,22 +3841,22 @@ }, { "name": "invoiceninja/inspector", - "version": "v1.0", + "version": "v2.0", "source": { "type": "git", "url": "https://github.com/invoiceninja/inspector.git", - "reference": "307b0e4b90dd0ebf062f90ece4d46399202aa73e" + "reference": "2821b6d92e114af7a9bc636de9c077d946fb3bf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/invoiceninja/inspector/zipball/307b0e4b90dd0ebf062f90ece4d46399202aa73e", - "reference": "307b0e4b90dd0ebf062f90ece4d46399202aa73e", + "url": "https://api.github.com/repos/invoiceninja/inspector/zipball/2821b6d92e114af7a9bc636de9c077d946fb3bf6", + "reference": "2821b6d92e114af7a9bc636de9c077d946fb3bf6", "shasum": "" }, "require": { "doctrine/dbal": "^3.1", - "illuminate/support": "^8.0|^9.0", - "php": "^7.4|^8.0" + "illuminate/support": "^8.0|^9.0|^10.0", + "php": "^7.4|^8.1" }, "require-dev": { "orchestra/testbench": "^6.0", @@ -3902,9 +3897,9 @@ ], "support": { "issues": "https://github.com/invoiceninja/inspector/issues", - "source": "https://github.com/invoiceninja/inspector/tree/v1.0" + "source": "https://github.com/invoiceninja/inspector/tree/v2.0" }, - "time": "2022-06-22T11:16:55+00:00" + "time": "2023-08-20T23:21:28+00:00" }, { "name": "jean85/pretty-package-versions", @@ -4340,20 +4335,21 @@ }, { "name": "laravel/framework", - "version": "v9.52.15", + "version": "v10.19.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "e3350e87a52346af9cc655a3012d2175d2d05ad7" + "reference": "b8557e4a708a1bd2bc8229bd53feecfa2ac1c6fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/e3350e87a52346af9cc655a3012d2175d2d05ad7", - "reference": "e3350e87a52346af9cc655a3012d2175d2d05ad7", + "url": "https://api.github.com/repos/laravel/framework/zipball/b8557e4a708a1bd2bc8229bd53feecfa2ac1c6fb", + "reference": "b8557e4a708a1bd2bc8229bd53feecfa2ac1c6fb", "shasum": "" }, "require": { "brick/math": "^0.9.3|^0.10.2|^0.11", + "composer-runtime-api": "^2.2", "doctrine/inflector": "^2.0.5", "dragonmantank/cron-expression": "^3.3.2", "egulias/email-validator": "^3.2.1|^4.0", @@ -4366,28 +4362,29 @@ "ext-tokenizer": "*", "fruitcake/php-cors": "^1.2", "guzzlehttp/uri-template": "^1.0", - "laravel/serializable-closure": "^1.2.2", + "laravel/prompts": "^0.1", + "laravel/serializable-closure": "^1.3", "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", - "monolog/monolog": "^2.0", - "nesbot/carbon": "^2.62.1", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^2.67", "nunomaduro/termwind": "^1.13", - "php": "^8.0.2", + "php": "^8.1", "psr/container": "^1.1.1|^2.0.1", "psr/log": "^1.0|^2.0|^3.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "ramsey/uuid": "^4.7", - "symfony/console": "^6.0.9", - "symfony/error-handler": "^6.0", - "symfony/finder": "^6.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mailer": "^6.0", - "symfony/mime": "^6.0", - "symfony/process": "^6.0", - "symfony/routing": "^6.0", - "symfony/uid": "^6.0", - "symfony/var-dumper": "^6.0", + "symfony/console": "^6.2", + "symfony/error-handler": "^6.2", + "symfony/finder": "^6.2", + "symfony/http-foundation": "^6.2", + "symfony/http-kernel": "^6.2", + "symfony/mailer": "^6.2", + "symfony/mime": "^6.2", + "symfony/process": "^6.2", + "symfony/routing": "^6.2", + "symfony/uid": "^6.2", + "symfony/var-dumper": "^6.2", "tijsverkoyen/css-to-inline-styles": "^2.2.5", "vlucas/phpdotenv": "^5.4.1", "voku/portable-ascii": "^2.0" @@ -4423,6 +4420,7 @@ "illuminate/notifications": "self.version", "illuminate/pagination": "self.version", "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", "illuminate/queue": "self.version", "illuminate/redis": "self.version", "illuminate/routing": "self.version", @@ -4436,7 +4434,7 @@ "require-dev": { "ably/ably-php": "^1.0", "aws/aws-sdk-php": "^3.235.5", - "doctrine/dbal": "^2.13.3|^3.1.4", + "doctrine/dbal": "^3.5.1", "ext-gmp": "*", "fakerphp/faker": "^1.21", "guzzlehttp/guzzle": "^7.5", @@ -4446,20 +4444,19 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.24", + "orchestra/testbench-core": "^8.4", "pda/pheanstalk": "^4.0", - "phpstan/phpdoc-parser": "^1.15", "phpstan/phpstan": "^1.4.7", - "phpunit/phpunit": "^9.5.8", - "predis/predis": "^1.1.9|^2.0.2", - "symfony/cache": "^6.0", - "symfony/http-client": "^6.0" + "phpunit/phpunit": "^10.0.7", + "predis/predis": "^2.0.2", + "symfony/cache": "^6.2", + "symfony/http-client": "^6.2.4" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).", "brianium/paratest": "Required to run tests in parallel (^6.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1).", "ext-apcu": "Required to use the APC cache driver.", "ext-fileinfo": "Required to use the Filesystem class.", "ext-ftp": "Required to use the Flysystem FTP driver.", @@ -4481,21 +4478,21 @@ "mockery/mockery": "Required to use mocking (^1.5.1).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).", - "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2).", + "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8|^10.0.7).", + "predis/predis": "Required to use the predis connector (^2.0.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^6.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^6.2).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^6.2).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.2).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.2).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.2).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "10.x-dev" } }, "autoload": { @@ -4534,7 +4531,55 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-08-08T14:28:40+00:00" + "time": "2023-08-15T13:42:57+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.1.5", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "d880a909df144a4bf5760ebd09aba114f79d9adc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/d880a909df144a4bf5760ebd09aba114f79d9adc", + "reference": "d880a909df144a4bf5760ebd09aba114f79d9adc", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/collections": "^10.0|^11.0", + "php": "^8.1", + "symfony/console": "^6.2" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-mockery": "^1.1" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.1.5" + }, + "time": "2023-08-15T14:29:44+00:00" }, { "name": "laravel/serializable-closure", @@ -4797,32 +4842,33 @@ }, { "name": "laravel/ui", - "version": "v3.4.6", + "version": "v4.2.2", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "65ec5c03f7fee2c8ecae785795b829a15be48c2c" + "reference": "a58ec468db4a340b33f3426c778784717a2c144b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/65ec5c03f7fee2c8ecae785795b829a15be48c2c", - "reference": "65ec5c03f7fee2c8ecae785795b829a15be48c2c", + "url": "https://api.github.com/repos/laravel/ui/zipball/a58ec468db4a340b33f3426c778784717a2c144b", + "reference": "a58ec468db4a340b33f3426c778784717a2c144b", "shasum": "" }, "require": { - "illuminate/console": "^8.42|^9.0", - "illuminate/filesystem": "^8.42|^9.0", - "illuminate/support": "^8.82|^9.0", - "illuminate/validation": "^8.42|^9.0", - "php": "^7.3|^8.0" + "illuminate/console": "^9.21|^10.0", + "illuminate/filesystem": "^9.21|^10.0", + "illuminate/support": "^9.21|^10.0", + "illuminate/validation": "^9.21|^10.0", + "php": "^8.0" }, "require-dev": { - "orchestra/testbench": "^6.23|^7.0" + "orchestra/testbench": "^7.0|^8.0", + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "4.x-dev" }, "laravel": { "providers": [ @@ -4852,9 +4898,9 @@ "ui" ], "support": { - "source": "https://github.com/laravel/ui/tree/v3.4.6" + "source": "https://github.com/laravel/ui/tree/v4.2.2" }, - "time": "2022-05-20T13:38:08+00:00" + "time": "2023-05-09T19:47:28+00:00" }, { "name": "lcobucci/clock", @@ -6055,42 +6101,41 @@ }, { "name": "monolog/monolog", - "version": "2.9.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1" + "reference": "e2392369686d420ca32df3803de28b5d6f76867d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d", + "reference": "e2392369686d420ca32df3803de28b5d6f76867d", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "psr/log-implementation": "3.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "aws/aws-sdk-php": "^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", - "guzzlehttp/guzzle": "^7.4", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "^10.1", + "predis/predis": "^1.1 || ^2", "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -6113,7 +6158,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -6141,7 +6186,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.9.1" + "source": "https://github.com/Seldaek/monolog/tree/3.4.0" }, "funding": [ { @@ -6153,7 +6198,7 @@ "type": "tidelift" } ], - "time": "2023-02-06T13:44:46+00:00" + "time": "2023-06-21T08:46:11+00:00" }, { "name": "mtdowling/jmespath.php", @@ -8217,6 +8262,67 @@ }, "time": "2022-06-13T21:57:56+00:00" }, + { + "name": "predis/predis", + "version": "v2.2.1", + "source": { + "type": "git", + "url": "https://github.com/predis/predis.git", + "reference": "5f2b410a74afaff296a87a494e4c5488cf9fab57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/predis/predis/zipball/5f2b410a74afaff296a87a494e4c5488cf9fab57", + "reference": "5f2b410a74afaff296a87a494e4c5488cf9fab57", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.3", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^8.0 || ~9.4.4" + }, + "suggest": { + "ext-relay": "Faster connection with in-memory caching (>=0.6.2)" + }, + "type": "library", + "autoload": { + "psr-4": { + "Predis\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Till Krüss", + "homepage": "https://till.im", + "role": "Maintainer" + } + ], + "description": "A flexible and feature-complete Redis client for PHP.", + "homepage": "http://github.com/predis/predis", + "keywords": [ + "nosql", + "predis", + "redis" + ], + "support": { + "issues": "https://github.com/predis/predis/issues", + "source": "https://github.com/predis/predis/tree/v2.2.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tillkruss", + "type": "github" + } + ], + "time": "2023-08-15T23:01:46+00:00" + }, { "name": "psr/cache", "version": "3.0.0", @@ -8579,16 +8685,16 @@ }, { "name": "psr/log", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { @@ -8597,7 +8703,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { @@ -8623,9 +8729,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-07-14T16:41:46+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "psr/simple-cache", @@ -13722,21 +13828,21 @@ }, { "name": "turbo124/beacon", - "version": "v1.4.4", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/turbo124/beacon.git", - "reference": "b300e2d900b0affa8d95e697925e6053fdd884b0" + "reference": "ffc0a7b229129f6503fa699adaabc1d9f300e41c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/turbo124/beacon/zipball/b300e2d900b0affa8d95e697925e6053fdd884b0", - "reference": "b300e2d900b0affa8d95e697925e6053fdd884b0", + "url": "https://api.github.com/repos/turbo124/beacon/zipball/ffc0a7b229129f6503fa699adaabc1d9f300e41c", + "reference": "ffc0a7b229129f6503fa699adaabc1d9f300e41c", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^7", - "illuminate/support": "^9.0", + "illuminate/support": "^9.0|^10.0", "php": "^8" }, "require-dev": { @@ -13778,75 +13884,9 @@ "turbo124" ], "support": { - "source": "https://github.com/turbo124/beacon/tree/v1.4.4" + "source": "https://github.com/turbo124/beacon/tree/v1.5.0" }, - "time": "2023-03-07T08:03:27+00:00" - }, - { - "name": "turbo124/predis", - "version": "v1.1.11", - "source": { - "type": "git", - "url": "https://github.com/turbo124/predis.git", - "reference": "3ebce475e48ed0842dbe6f252ae55a4523b35116" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/turbo124/predis/zipball/3ebce475e48ed0842dbe6f252ae55a4523b35116", - "reference": "3ebce475e48ed0842dbe6f252ae55a4523b35116", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "suggest": { - "ext-curl": "Allows access to Webdis when paired with phpiredis", - "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" - }, - "type": "library", - "autoload": { - "psr-4": { - "Predis\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniele Alessandri", - "email": "suppakilla@gmail.com", - "homepage": "http://clorophilla.net", - "role": "Creator & Maintainer" - }, - { - "name": "Till Krüss", - "homepage": "https://till.im", - "role": "Maintainer" - } - ], - "description": "Flexible and feature-complete Redis client for PHP and HHVM", - "homepage": "http://github.com/predis/predis", - "keywords": [ - "nosql", - "predis", - "redis" - ], - "support": { - "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/turbo124/predis/tree/v1.1.11" - }, - "funding": [ - { - "url": "https://github.com/sponsors/tillkruss", - "type": "github" - } - ], - "time": "2022-10-28T04:36:19+00:00" + "time": "2023-08-20T23:18:11+00:00" }, { "name": "twilio/sdk", @@ -14233,172 +14273,6 @@ } ], "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": "barryvdh/laravel-debugbar", "version": "v3.8.2", @@ -14631,16 +14505,16 @@ }, { "name": "brianium/paratest", - "version": "v6.10.0", + "version": "v7.2.5", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "c2243b20bcd99c3f651018d1447144372f39b4fa" + "reference": "4d7ad5b6564f63baa1b948ecad05439f22880942" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/c2243b20bcd99c3f651018d1447144372f39b4fa", - "reference": "c2243b20bcd99c3f651018d1447144372f39b4fa", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/4d7ad5b6564f63baa1b948ecad05439f22880942", + "reference": "4d7ad5b6564f63baa1b948ecad05439f22880942", "shasum": "" }, "require": { @@ -14650,23 +14524,26 @@ "ext-simplexml": "*", "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "jean85/pretty-package-versions": "^2.0.5", - "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.25", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.6.4", - "sebastian/environment": "^5.1.5", - "symfony/console": "^5.4.21 || ^6.2.7", - "symfony/process": "^5.4.21 || ^6.2.7" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "phpunit/php-code-coverage": "^10.1.3", + "phpunit/php-file-iterator": "^4.0.2", + "phpunit/php-timer": "^6.0", + "phpunit/phpunit": "^10.3.1", + "sebastian/environment": "^6.0.1", + "symfony/console": "^6.3.2", + "symfony/process": "^6.3.2" }, "require-dev": { - "doctrine/coding-standard": "^10.0.0", + "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.19", + "infection/infection": "^0.27.0", + "phpstan/phpstan": "^1.10.26", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^5.4.21 || ^6.2.7", - "vimeo/psalm": "^5.7.7" + "symfony/filesystem": "^6.3.1" }, "bin": [ "bin/paratest", @@ -14707,7 +14584,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.10.0" + "source": "https://github.com/paratestphp/paratest/tree/v7.2.5" }, "funding": [ { @@ -14719,7 +14596,7 @@ "type": "paypal" } ], - "time": "2023-05-25T13:47:58+00:00" + "time": "2023-08-08T13:23:59+00:00" }, { "name": "composer/class-map-generator", @@ -14794,79 +14671,6 @@ ], "time": "2023-06-30T13:58:57+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", @@ -15085,144 +14889,6 @@ ], "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": "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": "fidry/cpu-core-counter", "version": "0.5.1", @@ -15772,91 +15438,42 @@ ], "time": "2023-03-08T13:26:56+00:00" }, - { - "name": "netresearch/jsonmapper", - "version": "v4.2.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", - "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.2.0" - }, - "time": "2023-04-09T17:37:40+00:00" - }, { "name": "nunomaduro/collision", - "version": "v6.4.0", + "version": "v7.8.1", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "f05978827b9343cba381ca05b8c7deee346b6015" + "reference": "61553ad3260845d7e3e49121b7074619233d361b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f05978827b9343cba381ca05b8c7deee346b6015", - "reference": "f05978827b9343cba381ca05b8c7deee346b6015", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/61553ad3260845d7e3e49121b7074619233d361b", + "reference": "61553ad3260845d7e3e49121b7074619233d361b", "shasum": "" }, "require": { - "filp/whoops": "^2.14.5", - "php": "^8.0.0", - "symfony/console": "^6.0.2" + "filp/whoops": "^2.15.3", + "nunomaduro/termwind": "^1.15.1", + "php": "^8.1.0", + "symfony/console": "^6.3.2" }, "require-dev": { - "brianium/paratest": "^6.4.1", - "laravel/framework": "^9.26.1", - "laravel/pint": "^1.1.1", - "nunomaduro/larastan": "^1.0.3", - "nunomaduro/mock-final-classes": "^1.1.0", - "orchestra/testbench": "^7.7", - "phpunit/phpunit": "^9.5.23", - "spatie/ignition": "^1.4.1" + "brianium/paratest": "^7.2.4", + "laravel/framework": "^10.17.1", + "laravel/pint": "^1.10.5", + "laravel/sail": "^1.23.1", + "laravel/sanctum": "^3.2.5", + "laravel/tinker": "^2.8.1", + "nunomaduro/larastan": "^2.6.4", + "orchestra/testbench-core": "^8.5.9", + "pestphp/pest": "^2.12.1", + "phpunit/phpunit": "^10.3.1", + "sebastian/environment": "^6.0.1", + "spatie/laravel-ignition": "^2.2.0" }, "type": "library", "extra": { - "branch-alias": { - "dev-develop": "6.x-dev" - }, "laravel": { "providers": [ "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" @@ -15864,6 +15481,9 @@ } }, "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], "psr-4": { "NunoMaduro\\Collision\\": "src/" } @@ -15909,7 +15529,7 @@ "type": "patreon" } ], - "time": "2023-01-03T12:54:54+00:00" + "time": "2023-08-07T08:03:21+00:00" }, { "name": "nunomaduro/larastan", @@ -16007,59 +15627,6 @@ ], "time": "2023-07-29T12:13:13+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", "version": "2.0.3", @@ -16171,63 +15738,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, { "name": "phpmyadmin/sql-parser", "version": "5.8.0", @@ -16379,16 +15889,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.27", + "version": "10.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" + "reference": "be1fe461fdc917de2a29a452ccf2657d325b443d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be1fe461fdc917de2a29a452ccf2657d325b443d", + "reference": "be1fe461fdc917de2a29a452ccf2657d325b443d", "shasum": "" }, "require": { @@ -16396,18 +15906,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", + "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": "^9.3" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -16416,7 +15926,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -16445,7 +15955,7 @@ "support": { "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/9.2.27" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.3" }, "funding": [ { @@ -16453,32 +15963,32 @@ "type": "github" } ], - "time": "2023-07-26T13:44:30+00:00" + "time": "2023-07-26T13:45:28+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "5647d65443818959172645e7ed999217360654b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/5647d65443818959172645e7ed999217360654b6", + "reference": "5647d65443818959172645e7ed999217360654b6", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -16505,7 +16015,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.2" }, "funding": [ { @@ -16513,28 +16024,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-05-07T09:13:23+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -16542,7 +16053,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -16568,7 +16079,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -16576,32 +16087,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -16627,7 +16138,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" }, "funding": [ { @@ -16635,32 +16146,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-02-03T06:56:46+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -16686,7 +16197,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -16694,24 +16205,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.10", + "version": "10.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" + "reference": "0dafb1175c366dd274eaa9a625e914451506bcd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", - "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0dafb1175c366dd274eaa9a625e914451506bcd1", + "reference": "0dafb1175c366dd274eaa9a625e914451506bcd1", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -16721,27 +16231,26 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.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.2", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.1", + "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.0", + "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", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -16749,7 +16258,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.3-dev" } }, "autoload": { @@ -16781,7 +16290,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.2" }, "funding": [ { @@ -16797,32 +16306,32 @@ "type": "tidelift" } ], - "time": "2023-07-10T04:04:23+00:00" + "time": "2023-08-15T05:34:23+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -16845,7 +16354,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" }, "funding": [ { @@ -16853,32 +16362,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -16901,7 +16410,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -16909,32 +16418,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -16956,7 +16465,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -16964,34 +16473,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17030,7 +16541,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -17038,33 +16550,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -17087,7 +16599,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" }, "funding": [ { @@ -17095,33 +16607,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-02-03T06:59:47+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17153,7 +16665,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -17161,27 +16674,27 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -17189,7 +16702,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -17208,7 +16721,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -17216,7 +16729,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -17224,34 +16738,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17293,7 +16807,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" }, "funding": [ { @@ -17301,38 +16815,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2023-02-03T07:06:49+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -17357,7 +16868,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -17365,33 +16877,33 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -17414,7 +16926,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" }, "funding": [ { @@ -17422,34 +16934,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-02-03T07:08:02+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17471,7 +16983,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -17479,32 +16991,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -17526,7 +17038,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -17534,32 +17046,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17589,7 +17101,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -17597,87 +17109,32 @@ "type": "github" } ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -17700,7 +17157,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -17708,29 +17165,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -17753,7 +17210,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -17761,7 +17218,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "spatie/backtrace", @@ -17980,41 +17437,43 @@ }, { "name": "spatie/laravel-ignition", - "version": "1.6.4", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "1a2b4bd3d48c72526c0ba417687e5c56b5cf49bc" + "reference": "dd15fbe82ef5392798941efae93c49395a87d943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/1a2b4bd3d48c72526c0ba417687e5c56b5cf49bc", - "reference": "1a2b4bd3d48c72526c0ba417687e5c56b5cf49bc", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/dd15fbe82ef5392798941efae93c49395a87d943", + "reference": "dd15fbe82ef5392798941efae93c49395a87d943", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "illuminate/support": "^8.77|^9.27", - "monolog/monolog": "^2.3", - "php": "^8.0", - "spatie/flare-client-php": "^1.0.1", - "spatie/ignition": "^1.4.1", - "symfony/console": "^5.0|^6.0", - "symfony/var-dumper": "^5.0|^6.0" + "illuminate/support": "^10.0", + "php": "^8.1", + "spatie/flare-client-php": "^1.3.5", + "spatie/ignition": "^1.9", + "symfony/console": "^6.2.3", + "symfony/var-dumper": "^6.2.3" }, "require-dev": { - "filp/whoops": "^2.14", - "livewire/livewire": "^2.8|dev-develop", - "mockery/mockery": "^1.4", - "nunomaduro/larastan": "^1.0", - "orchestra/testbench": "^6.23|^7.0", - "pestphp/pest": "^1.20", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "spatie/laravel-ray": "^1.27" + "livewire/livewire": "^2.11", + "mockery/mockery": "^1.5.1", + "openai-php/client": "^0.3.4", + "orchestra/testbench": "^8.0", + "pestphp/pest": "^1.22.3", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.3", + "vlucas/phpdotenv": "^5.5" + }, + "suggest": { + "openai-php/client": "Require get solutions from OpenAI", + "psr/simple-cache-implementation": "Needed to cache solutions from OpenAI" }, "type": "library", "extra": { @@ -18066,7 +17525,7 @@ "type": "github" } ], - "time": "2023-01-03T19:28:04+00:00" + "time": "2023-06-28T13:51:52+00:00" }, { "name": "spaze/phpstan-stripe", @@ -18320,165 +17779,6 @@ } ], "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/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": [], From 118218430684cba2d4a998de56fa3620d7762642 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 09:51:56 +1000 Subject: [PATCH 02/22] Updates for L10 migration --- app/Http/Kernel.php | 2 +- composer.json | 2 +- composer.lock | 26 +- database/seeders/RandomDataSeeder.php | 1 - phpunit.xml | 3 +- tests/Feature/ReminderTest.php | 2 - tests/MockAccountData.php | 1 - tests/Unit/Migration/ImportTest.php | 448 -------------------------- 8 files changed, 17 insertions(+), 468 deletions(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index f0cf330a16f0..171626827189 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -128,7 +128,7 @@ class Kernel extends HttpKernel * * @var array */ - protected $routeMiddleware = [ + protected $middlewareAliases = [ 'auth' => Authenticate::class, 'auth.basic' => AuthenticateWithBasicAuth::class, 'bindings' => SubstituteBindings::class, diff --git a/composer.json b/composer.json index 8be79d304d86..42082bfb62c7 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "laravel/ui": "^4.0", "league/csv": "^9.6", "league/flysystem-aws-s3-v3": "^3.0", - "league/fractal": "^0.17.0", + "league/fractal": "^0.20.0", "league/omnipay": "^3.1", "livewire/livewire": "^2.10", "microsoft/microsoft-graph": "^1.69", diff --git a/composer.lock b/composer.lock index 680c4948ec2b..fea6971d7c21 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": "c54361d62a99c6382de6477fdc56cd7e", + "content-hash": "c6e70e26e10d4836ad93323a7efd7eb5", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -5532,28 +5532,30 @@ }, { "name": "league/fractal", - "version": "0.17.0", + "version": "0.20.1", "source": { "type": "git", "url": "https://github.com/thephpleague/fractal.git", - "reference": "a0b350824f22fc2fdde2500ce9d6851a3f275b0e" + "reference": "8b9d39b67624db9195c06f9c1ffd0355151eaf62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/fractal/zipball/a0b350824f22fc2fdde2500ce9d6851a3f275b0e", - "reference": "a0b350824f22fc2fdde2500ce9d6851a3f275b0e", + "url": "https://api.github.com/repos/thephpleague/fractal/zipball/8b9d39b67624db9195c06f9c1ffd0355151eaf62", + "reference": "8b9d39b67624db9195c06f9c1ffd0355151eaf62", "shasum": "" }, "require": { - "php": ">=5.4" + "php": ">=7.4" }, "require-dev": { "doctrine/orm": "^2.5", "illuminate/contracts": "~5.0", - "mockery/mockery": "~0.9", + "mockery/mockery": "^1.3", "pagerfanta/pagerfanta": "~1.0.0", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "~3.4", + "vimeo/psalm": "^4.22", "zendframework/zend-paginator": "~2.3" }, "suggest": { @@ -5564,7 +5566,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.13-dev" + "dev-master": "0.20.x-dev" } }, "autoload": { @@ -5594,9 +5596,9 @@ ], "support": { "issues": "https://github.com/thephpleague/fractal/issues", - "source": "https://github.com/thephpleague/fractal/tree/master" + "source": "https://github.com/thephpleague/fractal/tree/0.20.1" }, - "time": "2017-06-12T11:04:56+00:00" + "time": "2022-04-11T12:47:17+00:00" }, { "name": "league/mime-type-detection", diff --git a/database/seeders/RandomDataSeeder.php b/database/seeders/RandomDataSeeder.php index 13a0e89c091d..e508ba0daaee 100644 --- a/database/seeders/RandomDataSeeder.php +++ b/database/seeders/RandomDataSeeder.php @@ -296,7 +296,6 @@ class RandomDataSeeder extends Seeder // $payment->service()->updateInvoicePayment($payment_hash); - // UpdateInvoicePayment::dispatchNow($payment, $payment->company); } }); diff --git a/phpunit.xml b/phpunit.xml index cc7e424e14bd..81d3e64b46f4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,5 @@ - - + ./tests/Unit diff --git a/tests/Feature/ReminderTest.php b/tests/Feature/ReminderTest.php index c55c302d8c22..2d77e88e8ad9 100644 --- a/tests/Feature/ReminderTest.php +++ b/tests/Feature/ReminderTest.php @@ -268,7 +268,6 @@ class ReminderTest extends TestCase $this->assertEquals(Carbon::parse($this->invoice->next_send_date)->format('Y-m-d'), Carbon::now()->addDays(7)->format('Y-m-d')); - // ReminderJob::dispatchNow(); } public function testReminderHitsScenarioH1() @@ -293,7 +292,6 @@ class ReminderTest extends TestCase $this->assertEquals(Carbon::parse($this->invoice->next_send_date)->format('Y-m-d'), Carbon::now()->addDays(30)->subDays(2)->format('Y-m-d')); - // ReminderJob::dispatchNow(); } /* Cant set a reminder in the past so need to skip reminder 2 and go straigh to reminder 3*/ diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index 3d780ea1fad3..d270d172edba 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -719,7 +719,6 @@ trait MockAccountData $this->invoice->save(); $this->invoice->ledger()->updateInvoiceBalance($this->invoice->amount); - // UpdateCompanyLedgerWithInvoice::dispatchNow($this->invoice, $this->invoice->amount, $this->invoice->company); $user_id = $this->invoice->user_id; diff --git a/tests/Unit/Migration/ImportTest.php b/tests/Unit/Migration/ImportTest.php index 0cf8c1168565..a482715b3dfe 100644 --- a/tests/Unit/Migration/ImportTest.php +++ b/tests/Unit/Migration/ImportTest.php @@ -11,26 +11,7 @@ namespace Tests\Unit\Migration; -use App\Exceptions\ResourceDependencyMissing; -use App\Exceptions\ResourceNotAvailableForMigration; -use App\Jobs\Util\Import; -use App\Jobs\Util\StartMigration; -use App\Mail\MigrationFailed; -use App\Models\Client; -use App\Models\ClientContact; -use App\Models\ClientGatewayToken; -use App\Models\Company; -use App\Models\CompanyGateway; -use App\Models\Credit; -use App\Models\Document; -use App\Models\Invoice; -use App\Models\Payment; -use App\Models\Product; -use App\Models\Quote; -use App\Models\TaxRate; -use App\Models\User; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Support\Facades\Mail; use Tests\MockAccountData; use Tests\TestCase; @@ -59,433 +40,4 @@ class ImportTest extends TestCase $this->assertTrue($status); } - // public function testAllImport() - // { - - // $this->invoice->forceDelete(); - // $this->quote->forceDelete(); - - // $this->user->setCompany($this->company); - // auth()->login($this->user, true); - - // Import::dispatchNow($this->migration_array, $this->company, $this->user); - - // $this->assertTrue(true); - // } - -// public function testExceptionOnUnavailableResource() -// { -// $data['panda_bears'] = [ -// 'name' => 'Awesome Panda Bear', -// ]; - -// try { -// Import::dispatchNow($data, $this->company, $this->user); -// } -// catch (ResourceNotAvailableForMigration $e) { -// $this->assertTrue(true); -// } -// } - -// public function testCompanyUpdating() -// { -// $original_company_key = $this->company->company_key; - -// $data['company'] = [ -// 'company_key' => 0, -// ]; - -// Import::dispatchNow($data, $this->company, $this->user); - -// $this->assertNotEquals($original_company_key, $this->company->company_key); -// } - -// public function testInvoicesFailsWithoutClient() -// { -// $data['invoices'] = [ -// 0 => [ -// 'client_id' => 1, -// 'is_amount_discount' => false, -// ] -// ]; - -// try { -// Import::dispatchNow($data, $this->company, $this->user); -// } catch(ResourceDependencyMissing $e) { -// $this->assertTrue(true); -// } -// } - -// public function testInvoicesImporting() -// { -// $this->makeTestData(); - -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); - -// $original_count = Invoice::count(); - -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $this->assertGreaterThan($original_count, Invoice::count()); -// } - -// public function testQuotesFailsWithoutClient() -// { -// $data['quotes'] = [ -// 0 => [ -// 'client_id' => 1, -// 'is_amount_discount' => false, -// ] -// ]; - -// try { -// Import::dispatchNow($data, $this->company, $this->user); -// } catch(ResourceDependencyMissing $e) { -// $this->assertTrue(true); -// } -// } - -// public function testImportFileExists() -// { -// $this->assertGreaterThan(1, count($this->migration_array)); - -// } - -// public function testClientAttributes() -// { -// $original_number = Client::count(); - -// $random_balance = rand(0, 10); - -// $data['clients'] = [ -// 0 => [ -// 'id' => 1, -// 'name' => 'My awesome unique client', -// 'balance' => $random_balance, -// 'user_id' => 1, -// ] -// ]; - -// Import::dispatchNow($data, $this->company, $this->user); - -// $client = Client::where('name', 'My awesome unique client') -// ->where('balance', $random_balance) -// ->first(); - -// $this->assertNotNull($client); -// $this->assertGreaterThan($original_number, Client::count()); -// $this->assertGreaterThanOrEqual(0, $client->balance); -// } - -// // public function testInvoiceAttributes() -// // { -// // $original_number = Invoice::count(); - -// // $this->invoice->forceDelete(); - -// // $migration_file = base_path() . '/tests/Unit/Migration/migration.json'; - -// // $this->migration_array = json_decode(file_get_contents($migration_file), 1); - -// // Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// // $this->assertGreaterThan($original_number, Invoice::count()); - -// // $invoice_1 = Invoice::whereNumber('0001') -// // // ->where('discount', '0.00') -// // // ->where('date', '2020-03-18') -// // ->first(); - -// // $invoice_2 = Invoice::whereNumber('0018') -// // // ->where('discount', '0.00') -// // // ->where('date', '2019-10-15') -// // ->first(); - -// // $this->assertNotNull($invoice_1); -// // $this->assertNotNull($invoice_2); - -// // $this->assertEquals('13.5000', $invoice_1->amount); -// // $this->assertEquals('67.4100', $invoice_2->amount); - -// // $this->assertEquals('8.4900', $invoice_1->balance); -// // $this->assertEquals('50.4200', $invoice_2->balance); -// // } - -// // public function testQuoteAttributes() -// // { -// // $original_number = Quote::count(); - -// // $this->invoice->forceDelete(); - -// // $migration_file = base_path() . '/tests/Unit/Migration/migration.json'; - -// // $this->migration_array = json_decode(file_get_contents($migration_file), 1); - -// // Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// // $this->assertGreaterThan($original_number, Invoice::count()); - -// // $quote = Quote::whereNumber('0021') -// // ->whereDiscount('0.00') -// // ->first(); - -// // $this->assertNotNull($quote); -// // $this->assertEquals('0.0000', $quote->amount); -// // $this->assertEquals('0.0000', $quote->balance); -// // } - -// public function testPaymentsImport() -// { -// $original_count = Payment::count(); - -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $this->assertGreaterThan($original_count, Payment::count()); -// } - -// public function testPaymentDependsOnClient() -// { -// $data['payments'] = [ -// 0 => [ -// 'client_id' => 1, -// 'amount' => 1, -// ] -// ]; - -// try { -// Import::dispatchNow($data, $this->company, $this->user); -// } catch(ResourceDependencyMissing $e) { -// $this->assertTrue(true); -// } -// } - -// public function testQuotesImport() -// { -// $original_count = Credit::count(); - -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); - -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $this->assertGreaterThan($original_count, Credit::count()); -// } - -// public function testMigrationFileExists() -// { -// $migration_archive = base_path() . '/tests/Unit/Migration/migration.zip'; - -// $this->assertTrue(file_exists($migration_archive)); -// } - -// // public function testMigrationFileBeingExtracted() -// // { -// // $migration_archive = base_path() . '/tests/Unit/Migration/migration.zip'; - -// // StartMigration::dispatchNow($migration_archive, $this->user, $this->company); - -// // $extracted_archive = storage_path("migrations/migration"); -// // $migration_file = storage_path("migrations/migration/migration.json"); - -// // $this->assertTrue(file_exists($extracted_archive)); -// // $this->assertTrue(is_dir($extracted_archive)); -// // $this->assertTrue(file_exists($migration_file)); -// // } - -// public function testValidityOfImportedData() -// { -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); - -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $differences = []; - -// foreach ($this->migration_array['invoices'] as $key => $invoices) { -// $record = Invoice::whereNumber($invoices['number']) -// ->whereAmount($invoices['amount']) -// ->whereBalance($invoices['balance']) -// ->first(); - -// if (!$record) { -// $differences['invoices']['missing'][] = $invoices['id']; -// } -// } - -// foreach ($this->migration_array['users'] as $key => $user) { -// $record = User::whereEmail($user['email'])->first(); - -// if (!$record) { -// $differences['users']['missing'][] = $user['email']; -// } -// } - -// foreach ($this->migration_array['tax_rates'] as $key => $tax_rate) { -// $record = TaxRate::whereName($tax_rate['name']) -// ->where('rate', $tax_rate['rate']) -// ->first(); - -// if (!$record) { -// $differences['tax_rates']['missing'][] = $tax_rate['name']; -// } -// } - -// foreach ($this->migration_array['clients'] as $key => $client) { -// $record = Client::whereName($client['name']) -// ->whereCity($client['city']) -// // ->where('paid_to_date', $client['paid_to_date']) // TODO: Doesn't work. Need debugging. -// ->first(); - -// if (!$record) { -// $differences['clients']['missing'][] = $client['name']; -// } -// } - -// foreach ($this->migration_array['products'] as $key => $product) { -// $record = Product::where('product_key', $product['product_key']) -// ->first(); - -// if (!$record) { -// $differences['products']['missing'][] = $product['notes']; -// } -// } - -// foreach ($this->migration_array['quotes'] as $key => $quote) { -// $record = Quote::whereNumber($quote['number']) -// ->whereIsAmountDiscount($quote['is_amount_discount']) -// ->whereDueDate($quote['due_date']) -// ->first(); - -// if (!$record) { -// $differences['quotes']['missing'][] = $quote['id']; -// } -// } - -// foreach ($this->migration_array['payments'] as $key => $payment) { -// $record = Payment::whereApplied($payment['applied']) -// ->first(); - -// if (!$record) { -// $differences['payments']['missing'][] = $payment['id']; -// } -// } - -// foreach ($this->migration_array['credits'] as $key => $credit) { - -// // The Import::processCredits() does insert the credit record with number: 0053, -// // .. however this part of the code doesn't see it at all. - -// $record = Credit::whereNumber($credit['number']) -// ->first(); - -// if (!$record) { -// $differences['credits']['missing'][] = $credit['id']; -// } -// } - -// /* -// foreach ($this->migration_array['company_gateways'] as $key => $company_gateway) { - -// // The Import::processCredits() does insert the credit record with number: 0053, -// // .. however this part of the code doesn't see it at all. - -// $record = CompanyGateway::where('gateway_key' ,$company_gateway['gateway_key']) -// ->first(); - -// if (!$record) { -// $differences['company_gateways']['missing'][] = $company_gateway['id']; -// } -// } - -// foreach ($this->migration_array['client_gateway_tokens'] as $key => $cgt) { - -// // The Import::processCredits() does insert the credit record with number: 0053, -// // .. however this part of the code doesn't see it at all. - -// $record = ClientGatewayToken::where('token' ,$cgt['token']) -// ->first(); - -// if (!$record) { -// $differences['client_gateway_tokens']['missing'][] = $cgt['id']; -// } -// } -// */ -// //@TODO we can uncomment tests for documents when we have imported expenses. - -// // foreach ($this->migration_array['documents'] as $key => $document) { - -// // if(!is_null($document['invoice_id'])) { - -// // $record = Document::where('hash', $document['hash']) -// // ->first(); - -// // if (!$record) { -// // $differences['documents']['missing'][] = $document['id']; -// // } -// // } -// // } - -// //\Log::error($differences); - -// $this->assertCount(0, $differences); -// } - -// public function testClientContactsImport() -// { -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); - -// $original = ClientContact::count(); - -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $this->assertGreaterThan($original, ClientContact::count()); -// } - -// public function testClientGatewayTokensImport() -// { -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); - -// $original = ClientGatewayToken::count(); - -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $this->assertTrue(true, 'ClientGatewayTokens importing not completed yet.'); - -// } - -// public function testDocumentsImport() -// { -// $this->invoice->forceDelete(); -// $this->quote->forceDelete(); - -// $original = Document::count(); - -// Import::dispatchNow($this->migration_array, $this->company, $this->user); - -// $document = Document::first(); - -// $this->assertTrue(true, 'Documents importing not completed yet. Missing expenses.'); -// } - -// public function testExceptionMailSending() -// { -// Mail::fake(); - -// $data['panda_bears'] = [ -// 'name' => 'Awesome Panda Bear', -// ]; - -// try { -// Import::dispatchNow($data, $this->company, $this->user); -// } -// catch (ResourceNotAvailableForMigration $e) { -// Mail::to($this->user)->send(new MigrationFailed($e, $e->getMessage())); -// $this->assertTrue(true); -// } -// } } From 805229f4c08f233a0c7317b815bb9c67100f30da Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 11:29:31 +1000 Subject: [PATCH 03/22] Fixes for query grammar --- app/Console/Commands/CheckData.php | 14 +++--- app/Import/Providers/BaseImport.php | 2 +- app/Jobs/Ninja/CheckCompanyData.php | 15 +------ app/Jobs/Util/Import.php | 2 +- app/Services/Chart/ChartQueries.php | 20 ++++----- app/Services/Chart/ChartQueriesLegacy.php | 13 +++--- app/Services/Invoice/HandleRestore.php | 6 +-- app/Services/Invoice/MarkInvoiceDeleted.php | 6 +-- app/Services/Report/ProfitLoss.php | 8 ++-- app/Transformers/AccountTransformer.php | 4 +- app/Transformers/ActivityTransformer.php | 4 +- app/Transformers/ArraySerializer.php | 4 +- .../BankIntegrationTransformer.php | 4 +- .../BankTransactionRuleTransformer.php | 4 +- .../BankTransactionTransformer.php | 4 +- app/Transformers/ClientTransformer.php | 4 +- .../CompanyGatewayTransformer.php | 4 +- .../CompanyTokenHashedTransformer.php | 4 +- app/Transformers/CompanyTokenTransformer.php | 4 +- app/Transformers/CompanyTransformer.php | 4 +- app/Transformers/CompanyUserTransformer.php | 4 +- .../Contact/InvoiceTransformer.php | 4 +- app/Transformers/CreditTransformer.php | 4 +- app/Transformers/DesignTransformer.php | 4 +- app/Transformers/DocumentTransformer.php | 4 +- app/Transformers/EntityTransformer.php | 2 +- .../ExpenseCategoryTransformer.php | 4 +- app/Transformers/ExpenseTransformer.php | 4 +- app/Transformers/GatewayTransformer.php | 4 +- app/Transformers/GroupSettingTransformer.php | 4 +- .../InvoiceHistoryTransformer.php | 4 +- app/Transformers/InvoiceTransformer.php | 4 +- app/Transformers/PaymentTransformer.php | 4 +- app/Transformers/PaymentableTransformer.php | 4 +- app/Transformers/ProductTransformer.php | 4 +- app/Transformers/ProjectTransformer.php | 4 +- app/Transformers/PurchaseOrderTransformer.php | 4 +- app/Transformers/QuoteTransformer.php | 4 +- .../RecurringExpenseTransformer.php | 4 +- .../RecurringInvoiceTransformer.php | 4 +- .../RecurringQuoteTransformer.php | 4 +- .../Shop/CompanyShopProfileTransformer.php | 4 +- app/Transformers/SubscriptionTransformer.php | 4 +- app/Transformers/SystemLogTransformer.php | 4 +- app/Transformers/TaskTransformer.php | 4 +- app/Transformers/UserTransformer.php | 4 +- app/Transformers/VendorTransformer.php | 4 +- app/Transformers/WebhookTransformer.php | 4 +- app/Utils/Ninja.php | 2 +- phpunit.xml | 1 + tests/Feature/Export/ReportApiTest.php | 13 +++--- tests/Feature/Export/UserSalesReportTest.php | 43 ++++++++++++++++--- tests/MockAccountData.php | 2 - tests/TestCase.php | 1 + tests/Unit/WithTypeHelpersTest.php | 3 ++ 55 files changed, 164 insertions(+), 141 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 7d931c1022fa..22c6e4487b6d 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -564,7 +564,7 @@ class CheckData extends Command GROUP BY clients.id HAVING payments_applied != client_paid_to_date ORDER BY clients.id; - ")); + ")->getValue(DB::connection()->getQueryGrammar())); return $results; } @@ -583,7 +583,7 @@ class CheckData extends Command AND paymentables.amount > 0 AND payments.is_deleted = 0 AND payments.client_id = ?; - "), [App\Models\Credit::class, $client->id]); + ")->getValue(DB::connection()->getQueryGrammar()), [App\Models\Credit::class, $client->id]); return $results; } @@ -636,7 +636,7 @@ class CheckData extends Command ->where('clients.updated_at', '>', now()->subDays(2)) ->groupBy('clients.id') ->havingRaw('clients.paid_to_date != sum(coalesce(payments.amount - payments.refunded, 0))') - ->get(['clients.id', 'clients.paid_to_date', DB::raw('sum(coalesce(payments.amount - payments.refunded, 0)) as amount')]); + ->get(['clients.id', 'clients.paid_to_date', DB::raw('sum(coalesce(payments.amount - payments.refunded, 0)) as amount')->getValue(DB::connection()->getQueryGrammar())]); /* Due to accounting differences we need to perform a second loop here to ensure there actually is an issue */ $clients->each(function ($client_record) use ($credit_total_applied) { @@ -656,7 +656,7 @@ class CheckData extends Command $p = Payment::where('client_id', $client->id) ->where('is_deleted', 0) ->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED]) - ->sum(DB::Raw('amount - applied')); + ->sum(DB::Raw('amount - applied')->getValue(DB::connection()->getQueryGrammar())); $total_invoice_payments += $p; @@ -736,7 +736,7 @@ class CheckData extends Command GROUP BY clients.id HAVING invoice_balance != clients.balance ORDER BY clients.id; - ")); + ")->getValue(DB::connection()->getQueryGrammar())); return $results; } @@ -827,7 +827,7 @@ class CheckData extends Command GROUP BY clients.id HAVING(invoices_balance != clients.balance) ORDER BY clients.id; - ")); + ")->getValue(DB::connection()->getQueryGrammar())); return $results; } @@ -961,7 +961,7 @@ class CheckData extends Command } $records = DB::table($table) ->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id") - ->where("{$table}.{$company_id}", '!=', DB::raw("{$tableName}.company_id")) + ->where("{$table}.{$company_id}", '!=', DB::raw("{$tableName}.company_id")->getValue(DB::connection()->getQueryGrammar())) ->get(["{$table}.id"]); if ($records->count()) { diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index 04ace061da52..fb196121b1f2 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -734,7 +734,7 @@ class BaseImport { $user = User::where('account_id', $this->company->account->id) ->where( - \DB::raw('CONCAT_WS(" ", first_name, last_name)'), + \DB::raw('CONCAT_WS(" ", first_name, last_name)')->getValue(DB::connection()->getQueryGrammar()), 'like', '%'.$user_hash.'%' ) diff --git a/app/Jobs/Ninja/CheckCompanyData.php b/app/Jobs/Ninja/CheckCompanyData.php index bd4d95504e96..3c9818beffec 100644 --- a/app/Jobs/Ninja/CheckCompanyData.php +++ b/app/Jobs/Ninja/CheckCompanyData.php @@ -158,17 +158,6 @@ class CheckCompanyData implements ShouldQueue $total_invoice_payments += ($total_amount - $total_refund); } - //10/02/21 - // foreach ($client->payments as $payment) { - // $credit_total_applied += $payment->paymentables->where('paymentable_type', App\Models\Credit::class)->sum(DB::raw('amount')); - // } - - // if ($credit_total_applied < 0) { - // $total_invoice_payments += $credit_total_applied; - // } //todo this is contentious - - // nlog("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}"); - if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) { $wrong_paid_to_dates++; @@ -287,7 +276,7 @@ class CheckCompanyData implements ShouldQueue // $clients->where('clients.id', '=', $this->option('client_id')); // } - $clients = $clients->get(['clients.id', DB::raw('count(client_contacts.id)')]); + $clients = $clients->get(['clients.id', DB::raw('count(client_contacts.id)')->getValue(DB::connection()->getQueryGrammar())]); $this->company_data[] = $clients->count().' clients without a single primary contact'; if ($clients->count() > 0) { @@ -326,7 +315,7 @@ class CheckCompanyData implements ShouldQueue } $records = DB::table($table) ->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id") - ->where("{$table}.{$company_id}", '!=', DB::raw("{$tableName}.company_id")) + ->where("{$table}.{$company_id}", '!=', DB::raw("{$tableName}.company_id")->getValue(DB::connection()->getQueryGrammar())) ->get(["{$table}.id"]); if ($records->count()) { diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 8a12e02e11d4..143ef43a2cdf 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -302,7 +302,7 @@ class Import implements ShouldQueue // 10/02/21 foreach ($client->payments as $payment) { - $credit_total_applied += $payment->paymentables()->where('paymentable_type', \App\Models\Credit::class)->get()->sum(\DB::raw('amount')); + $credit_total_applied += $payment->paymentables()->where('paymentable_type', \App\Models\Credit::class)->get()->sum(\DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); } if ($credit_total_applied < 0) { diff --git a/app/Services/Chart/ChartQueries.php b/app/Services/Chart/ChartQueries.php index e4b881c93688..6aee8c1a4230 100644 --- a/app/Services/Chart/ChartQueries.php +++ b/app/Services/Chart/ChartQueries.php @@ -34,7 +34,7 @@ trait ChartQueries AND (expenses.date BETWEEN :start_date AND :end_date) {$user_filter} GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getExpenseChartQuery($start_date, $end_date, $currency_id) @@ -54,7 +54,7 @@ trait ChartQueries {$user_filter} GROUP BY expenses.date HAVING currency_id = :currency_id - "), [ + ")->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, @@ -80,7 +80,7 @@ trait ChartQueries AND payments.company_id = :company_id AND (payments.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), [ + ")->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, @@ -106,7 +106,7 @@ trait ChartQueries AND (payments.date BETWEEN :start_date AND :end_date) GROUP BY payments.date HAVING currency_id = :currency_id - "), [ + ")->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, @@ -139,7 +139,7 @@ trait ChartQueries AND invoices.balance > 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getRevenueQueryX($start_date, $end_date) @@ -161,7 +161,7 @@ trait ChartQueries AND invoices.status_id IN (3,4) AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getRevenueQuery($start_date, $end_date) @@ -179,7 +179,7 @@ trait ChartQueries AND payments.status_id IN (1,4,5,6) AND (payments.date BETWEEN :start_date AND :end_date) GROUP BY payments.currency_id - "), ['company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getInvoicesQuery($start_date, $end_date) @@ -201,7 +201,7 @@ trait ChartQueries AND invoices.is_deleted = 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getOutstandingChartQuery($start_date, $end_date, $currency_id) @@ -224,7 +224,7 @@ trait ChartQueries AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY invoices.date HAVING currency_id = :currency_id - "), [ + ")->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => (int) $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, @@ -254,7 +254,7 @@ trait ChartQueries AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY invoices.date HAVING currency_id = :currency_id - "), [ + ")->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => (int) $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, diff --git a/app/Services/Chart/ChartQueriesLegacy.php b/app/Services/Chart/ChartQueriesLegacy.php index 2e03bca4abee..f79bc06d938f 100644 --- a/app/Services/Chart/ChartQueriesLegacy.php +++ b/app/Services/Chart/ChartQueriesLegacy.php @@ -23,6 +23,7 @@ trait ChartQueriesLegacy */ public function getExpenseQuery($start_date, $end_date) { + return DB::select(DB::raw(' SELECT sum(expenses.amount) as amount, IFNULL(expenses.currency_id, :company_currency) as currency_id @@ -31,7 +32,7 @@ trait ChartQueriesLegacy AND expenses.company_id = :company_id AND (expenses.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - '), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ')->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getExpenseChartQuery($start_date, $end_date, $currency_id) @@ -47,7 +48,7 @@ trait ChartQueriesLegacy AND expenses.is_deleted = 0 GROUP BY expenses.date HAVING currency_id = :currency_id - '), [ + ')->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, @@ -69,7 +70,7 @@ trait ChartQueriesLegacy AND payments.company_id = :company_id AND (payments.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - '), [ + ')->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, @@ -91,7 +92,7 @@ trait ChartQueriesLegacy AND payments.is_deleted = 0 GROUP BY payments.date HAVING currency_id = :currency_id - '), [ + ')->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, @@ -119,7 +120,7 @@ trait ChartQueriesLegacy AND invoices.is_deleted = 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]); } public function getRevenueQuery($start_date, $end_date) @@ -158,7 +159,7 @@ trait ChartQueriesLegacy AND invoices.is_deleted = 0 GROUP BY invoices.date HAVING currency_id = :currency_id - "), [ + ")->getValue(DB::connection()->getQueryGrammar()), [ 'company_currency' => (int) $this->company->settings->currency_id, 'currency_id' => $currency_id, 'company_id' => $this->company->id, diff --git a/app/Services/Invoice/HandleRestore.php b/app/Services/Invoice/HandleRestore.php index de3a990baad2..b63afa76ed56 100644 --- a/app/Services/Invoice/HandleRestore.php +++ b/app/Services/Invoice/HandleRestore.php @@ -96,17 +96,17 @@ class HandleRestore extends AbstractService $this->adjustment_amount += $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); $this->adjustment_amount += $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('refunded')); + ->sum(DB::raw('refunded')->getValue(DB::connection()->getQueryGrammar())); //14/07/2023 - do not include credits in the payment amount $this->adjustment_amount -= $payment->paymentables ->where('paymentable_type', '=', 'App\Models\Credit') - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); } diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index 72cfe0136de3..87b9d01288ca 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -88,17 +88,17 @@ class MarkInvoiceDeleted extends AbstractService $payment_adjustment = $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); $payment_adjustment -= $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('refunded')); + ->sum(DB::raw('refunded')->getValue(DB::connection()->getQueryGrammar())); //14-07-2023 - Do not include credits in the payment adjustment. $payment_adjustment -= $payment->paymentables ->where('paymentable_type', '=', 'App\Models\Credit') - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); $payment->amount -= $payment_adjustment; $payment->applied -= $payment_adjustment; diff --git a/app/Services/Report/ProfitLoss.php b/app/Services/Report/ProfitLoss.php index 12b19f6488f7..07eccd1542b9 100644 --- a/app/Services/Report/ProfitLoss.php +++ b/app/Services/Report/ProfitLoss.php @@ -250,7 +250,7 @@ class ProfitLoss AND invoices.is_deleted = 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } /** @@ -421,7 +421,7 @@ class ProfitLoss AND invoices.is_deleted = 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - "), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } /** @@ -447,7 +447,7 @@ class ProfitLoss AND (payments.date BETWEEN :start_date AND :end_date) GROUP BY currency_id ORDER BY currency_id; - '), ['company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ')->getValue(DB::connection()->getQueryGrammar()), ['company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } private function expenseData() @@ -553,7 +553,7 @@ class ProfitLoss AND expenses.company_id = :company_id AND (expenses.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - '), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ')->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } private function setBillingReportType() diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 3581ba530ada..7f5e914a3be6 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -28,7 +28,7 @@ class AccountTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ //'default_company', //'user', //'company_users' @@ -37,7 +37,7 @@ class AccountTransformer extends EntityTransformer /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'default_company', 'company_users', 'companies', diff --git a/app/Transformers/ActivityTransformer.php b/app/Transformers/ActivityTransformer.php index 77c3cebe6ae3..9c910daae682 100644 --- a/app/Transformers/ActivityTransformer.php +++ b/app/Transformers/ActivityTransformer.php @@ -34,12 +34,12 @@ class ActivityTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = []; + protected array $defaultIncludes = []; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'history', 'user', 'client', diff --git a/app/Transformers/ArraySerializer.php b/app/Transformers/ArraySerializer.php index 7ba37a86d055..33669fc17098 100644 --- a/app/Transformers/ArraySerializer.php +++ b/app/Transformers/ArraySerializer.php @@ -24,7 +24,7 @@ class ArraySerializer extends FractalArraySerializer * * @return array */ - public function collection($resourceKey, array $data) + public function collection(?string $resourceKey, array $data): array { return $data; } @@ -35,7 +35,7 @@ class ArraySerializer extends FractalArraySerializer * * @return array */ - public function item($resourceKey, array $data) + public function item(?string $resourceKey, array $data): array { return $data; } diff --git a/app/Transformers/BankIntegrationTransformer.php b/app/Transformers/BankIntegrationTransformer.php index c0a983ced78d..c414e76f466d 100644 --- a/app/Transformers/BankIntegrationTransformer.php +++ b/app/Transformers/BankIntegrationTransformer.php @@ -28,7 +28,7 @@ class BankIntegrationTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ //'default_company', //'user', //'company_users' @@ -37,7 +37,7 @@ class BankIntegrationTransformer extends EntityTransformer /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'company', 'account', 'bank_transactions', diff --git a/app/Transformers/BankTransactionRuleTransformer.php b/app/Transformers/BankTransactionRuleTransformer.php index 4d410c1b3bd9..9b9b71ed65a4 100644 --- a/app/Transformers/BankTransactionRuleTransformer.php +++ b/app/Transformers/BankTransactionRuleTransformer.php @@ -29,13 +29,13 @@ class BankTransactionRuleTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'company', 'vendor', 'client', diff --git a/app/Transformers/BankTransactionTransformer.php b/app/Transformers/BankTransactionTransformer.php index 2a1c15f9e642..dd9484c13542 100644 --- a/app/Transformers/BankTransactionTransformer.php +++ b/app/Transformers/BankTransactionTransformer.php @@ -28,13 +28,13 @@ class BankTransactionTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'company', // 'expense', 'payment', diff --git a/app/Transformers/ClientTransformer.php b/app/Transformers/ClientTransformer.php index 07b683fa8f34..f34b805ff581 100644 --- a/app/Transformers/ClientTransformer.php +++ b/app/Transformers/ClientTransformer.php @@ -29,7 +29,7 @@ class ClientTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'contacts', 'documents', 'gateway_tokens', @@ -38,7 +38,7 @@ class ClientTransformer extends EntityTransformer /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'activities', 'ledger', 'system_logs', diff --git a/app/Transformers/CompanyGatewayTransformer.php b/app/Transformers/CompanyGatewayTransformer.php index 2c79a442a557..9a0fd943d17b 100644 --- a/app/Transformers/CompanyGatewayTransformer.php +++ b/app/Transformers/CompanyGatewayTransformer.php @@ -29,13 +29,13 @@ class CompanyGatewayTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'system_logs', 'gateway', ]; diff --git a/app/Transformers/CompanyTokenHashedTransformer.php b/app/Transformers/CompanyTokenHashedTransformer.php index 254aa2beb07f..d9c1ee132fc4 100644 --- a/app/Transformers/CompanyTokenHashedTransformer.php +++ b/app/Transformers/CompanyTokenHashedTransformer.php @@ -24,13 +24,13 @@ class CompanyTokenHashedTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/CompanyTokenTransformer.php b/app/Transformers/CompanyTokenTransformer.php index 5e83e1149b9a..76083f063ff7 100644 --- a/app/Transformers/CompanyTokenTransformer.php +++ b/app/Transformers/CompanyTokenTransformer.php @@ -24,13 +24,13 @@ class CompanyTokenTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index ed6529d32a39..c3e9f2564193 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -59,14 +59,14 @@ class CompanyTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'documents', 'users', 'designs', diff --git a/app/Transformers/CompanyUserTransformer.php b/app/Transformers/CompanyUserTransformer.php index 2115cf88423c..43e76a0f84c0 100644 --- a/app/Transformers/CompanyUserTransformer.php +++ b/app/Transformers/CompanyUserTransformer.php @@ -22,14 +22,14 @@ class CompanyUserTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ // 'user', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'user', 'company', 'token', diff --git a/app/Transformers/Contact/InvoiceTransformer.php b/app/Transformers/Contact/InvoiceTransformer.php index 2c711acd7a75..af148ad39db6 100644 --- a/app/Transformers/Contact/InvoiceTransformer.php +++ b/app/Transformers/Contact/InvoiceTransformer.php @@ -19,11 +19,11 @@ class InvoiceTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ // 'invoice_items', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; public function transform(Invoice $invoice) diff --git a/app/Transformers/CreditTransformer.php b/app/Transformers/CreditTransformer.php index 53d4f2fc0ed6..c6e296316043 100644 --- a/app/Transformers/CreditTransformer.php +++ b/app/Transformers/CreditTransformer.php @@ -24,12 +24,12 @@ class CreditTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'invitations', 'documents', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'activities', 'client', ]; diff --git a/app/Transformers/DesignTransformer.php b/app/Transformers/DesignTransformer.php index ccde852575c8..953f5f164881 100644 --- a/app/Transformers/DesignTransformer.php +++ b/app/Transformers/DesignTransformer.php @@ -26,13 +26,13 @@ class DesignTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/DocumentTransformer.php b/app/Transformers/DocumentTransformer.php index 1b167ae21691..c916efe9d440 100644 --- a/app/Transformers/DocumentTransformer.php +++ b/app/Transformers/DocumentTransformer.php @@ -20,9 +20,9 @@ class DocumentTransformer extends EntityTransformer protected $serializer; - protected $defaultIncludes = []; + protected array $defaultIncludes = []; - protected $availableIncludes = []; + protected array $availableIncludes = []; public function __construct($serializer = null) { diff --git a/app/Transformers/EntityTransformer.php b/app/Transformers/EntityTransformer.php index 37181078c6d4..acc4177be080 100644 --- a/app/Transformers/EntityTransformer.php +++ b/app/Transformers/EntityTransformer.php @@ -44,7 +44,7 @@ class EntityTransformer extends TransformerAbstract return $this->item($data, $transformer, $entityType); } - public function getDefaultIncludes() + public function getDefaultIncludes(): array { return $this->defaultIncludes; } diff --git a/app/Transformers/ExpenseCategoryTransformer.php b/app/Transformers/ExpenseCategoryTransformer.php index 4013b7e8f0ec..08b4628edd17 100644 --- a/app/Transformers/ExpenseCategoryTransformer.php +++ b/app/Transformers/ExpenseCategoryTransformer.php @@ -23,13 +23,13 @@ class ExpenseCategoryTransformer extends EntityTransformer use MakesHash; use SoftDeletes; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/ExpenseTransformer.php b/app/Transformers/ExpenseTransformer.php index 653d0ee155ff..760f35909c52 100644 --- a/app/Transformers/ExpenseTransformer.php +++ b/app/Transformers/ExpenseTransformer.php @@ -30,14 +30,14 @@ class ExpenseTransformer extends EntityTransformer use MakesHash; use SoftDeletes; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'client', 'vendor', 'category', diff --git a/app/Transformers/GatewayTransformer.php b/app/Transformers/GatewayTransformer.php index 0bad79f250f6..4c71170c2bb0 100644 --- a/app/Transformers/GatewayTransformer.php +++ b/app/Transformers/GatewayTransformer.php @@ -21,13 +21,13 @@ class GatewayTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/GroupSettingTransformer.php b/app/Transformers/GroupSettingTransformer.php index 3a7695ccee8a..17e47c80562c 100644 --- a/app/Transformers/GroupSettingTransformer.php +++ b/app/Transformers/GroupSettingTransformer.php @@ -23,14 +23,14 @@ class GroupSettingTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/InvoiceHistoryTransformer.php b/app/Transformers/InvoiceHistoryTransformer.php index 54092d24bb1f..dfefccc5351f 100644 --- a/app/Transformers/InvoiceHistoryTransformer.php +++ b/app/Transformers/InvoiceHistoryTransformer.php @@ -19,11 +19,11 @@ class InvoiceHistoryTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ // 'activity', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'activity', ]; diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index d30ef214be3f..cc271bebe43b 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -24,12 +24,12 @@ class InvoiceTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'invitations', 'documents', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'payments', 'client', 'activities', diff --git a/app/Transformers/PaymentTransformer.php b/app/Transformers/PaymentTransformer.php index af6bbfbe55e1..2c9df5a4073c 100644 --- a/app/Transformers/PaymentTransformer.php +++ b/app/Transformers/PaymentTransformer.php @@ -24,12 +24,12 @@ class PaymentTransformer extends EntityTransformer protected $serializer; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'paymentables', 'documents', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'client', 'invoices', ]; diff --git a/app/Transformers/PaymentableTransformer.php b/app/Transformers/PaymentableTransformer.php index fc1c83c2a432..48a884e60816 100644 --- a/app/Transformers/PaymentableTransformer.php +++ b/app/Transformers/PaymentableTransformer.php @@ -21,9 +21,9 @@ class PaymentableTransformer extends EntityTransformer protected $serializer; - protected $defaultIncludes = []; + protected array $defaultIncludes = []; - protected $availableIncludes = []; + protected array $availableIncludes = []; public function __construct($serializer = null) { diff --git a/app/Transformers/ProductTransformer.php b/app/Transformers/ProductTransformer.php index 7ed02a233736..bab47b6f7940 100644 --- a/app/Transformers/ProductTransformer.php +++ b/app/Transformers/ProductTransformer.php @@ -22,14 +22,14 @@ class ProductTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'company', 'user', ]; diff --git a/app/Transformers/ProjectTransformer.php b/app/Transformers/ProjectTransformer.php index 96c67311f8cb..729552b58e69 100644 --- a/app/Transformers/ProjectTransformer.php +++ b/app/Transformers/ProjectTransformer.php @@ -25,14 +25,14 @@ class ProjectTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'client', 'tasks', ]; diff --git a/app/Transformers/PurchaseOrderTransformer.php b/app/Transformers/PurchaseOrderTransformer.php index 527cca34666f..58b270595eba 100644 --- a/app/Transformers/PurchaseOrderTransformer.php +++ b/app/Transformers/PurchaseOrderTransformer.php @@ -22,12 +22,12 @@ class PurchaseOrderTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'invitations', 'documents' ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'expense', 'vendor', ]; diff --git a/app/Transformers/QuoteTransformer.php b/app/Transformers/QuoteTransformer.php index bdbe0bfa27a2..4d4cf0ced301 100644 --- a/app/Transformers/QuoteTransformer.php +++ b/app/Transformers/QuoteTransformer.php @@ -24,12 +24,12 @@ class QuoteTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'invitations', 'documents', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'activities', 'client', ]; diff --git a/app/Transformers/RecurringExpenseTransformer.php b/app/Transformers/RecurringExpenseTransformer.php index 6d323093387c..62388d1f9a8b 100644 --- a/app/Transformers/RecurringExpenseTransformer.php +++ b/app/Transformers/RecurringExpenseTransformer.php @@ -27,14 +27,14 @@ class RecurringExpenseTransformer extends EntityTransformer use MakesHash; use SoftDeletes; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'documents', 'client', 'vendor', diff --git a/app/Transformers/RecurringInvoiceTransformer.php b/app/Transformers/RecurringInvoiceTransformer.php index b692ff838fdd..38008e52261d 100644 --- a/app/Transformers/RecurringInvoiceTransformer.php +++ b/app/Transformers/RecurringInvoiceTransformer.php @@ -23,12 +23,12 @@ class RecurringInvoiceTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'invitations', 'documents', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'activities', 'client', ]; diff --git a/app/Transformers/RecurringQuoteTransformer.php b/app/Transformers/RecurringQuoteTransformer.php index 905329c2282e..d6375e0953df 100644 --- a/app/Transformers/RecurringQuoteTransformer.php +++ b/app/Transformers/RecurringQuoteTransformer.php @@ -22,12 +22,12 @@ class RecurringQuoteTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'invitations', 'documents', ]; - protected $availableIncludes = [ + protected array $availableIncludes = [ 'invitations', 'documents', 'activities', diff --git a/app/Transformers/Shop/CompanyShopProfileTransformer.php b/app/Transformers/Shop/CompanyShopProfileTransformer.php index 8d9838bf6255..358ad5e321bd 100644 --- a/app/Transformers/Shop/CompanyShopProfileTransformer.php +++ b/app/Transformers/Shop/CompanyShopProfileTransformer.php @@ -26,13 +26,13 @@ class CompanyShopProfileTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; /** diff --git a/app/Transformers/SubscriptionTransformer.php b/app/Transformers/SubscriptionTransformer.php index 9cf2076c4ac6..7a9b53535ceb 100644 --- a/app/Transformers/SubscriptionTransformer.php +++ b/app/Transformers/SubscriptionTransformer.php @@ -22,13 +22,13 @@ class SubscriptionTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ ]; public function transform(Subscription $subscription): array diff --git a/app/Transformers/SystemLogTransformer.php b/app/Transformers/SystemLogTransformer.php index 37ccc13a78f6..b287c67c3598 100644 --- a/app/Transformers/SystemLogTransformer.php +++ b/app/Transformers/SystemLogTransformer.php @@ -9,12 +9,12 @@ class SystemLogTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = []; + protected array $defaultIncludes = []; /** * @var array */ - protected $availableIncludes = []; + protected array $availableIncludes = []; /** * @param SystemLog $system_log diff --git a/app/Transformers/TaskTransformer.php b/app/Transformers/TaskTransformer.php index cd668ba6bf63..b4d50535f5fb 100644 --- a/app/Transformers/TaskTransformer.php +++ b/app/Transformers/TaskTransformer.php @@ -28,7 +28,7 @@ class TaskTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'documents', 'project', ]; @@ -36,7 +36,7 @@ class TaskTransformer extends EntityTransformer /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'client', 'status', 'project', diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index ee251477dea1..21321b0946d6 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -25,14 +25,14 @@ class UserTransformer extends EntityTransformer /** * @var array */ - protected $defaultIncludes = [ + protected array $defaultIncludes = [ //'company_user' ]; /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'companies', 'company_users', 'company_user', diff --git a/app/Transformers/VendorTransformer.php b/app/Transformers/VendorTransformer.php index bbf1bfcde77e..051e8fb2f497 100644 --- a/app/Transformers/VendorTransformer.php +++ b/app/Transformers/VendorTransformer.php @@ -25,7 +25,7 @@ class VendorTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = [ + protected array $defaultIncludes = [ 'contacts', 'documents', ]; @@ -33,7 +33,7 @@ class VendorTransformer extends EntityTransformer /** * @var array */ - protected $availableIncludes = [ + protected array $availableIncludes = [ 'activities', ]; diff --git a/app/Transformers/WebhookTransformer.php b/app/Transformers/WebhookTransformer.php index b67686600261..11d265ef7cf5 100644 --- a/app/Transformers/WebhookTransformer.php +++ b/app/Transformers/WebhookTransformer.php @@ -9,12 +9,12 @@ class WebhookTransformer extends EntityTransformer { use MakesHash; - protected $defaultIncludes = []; + protected array $defaultIncludes = []; /** * @var array */ - protected $availableIncludes = []; + protected array $availableIncludes = []; /** * @param Webhook $webhook diff --git a/app/Utils/Ninja.php b/app/Utils/Ninja.php index 42e6ee271254..9b41b6ab0e65 100644 --- a/app/Utils/Ninja.php +++ b/app/Utils/Ninja.php @@ -43,7 +43,7 @@ class Ninja public static function getDebugInfo() { - $mysql_version = DB::select(DB::raw('select version() as version'))[0]->version; + $mysql_version = DB::select(DB::raw('select version() as version')->getValue(DB::connection()->getQueryGrammar()))[0]->version; $version = request()->input('version', 'No Version Supplied.'); diff --git a/phpunit.xml b/phpunit.xml index 81d3e64b46f4..70062c3f9d15 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,6 +23,7 @@ + diff --git a/tests/Feature/Export/ReportApiTest.php b/tests/Feature/Export/ReportApiTest.php index 14fd1f57297b..408177031db8 100644 --- a/tests/Feature/Export/ReportApiTest.php +++ b/tests/Feature/Export/ReportApiTest.php @@ -11,10 +11,12 @@ namespace Tests\Feature\Export; -use App\Utils\Traits\MakesHash; -use Illuminate\Routing\Middleware\ThrottleRequests; -use Tests\MockAccountData; use Tests\TestCase; +use Tests\MockAccountData; +use App\Utils\Traits\MakesHash; +use Illuminate\Support\Facades\Event; +use Illuminate\Routing\Middleware\ThrottleRequests; +use Illuminate\Foundation\Testing\Concerns\InteractsWithExceptionHandling; /** * @test @@ -23,7 +25,7 @@ class ReportApiTest extends TestCase { use MakesHash; use MockAccountData; - + public $faker; protected function setUp() :void @@ -36,8 +38,7 @@ class ReportApiTest extends TestCase ThrottleRequests::class ); - $this->withoutExceptionHandling(); - + // $this->withoutExceptionHandling(); $this->makeTestData(); } diff --git a/tests/Feature/Export/UserSalesReportTest.php b/tests/Feature/Export/UserSalesReportTest.php index 5003d5ad5f55..bff92d6a34bb 100644 --- a/tests/Feature/Export/UserSalesReportTest.php +++ b/tests/Feature/Export/UserSalesReportTest.php @@ -11,18 +11,21 @@ namespace Tests\Feature\Export; -use App\DataMapper\CompanySettings; -use App\Export\CSV\ProductSalesExport; -use App\Factory\InvoiceItemFactory; -use App\Models\Account; +use Tests\TestCase; +use App\Models\User; use App\Models\Client; +use App\Models\Account; use App\Models\Company; use App\Models\Invoice; -use App\Models\User; -use App\Services\Report\UserSalesReport; +use App\Utils\Traits\AppSetup; use App\Utils\Traits\MakesHash; +use App\DataMapper\CompanySettings; +use App\Factory\InvoiceItemFactory; +use Illuminate\Support\Facades\Cache; +use App\Export\CSV\ProductSalesExport; +use Illuminate\Support\Facades\Schema; +use App\Services\Report\UserSalesReport; use Illuminate\Routing\Middleware\ThrottleRequests; -use Tests\TestCase; /** * @test @@ -44,6 +47,32 @@ class UserSalesReportTest extends TestCase ); $this->withoutExceptionHandling(); + + /* Warm up the cache !*/ + $cached_tables = config('ninja.cached_tables'); + + $this->artisan('db:seed --force'); + + foreach ($cached_tables as $name => $class) { + // check that the table exists in case the migration is pending + if (! Schema::hasTable((new $class())->getTable())) { + continue; + } + if ($name == 'payment_terms') { + $orderBy = 'num_days'; + } elseif ($name == 'fonts') { + $orderBy = 'sort_order'; + } elseif (in_array($name, ['currencies', 'industries', 'languages', 'countries', 'banks'])) { + $orderBy = 'name'; + } else { + $orderBy = 'id'; + } + $tableData = $class::orderBy($orderBy)->get(); + if ($tableData->count()) { + Cache::forever($name, $tableData); + } + } + } public $company; diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index d270d172edba..f00d619ee2a9 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -57,7 +57,6 @@ use App\Models\VendorContact; use App\Utils\Traits\GeneratesCounter; use App\Utils\Traits\MakesHash; use App\Utils\TruthSource; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Hash; @@ -71,7 +70,6 @@ trait MockAccountData { use MakesHash; use GeneratesCounter; - use WithoutEvents; /** * @var diff --git a/tests/TestCase.php b/tests/TestCase.php index 2932d4a69d65..df4697ddbf7c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,7 @@ namespace Tests; +use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase diff --git a/tests/Unit/WithTypeHelpersTest.php b/tests/Unit/WithTypeHelpersTest.php index 73bc0425bebc..d5ec9faeecc2 100644 --- a/tests/Unit/WithTypeHelpersTest.php +++ b/tests/Unit/WithTypeHelpersTest.php @@ -15,10 +15,13 @@ namespace Tests\Unit; use App\Models\Account; use App\Models\Company; use App\Models\Document; +use Illuminate\Foundation\Testing\DatabaseMigrations; use Tests\TestCase; class WithTypeHelpersTest extends TestCase { + use DatabaseMigrations; + public function testIsImageHelper(): void { $account = Account::factory()->create(); From d5e16f189cdd0d3075f4f4d0ba7db14d4b9a649a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 11:31:45 +1000 Subject: [PATCH 04/22] remove prop --- app/Models/Account.php | 15 +++------------ app/Models/BankIntegration.php | 3 --- app/Models/BankTransaction.php | 2 -- app/Models/BankTransactionRule.php | 3 --- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 595661a4f514..d0f7feaefd41 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -128,23 +128,14 @@ class Account extends BaseModel 'num_users', ]; - /** - * @var array - */ - protected $dates = [ - 'deleted_at', - 'promo_expires', - 'discount_expires', - // 'trial_started', - // 'plan_expires' - ]; - protected $casts = [ 'updated_at' => 'timestamp', 'created_at' => 'timestamp', 'deleted_at' => 'timestamp', 'onboarding' => 'object', - 'set_react_as_default_ap' => 'bool' + 'set_react_as_default_ap' => 'bool', + 'promo_expires' => 'date', + 'discount_expires' => 'date', ]; const PLAN_FREE = 'free'; diff --git a/app/Models/BankIntegration.php b/app/Models/BankIntegration.php index d6ec7ca94827..67a816f800f6 100644 --- a/app/Models/BankIntegration.php +++ b/app/Models/BankIntegration.php @@ -73,9 +73,6 @@ class BankIntegration extends BaseModel 'auto_sync', ]; - protected $dates = [ - ]; - public function getEntityType() { return self::class; diff --git a/app/Models/BankTransaction.php b/app/Models/BankTransaction.php index 29dd6eb4300f..5dfcafdc2e64 100644 --- a/app/Models/BankTransaction.php +++ b/app/Models/BankTransaction.php @@ -87,8 +87,6 @@ class BankTransaction extends BaseModel 'amount' ]; - protected $dates = [ - ]; public function getInvoiceIds() { diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 78fe94fe5026..22bbeb69bec5 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -87,9 +87,6 @@ class BankTransactionRule extends BaseModel 'created_at' => 'timestamp', 'deleted_at' => 'timestamp', ]; - - protected $dates = [ - ]; protected array $search_keys = [ 'description' => 'string', From cd06dc551af3e56a0f748c2e44868905cbe3699d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 13:29:34 +1000 Subject: [PATCH 05/22] Fixes for tests --- app/Services/Client/ClientService.php | 2 +- app/Services/Invoice/HandleRestore.php | 6 +- app/Services/Invoice/MarkInvoiceDeleted.php | 4 +- app/Services/Report/ProfitLoss.php | 8 +- tests/Integration/EventTest.php | 439 +++++++++++--------- tests/Unit/GoogleAnalyticsTest.php | 1 - tests/Unit/InvoiceActionsTest.php | 3 - 7 files changed, 250 insertions(+), 213 deletions(-) diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index 66ec70ed1355..a1f623980cff 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -81,7 +81,7 @@ class ClientService $amount = Payment::query()->where('client_id', $this->client->id) ->where('is_deleted', 0) ->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED]) - ->sum(DB::Raw('amount - applied')); + ->sum(DB::Raw('amount - applied')->getValue(DB::connection()->getQueryGrammar())); DB::connection(config('database.default'))->transaction(function () use ($amount) { $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first(); diff --git a/app/Services/Invoice/HandleRestore.php b/app/Services/Invoice/HandleRestore.php index b63afa76ed56..d2a4eeb1e1cc 100644 --- a/app/Services/Invoice/HandleRestore.php +++ b/app/Services/Invoice/HandleRestore.php @@ -129,16 +129,16 @@ class HandleRestore extends AbstractService $payment_adjustment = $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); $payment_adjustment -= $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('refunded')); + ->sum(DB::raw('refunded')->getValue(DB::connection()->getQueryGrammar())); $payment_adjustment -= $payment->paymentables ->where('paymentable_type', '=', 'App\Models\Credit') - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); $payment->amount += $payment_adjustment; $payment->applied += $payment_adjustment; diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index 87b9d01288ca..d2f1aef2bed7 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -121,12 +121,12 @@ class MarkInvoiceDeleted extends AbstractService $this->adjustment_amount += $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('amount')); + ->sum(DB::raw('amount')->getValue(DB::connection()->getQueryGrammar())); $this->adjustment_amount -= $payment->paymentables ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) - ->sum(DB::raw('refunded')); + ->sum(DB::raw('refunded')->getValue(DB::connection()->getQueryGrammar())); } $this->total_payments = $this->invoice->payments->sum('amount') - $this->invoice->payments->sum('refunded'); diff --git a/app/Services/Report/ProfitLoss.php b/app/Services/Report/ProfitLoss.php index 07eccd1542b9..4cd499bb38ac 100644 --- a/app/Services/Report/ProfitLoss.php +++ b/app/Services/Report/ProfitLoss.php @@ -250,7 +250,7 @@ class ProfitLoss AND invoices.is_deleted = 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ")->getValue(\DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } /** @@ -421,7 +421,7 @@ class ProfitLoss AND invoices.is_deleted = 0 AND (invoices.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - ")->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ")->getValue(\DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } /** @@ -447,7 +447,7 @@ class ProfitLoss AND (payments.date BETWEEN :start_date AND :end_date) GROUP BY currency_id ORDER BY currency_id; - ')->getValue(DB::connection()->getQueryGrammar()), ['company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ')->getValue(\DB::connection()->getQueryGrammar()), ['company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } private function expenseData() @@ -553,7 +553,7 @@ class ProfitLoss AND expenses.company_id = :company_id AND (expenses.date BETWEEN :start_date AND :end_date) GROUP BY currency_id - ')->getValue(DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); + ')->getValue(\DB::connection()->getQueryGrammar()), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $this->start_date, 'end_date' => $this->end_date]); } private function setBillingReportType() diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index 8d2323c6e61d..2d4477bead4c 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -8,79 +8,81 @@ * * @license https://www.elastic.co/licensing/elastic-license */ + namespace Tests\Integration; -use App\Events\Client\ClientWasArchived; -use App\Events\Client\ClientWasCreated; -use App\Events\Client\ClientWasDeleted; -use App\Events\Client\ClientWasRestored; -use App\Events\Client\ClientWasUpdated; -use App\Events\Credit\CreditWasArchived; -use App\Events\Credit\CreditWasCreated; -use App\Events\Credit\CreditWasDeleted; -use App\Events\Credit\CreditWasRestored; -use App\Events\Credit\CreditWasUpdated; -use App\Events\Expense\ExpenseWasArchived; -use App\Events\Expense\ExpenseWasCreated; -use App\Events\Expense\ExpenseWasDeleted; -use App\Events\Expense\ExpenseWasRestored; -use App\Events\Expense\ExpenseWasUpdated; -use App\Events\Invoice\InvoiceWasArchived; -use App\Events\Invoice\InvoiceWasCreated; -use App\Events\Invoice\InvoiceWasDeleted; -use App\Events\Invoice\InvoiceWasRestored; -use App\Events\Invoice\InvoiceWasUpdated; -use App\Events\Payment\PaymentWasArchived; -use App\Events\Payment\PaymentWasCreated; -use App\Events\Payment\PaymentWasDeleted; -use App\Events\Payment\PaymentWasRestored; -use App\Events\Payment\PaymentWasUpdated; -use App\Events\PurchaseOrder\PurchaseOrderWasArchived; -use App\Events\PurchaseOrder\PurchaseOrderWasCreated; -use App\Events\PurchaseOrder\PurchaseOrderWasDeleted; -use App\Events\PurchaseOrder\PurchaseOrderWasRestored; -use App\Events\PurchaseOrder\PurchaseOrderWasUpdated; -use App\Events\Quote\QuoteWasApproved; -use App\Events\Quote\QuoteWasArchived; -use App\Events\Quote\QuoteWasCreated; -use App\Events\Quote\QuoteWasDeleted; -use App\Events\Quote\QuoteWasRestored; -use App\Events\Quote\QuoteWasUpdated; -use App\Events\RecurringInvoice\RecurringInvoiceWasArchived; -use App\Events\RecurringInvoice\RecurringInvoiceWasCreated; -use App\Events\RecurringInvoice\RecurringInvoiceWasDeleted; -use App\Events\RecurringInvoice\RecurringInvoiceWasRestored; -use App\Events\RecurringInvoice\RecurringInvoiceWasUpdated; -use App\Events\Subscription\SubscriptionWasArchived; -use App\Events\Subscription\SubscriptionWasCreated; -use App\Events\Subscription\SubscriptionWasDeleted; -use App\Events\Subscription\SubscriptionWasRestored; -use App\Events\Subscription\SubscriptionWasUpdated; -use App\Events\Task\TaskWasArchived; +use Tests\TestCase; +use App\Models\Quote; +use App\Models\Invoice; +use Tests\MockAccountData; +use App\Utils\Traits\MakesHash; use App\Events\Task\TaskWasCreated; use App\Events\Task\TaskWasDeleted; -use App\Events\Task\TaskWasRestored; use App\Events\Task\TaskWasUpdated; -use App\Events\User\UserWasArchived; use App\Events\User\UserWasCreated; use App\Events\User\UserWasDeleted; -use App\Events\User\UserWasRestored; use App\Events\User\UserWasUpdated; -use App\Events\Vendor\VendorWasArchived; +use App\Events\Task\TaskWasArchived; +use App\Events\Task\TaskWasRestored; +use App\Events\User\UserWasArchived; +use App\Events\User\UserWasRestored; +use App\Events\Quote\QuoteWasCreated; +use App\Events\Quote\QuoteWasDeleted; +use App\Events\Quote\QuoteWasUpdated; +use Illuminate\Support\Facades\Event; +use App\Events\Quote\QuoteWasApproved; +use App\Events\Quote\QuoteWasArchived; +use App\Events\Quote\QuoteWasRestored; +use App\Events\Client\ClientWasCreated; +use App\Events\Client\ClientWasDeleted; +use App\Events\Client\ClientWasUpdated; +use App\Events\Credit\CreditWasCreated; +use App\Events\Credit\CreditWasDeleted; +use App\Events\Credit\CreditWasUpdated; use App\Events\Vendor\VendorWasCreated; use App\Events\Vendor\VendorWasDeleted; -use App\Events\Vendor\VendorWasRestored; use App\Events\Vendor\VendorWasUpdated; -use App\Http\Middleware\PasswordProtection; -use App\Models\Invoice; -use App\Models\Quote; -use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; -use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Routing\Middleware\ThrottleRequests; +use App\Events\Client\ClientWasArchived; +use App\Events\Client\ClientWasRestored; +use App\Events\Credit\CreditWasArchived; +use App\Events\Credit\CreditWasRestored; +use App\Events\Vendor\VendorWasArchived; +use App\Events\Vendor\VendorWasRestored; +use App\Events\Expense\ExpenseWasCreated; +use App\Events\Expense\ExpenseWasDeleted; +use App\Events\Expense\ExpenseWasUpdated; +use App\Events\Invoice\InvoiceWasCreated; +use App\Events\Invoice\InvoiceWasDeleted; +use App\Events\Invoice\InvoiceWasUpdated; +use App\Events\Payment\PaymentWasCreated; +use App\Events\Payment\PaymentWasDeleted; +use App\Events\Payment\PaymentWasUpdated; +use App\Events\Expense\ExpenseWasArchived; +use App\Events\Expense\ExpenseWasRestored; +use App\Events\Invoice\InvoiceWasArchived; +use App\Events\Invoice\InvoiceWasRestored; +use App\Events\Payment\PaymentWasArchived; +use App\Events\Payment\PaymentWasRestored; +use App\Http\Middleware\PasswordProtection; use Illuminate\Validation\ValidationException; -use Tests\MockAccountData; -use Tests\TestCase; +use App\Events\Subscription\SubscriptionWasCreated; +use App\Events\Subscription\SubscriptionWasDeleted; +use App\Events\Subscription\SubscriptionWasUpdated; +use Illuminate\Routing\Middleware\ThrottleRequests; +use App\Events\Subscription\SubscriptionWasArchived; +use App\Events\Subscription\SubscriptionWasRestored; +use App\Events\PurchaseOrder\PurchaseOrderWasCreated; +use App\Events\PurchaseOrder\PurchaseOrderWasDeleted; +use App\Events\PurchaseOrder\PurchaseOrderWasUpdated; +use App\Events\PurchaseOrder\PurchaseOrderWasArchived; +use App\Events\PurchaseOrder\PurchaseOrderWasRestored; +use Illuminate\Foundation\Testing\DatabaseTransactions; +use App\Events\RecurringInvoice\RecurringInvoiceWasCreated; +use App\Events\RecurringInvoice\RecurringInvoiceWasDeleted; +use App\Events\RecurringInvoice\RecurringInvoiceWasUpdated; +use App\Events\RecurringInvoice\RecurringInvoiceWasArchived; +use App\Events\RecurringInvoice\RecurringInvoiceWasRestored; /** * @test @@ -91,7 +93,7 @@ class EventTest extends TestCase use MakesHash; use DatabaseTransactions; - public function setUp() :void + public function setUp(): void { parent::setUp(); @@ -109,13 +111,7 @@ class EventTest extends TestCase public function testExpenseEvents() { - $this->expectsEvents([ - ExpenseWasCreated::class, - ExpenseWasUpdated::class, - ExpenseWasArchived::class, - ExpenseWasRestored::class, - ExpenseWasDeleted::class, - ]); + Event::fake(); $data = [ 'public_notes' => $this->faker->firstName, @@ -162,18 +158,21 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/expenses/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(ExpenseWasCreated::class); + Event::assertDispatched(ExpenseWasUpdated::class); + Event::assertDispatched(ExpenseWasArchived::class); + Event::assertDispatched(ExpenseWasRestored::class); + Event::assertDispatched(ExpenseWasDeleted::class); + } public function testVendorEvents() { - $this->expectsEvents([ - VendorWasCreated::class, - VendorWasUpdated::class, - VendorWasArchived::class, - VendorWasRestored::class, - VendorWasDeleted::class, - ]); + Event::fake(); + $data = [ 'name' => $this->faker->firstName, @@ -221,6 +220,14 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/vendors/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(VendorWasCreated::class); + Event::assertDispatched(VendorWasUpdated::class); + Event::assertDispatched(VendorWasArchived::class); + Event::assertDispatched(VendorWasRestored::class); + Event::assertDispatched(VendorWasDeleted::class); + } @@ -232,13 +239,8 @@ class EventTest extends TestCase 'description' => 'dude', ]; - $this->expectsEvents([ - TaskWasCreated::class, - TaskWasUpdated::class, - TaskWasArchived::class, - TaskWasRestored::class, - TaskWasDeleted::class, - ]); + Event::fake(); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), @@ -282,6 +284,14 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/tasks/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(TaskWasCreated::class); + Event::assertDispatched(TaskWasUpdated::class); + Event::assertDispatched(TaskWasArchived::class); + Event::assertDispatched(TaskWasRestored::class); + Event::assertDispatched(TaskWasDeleted::class); + } public function testCreditEvents() @@ -292,13 +302,7 @@ class EventTest extends TestCase 'number' => 'dude', ]; - $this->expectsEvents([ - CreditWasCreated::class, - CreditWasUpdated::class, - CreditWasArchived::class, - CreditWasRestored::class, - CreditWasDeleted::class, - ]); + Event::fake(); $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), @@ -342,8 +346,17 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/credits/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(CreditWasCreated::class); + Event::assertDispatched(CreditWasUpdated::class); + Event::assertDispatched(CreditWasArchived::class); + Event::assertDispatched(CreditWasRestored::class); + Event::assertDispatched(CreditWasDeleted::class); + } + public function testQuoteEvents() { /* Test fire new invoice */ @@ -352,14 +365,8 @@ class EventTest extends TestCase 'number' => 'dude', ]; - $this->expectsEvents([ - QuoteWasCreated::class, - QuoteWasUpdated::class, - QuoteWasArchived::class, - QuoteWasRestored::class, - QuoteWasDeleted::class, - QuoteWasApproved::class, - ]); + Event::fake(); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), @@ -413,6 +420,15 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/quotes/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(QuoteWasCreated::class); + Event::assertDispatched(QuoteWasUpdated::class); + Event::assertDispatched(QuoteWasArchived::class); + Event::assertDispatched(QuoteWasRestored::class); + Event::assertDispatched(QuoteWasDeleted::class); + Event::assertDispatched(QuoteWasApproved::class); + } @@ -421,13 +437,8 @@ class EventTest extends TestCase public function testPaymentEvents() { - $this->expectsEvents([ - PaymentWasCreated::class, - PaymentWasUpdated::class, - PaymentWasArchived::class, - PaymentWasRestored::class, - PaymentWasDeleted::class, - ]); + Event::fake(); + $data = [ 'amount' => $this->invoice->amount, @@ -481,6 +492,14 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/payments/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(PaymentWasCreated::class); + Event::assertDispatched(PaymentWasUpdated::class); + Event::assertDispatched(PaymentWasArchived::class); + Event::assertDispatched(PaymentWasRestored::class); + Event::assertDispatched(PaymentWasDeleted::class); + } @@ -492,13 +511,8 @@ class EventTest extends TestCase 'number' => 'dude', ]; - $this->expectsEvents([ - InvoiceWasCreated::class, - InvoiceWasUpdated::class, - InvoiceWasArchived::class, - InvoiceWasRestored::class, - InvoiceWasDeleted::class, - ]); + Event::fake(); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), @@ -542,6 +556,14 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/invoices/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(InvoiceWasCreated::class); + Event::assertDispatched(InvoiceWasUpdated::class); + Event::assertDispatched(InvoiceWasArchived::class); + Event::assertDispatched(InvoiceWasRestored::class); + Event::assertDispatched(InvoiceWasDeleted::class); + } @@ -555,13 +577,8 @@ class EventTest extends TestCase 'frequency_id' => 1, ]; - $this->expectsEvents([ - RecurringInvoiceWasCreated::class, - RecurringInvoiceWasUpdated::class, - RecurringInvoiceWasArchived::class, - RecurringInvoiceWasRestored::class, - RecurringInvoiceWasDeleted::class, - ]); + Event::fake(); + try { $response = $this->withHeaders([ @@ -611,19 +628,21 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/recurring_invoices/bulk?action=delete', $data) ->assertStatus(200); + + Event::assertDispatched(RecurringInvoiceWasCreated::class); + Event::assertDispatched(RecurringInvoiceWasUpdated::class); + Event::assertDispatched(RecurringInvoiceWasArchived::class); + Event::assertDispatched(RecurringInvoiceWasRestored::class); + Event::assertDispatched(RecurringInvoiceWasDeleted::class); + } public function testClientEvents() { - $this->expectsEvents([ - ClientWasCreated::class, - ClientWasUpdated::class, - ClientWasArchived::class, - ClientWasRestored::class, - ClientWasDeleted::class, - ]); + Event::fake(); + $data = [ 'name' => $this->faker->firstName, @@ -669,6 +688,14 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/clients/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(ClientWasCreated::class); + Event::assertDispatched(ClientWasUpdated::class); + Event::assertDispatched(ClientWasArchived::class); + Event::assertDispatched(ClientWasRestored::class); + Event::assertDispatched(ClientWasDeleted::class); + } @@ -676,13 +703,7 @@ class EventTest extends TestCase { $this->withoutMiddleware(PasswordProtection::class); - $this->expectsEvents([ - UserWasCreated::class, - UserWasUpdated::class, - UserWasArchived::class, - UserWasRestored::class, - UserWasDeleted::class, - ]); + Event::fake(); $data = [ 'first_name' => 'hey', @@ -701,7 +722,7 @@ class EventTest extends TestCase 'X-API-PASSWORD' => 'ALongAndBriliantPassword', ])->postJson('/api/v1/users?include=company_user', $data) ->assertStatus(200); - + $arr = $response->json(); $data = [ @@ -747,17 +768,27 @@ class EventTest extends TestCase 'X-API-PASSWORD' => 'ALongAndBriliantPassword', ])->postJson('/api/v1/users/bulk?action=delete', $data) ->assertStatus(200); + + + + + Event::assertDispatched(UserWasCreated::class); + + Event::assertDispatched(UserWasUpdated::class); + + Event::assertDispatched(UserWasArchived::class); + + Event::assertDispatched(UserWasRestored::class); + + Event::assertDispatched(UserWasDeleted::class); + + } public function testSubscriptionEvents() { - $this->expectsEvents([ - SubscriptionWasCreated::class, - SubscriptionWasUpdated::class, - SubscriptionWasArchived::class, - SubscriptionWasRestored::class, - SubscriptionWasDeleted::class, - ]); + Event::fake(); + $data = [ 'name' => $this->faker->firstName, @@ -804,76 +835,86 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/subscriptions/bulk?action=delete', $data) ->assertStatus(200); + + + Event::assertDispatched(SubscriptionWasCreated::class); + Event::assertDispatched(SubscriptionWasUpdated::class); + Event::assertDispatched(SubscriptionWasArchived::class); + Event::assertDispatched(SubscriptionWasRestored::class); + Event::assertDispatched(SubscriptionWasDeleted::class); + } -public function PurchaseOrderEvents() -{ - /* Test fire new invoice */ - $data = [ - 'client_id' => $this->vendor->hashed_id, - 'number' => 'dude', - ]; + public function PurchaseOrderEvents() + { + /* Test fire new invoice */ + $data = [ + 'client_id' => $this->vendor->hashed_id, + 'number' => 'dude', + ]; - $this->expectsEvents([ - PurchaseOrderWasCreated::class, - PurchaseOrderWasUpdated::class, - PurchaseOrderWasArchived::class, - PurchaseOrderWasRestored::class, - PurchaseOrderWasDeleted::class, - ]); - - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/purchase_orders/', $data) - ->assertStatus(200); + Event::fake(); - $arr = $response->json(); - - $data = [ - 'client_id' => $this->vendor->hashed_id, - 'number' => 'dude2', - ]; - - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/purchase_orders/' . $arr['data']['id'], $data) - ->assertStatus(200); + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/purchase_orders/', $data) + ->assertStatus(200); - $data = [ - 'ids' => [$arr['data']['id']], - ]; + $arr = $response->json(); - $quote = PurchaseOrder::find($this->decodePrimaryKey($arr['data']['id'])); - $quote->status_id = PurchaseOrder::STATUS_SENT; - $quote->save(); + $data = [ + 'client_id' => $this->vendor->hashed_id, + 'number' => 'dude2', + ]; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/purchase_orders/bulk?action=archive', $data) - ->assertStatus(200); + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/purchase_orders/' . $arr['data']['id'], $data) + ->assertStatus(200); - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/purchase_orders/bulk?action=restore', $data) - ->assertStatus(200); - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/purchase_orders/bulk?action=approve', $data) - ->assertStatus(200); + $data = [ + 'ids' => [$arr['data']['id']], + ]; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/purchase_orders/bulk?action=delete', $data) - ->assertStatus(200); -} + $quote = PurchaseOrder::find($this->decodePrimaryKey($arr['data']['id'])); + $quote->status_id = PurchaseOrder::STATUS_SENT; + $quote->save(); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/purchase_orders/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/purchase_orders/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/purchase_orders/bulk?action=approve', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/purchase_orders/bulk?action=delete', $data) + ->assertStatus(200); + + Event::assertDispatched(PurchaseOrderWasCreated::class); + Event::assertDispatched(PurchaseOrderWasUpdated::class); + Event::assertDispatched(PurchaseOrderWasArchived::class); + Event::assertDispatched(PurchaseOrderWasRestored::class); + Event::assertDispatched(PurchaseOrderWasDeleted::class); + + } } diff --git a/tests/Unit/GoogleAnalyticsTest.php b/tests/Unit/GoogleAnalyticsTest.php index 3f9730885801..504423fcf017 100644 --- a/tests/Unit/GoogleAnalyticsTest.php +++ b/tests/Unit/GoogleAnalyticsTest.php @@ -34,7 +34,6 @@ class GoogleAnalyticsTest extends TestCase public function testGoogleAnalyticsLogic() { - $this->withoutEvents(); $analytics_id = 'analytics_id'; $invoice = $this->invoice; diff --git a/tests/Unit/InvoiceActionsTest.php b/tests/Unit/InvoiceActionsTest.php index eefb6e59489a..41abcbe36368 100644 --- a/tests/Unit/InvoiceActionsTest.php +++ b/tests/Unit/InvoiceActionsTest.php @@ -43,7 +43,6 @@ class InvoiceActionsTest extends TestCase public function testInvoiceIsReversable() { - $this->withoutEvents(); $this->invoice = $this->invoice->service()->markPaid()->save(); @@ -54,7 +53,6 @@ class InvoiceActionsTest extends TestCase public function testInvoiceIsCancellable() { - $this->withoutEvents(); $payment = PaymentFactory::create($this->invoice->company_id, $this->invoice->user_id); $payment->amount = 40; @@ -73,7 +71,6 @@ class InvoiceActionsTest extends TestCase public function testInvoiceUnactionable() { - $this->withoutEvents(); $this->invoice->delete(); From a6d7584e149475bbcebed17d5f07a1c2b44660c8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 13:38:57 +1000 Subject: [PATCH 06/22] Fixes for query grammar --- app/Import/Providers/BaseImport.php | 2 +- tests/Feature/CompanyGatewayResolutionTest.php | 4 ++-- tests/Feature/EntityPaidToDateTest.php | 4 ++-- tests/Integration/EventTest.php | 12 +++++++----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index fb196121b1f2..b8525022c476 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -734,7 +734,7 @@ class BaseImport { $user = User::where('account_id', $this->company->account->id) ->where( - \DB::raw('CONCAT_WS(" ", first_name, last_name)')->getValue(DB::connection()->getQueryGrammar()), + \DB::raw('CONCAT_WS(" ", first_name, last_name)')->getValue(\DB::connection()->getQueryGrammar()), 'like', '%'.$user_hash.'%' ) diff --git a/tests/Feature/CompanyGatewayResolutionTest.php b/tests/Feature/CompanyGatewayResolutionTest.php index df01d5614ace..3dd633644440 100644 --- a/tests/Feature/CompanyGatewayResolutionTest.php +++ b/tests/Feature/CompanyGatewayResolutionTest.php @@ -124,8 +124,8 @@ class CompanyGatewayResolutionTest extends TestCase $amount = 10; $this->assertInstanceOf('\\stdClass', $this->cg->fees_and_limits); - $this->assertObjectHasAttribute('min_limit', $this->cg->fees_and_limits->{1}); - + // $this->assertObjectHasAttribute('min_limit', $this->cg->fees_and_limits->{1}); + $this->assertNotNull($this->cg->fees_and_limits->{1}->min_limit); $payment_methods = $this->client->service()->getPaymentMethods($amount); $this->assertEquals(2, count($payment_methods)); diff --git a/tests/Feature/EntityPaidToDateTest.php b/tests/Feature/EntityPaidToDateTest.php index 3212ff63d7a6..d706a53619e9 100644 --- a/tests/Feature/EntityPaidToDateTest.php +++ b/tests/Feature/EntityPaidToDateTest.php @@ -17,7 +17,7 @@ use App\Models\Invoice; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Foundation\Testing\WithoutEvents; +// use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Session; use Tests\MockAccountData; @@ -31,7 +31,7 @@ class EntityPaidToDateTest extends TestCase use MakesHash; use DatabaseTransactions; use MockAccountData; - use WithoutEvents; + // use WithoutEvents; protected function setUp() :void { diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index 2d4477bead4c..37100f380b7d 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -15,6 +15,7 @@ use Tests\TestCase; use App\Models\Quote; use App\Models\Invoice; use Tests\MockAccountData; +use App\Models\PurchaseOrder; use App\Utils\Traits\MakesHash; use App\Events\Task\TaskWasCreated; use App\Events\Task\TaskWasDeleted; @@ -93,6 +94,8 @@ class EventTest extends TestCase use MakesHash; use DatabaseTransactions; + public $faker; + public function setUp(): void { parent::setUp(); @@ -586,7 +589,7 @@ class EventTest extends TestCase 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/recurring_invoices/', $data); } catch (ValidationException $e) { - $message = json_decode($e->validator->getMessageBag(), 1); + // $message = json_decode($e->validator->getMessageBag(), 1); } $response->assertStatus(200); @@ -846,17 +849,16 @@ class EventTest extends TestCase } - public function PurchaseOrderEvents() + public function testPurchaseOrderEvents() { /* Test fire new invoice */ $data = [ - 'client_id' => $this->vendor->hashed_id, + 'vendor_id' => $this->vendor->hashed_id, 'number' => 'dude', ]; Event::fake(); - $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, @@ -867,7 +869,7 @@ class EventTest extends TestCase $arr = $response->json(); $data = [ - 'client_id' => $this->vendor->hashed_id, + 'vendor_id' => $this->vendor->hashed_id, 'number' => 'dude2', ]; From 3285eb4862a17f7e0e3c9fa186a30860c3123942 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 15:05:57 +1000 Subject: [PATCH 07/22] Fixes for find user in import --- app/Import/Providers/BaseImport.php | 9 +++++++++ app/Import/Transformer/BaseTransformer.php | 5 +++-- tests/Integration/EventTest.php | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index b8525022c476..d0f4ee68f5da 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -732,6 +732,15 @@ class BaseImport protected function findUser($user_hash) { + if(is_numeric($user_hash)) { + + $user = User::query()->find($user_hash); + + } + + if($user) + return $user->id; + $user = User::where('account_id', $this->company->account->id) ->where( \DB::raw('CONCAT_WS(" ", first_name, last_name)')->getValue(\DB::connection()->getQueryGrammar()), diff --git a/app/Import/Transformer/BaseTransformer.php b/app/Import/Transformer/BaseTransformer.php index a979a85082e8..1ae726605d57 100644 --- a/app/Import/Transformer/BaseTransformer.php +++ b/app/Import/Transformer/BaseTransformer.php @@ -238,14 +238,15 @@ class BaseTransformer */ public function hasClient($name) { + nlog("has client"); return Client::query()->where('company_id', $this->company->id) ->where('is_deleted', false) - ->whereRaw("LOWER(REPLACE(`name`, ' ' ,'')) = ?", [ + ->whereRaw("LOWER(REPLACE(`name`, ' ' , '')) = ?", [ strtolower(str_replace(' ', '', $name)), ]) ->exists(); } - + public function hasClientIdNumber($id_number) { return Client::query()->where('company_id', $this->company->id) diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index 37100f380b7d..e26560691042 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -903,7 +903,7 @@ class EventTest extends TestCase $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/purchase_orders/bulk?action=approve', $data) + ])->postJson('/api/v1/purchase_orders/bulk?action=mark_sent', $data) ->assertStatus(200); $response = $this->withHeaders([ From edabb8858a92677a2a42d9348ba1f014e3c0c88d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 15:25:46 +1000 Subject: [PATCH 08/22] Remove references to without events --- app/Import/Providers/BaseImport.php | 7 +++++- app/Import/Transformer/BaseTransformer.php | 2 +- tests/Feature/EntityPaidToDateTest.php | 2 -- tests/Feature/InvoiceEmailTest.php | 25 +++++++++++++------ tests/Feature/PaymentTest.php | 2 -- tests/Feature/PaymentV2Test.php | 2 -- tests/Feature/Payments/CreditPaymentTest.php | 2 -- .../Payments/StorePaymentValidationTest.php | 2 -- .../Payments/UnappliedPaymentDeleteTest.php | 4 +-- .../Payments/UnappliedPaymentRefundTest.php | 2 -- .../Feature/Scheduler/ScheduleEntityTest.php | 6 ----- tests/Feature/Scheduler/SchedulerTest.php | 2 -- tests/Feature/UpdatePaymentTest.php | 1 - tests/Feature/VendorApiTest.php | 5 +++- 14 files changed, 30 insertions(+), 34 deletions(-) diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index d0f4ee68f5da..2568213db695 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -732,9 +732,14 @@ class BaseImport protected function findUser($user_hash) { + $user = false; + if(is_numeric($user_hash)) { - $user = User::query()->find($user_hash); + $user = User::query() + ->where('account_id', $this->company->account->id) + ->where('id', $user_hash) + ->first(); } diff --git a/app/Import/Transformer/BaseTransformer.php b/app/Import/Transformer/BaseTransformer.php index 1ae726605d57..56a5415fc423 100644 --- a/app/Import/Transformer/BaseTransformer.php +++ b/app/Import/Transformer/BaseTransformer.php @@ -238,7 +238,7 @@ class BaseTransformer */ public function hasClient($name) { - nlog("has client"); + return Client::query()->where('company_id', $this->company->id) ->where('is_deleted', false) ->whereRaw("LOWER(REPLACE(`name`, ' ' , '')) = ?", [ diff --git a/tests/Feature/EntityPaidToDateTest.php b/tests/Feature/EntityPaidToDateTest.php index d706a53619e9..912617e6c787 100644 --- a/tests/Feature/EntityPaidToDateTest.php +++ b/tests/Feature/EntityPaidToDateTest.php @@ -17,7 +17,6 @@ use App\Models\Invoice; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\DatabaseTransactions; -// use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Session; use Tests\MockAccountData; @@ -31,7 +30,6 @@ class EntityPaidToDateTest extends TestCase use MakesHash; use DatabaseTransactions; use MockAccountData; - // use WithoutEvents; protected function setUp() :void { diff --git a/tests/Feature/InvoiceEmailTest.php b/tests/Feature/InvoiceEmailTest.php index 9609840e8ae2..a2af7cda9a1e 100644 --- a/tests/Feature/InvoiceEmailTest.php +++ b/tests/Feature/InvoiceEmailTest.php @@ -11,14 +11,15 @@ namespace Tests\Feature; +use Tests\TestCase; +use Tests\MockAccountData; use App\Jobs\Entity\EmailEntity; +use Illuminate\Support\Facades\Event; use App\Utils\Traits\GeneratesCounter; use Illuminate\Database\Eloquent\Model; -use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Support\Facades\Session; -use Tests\MockAccountData; -use Tests\TestCase; use Illuminate\Validation\ValidationException; +use Illuminate\Foundation\Testing\DatabaseTransactions; /** * @test @@ -118,7 +119,8 @@ class InvoiceEmailTest extends TestCase if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); - $this->expectsJobs(EmailEntity::class); + Event::fake(); + Event::assertDispatched(EmailEntity::class); } }); @@ -146,7 +148,10 @@ class InvoiceEmailTest extends TestCase if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); - $this->expectsJobs(EmailEntity::class); + +Event::fake(); +Event::assertDispatched(EmailEntity::class); + } }); @@ -174,7 +179,10 @@ class InvoiceEmailTest extends TestCase if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); - $this->expectsJobs(EmailEntity::class); + +Event::fake(); +Event::assertDispatched(EmailEntity::class); + } }); @@ -197,7 +205,10 @@ class InvoiceEmailTest extends TestCase if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); - $this->expectsJobs(EmailEntity::class); + +Event::fake(); +Event::assertDispatched(EmailEntity::class); + } }); diff --git a/tests/Feature/PaymentTest.php b/tests/Feature/PaymentTest.php index 48c10689645d..7a69e0b0a3ab 100644 --- a/tests/Feature/PaymentTest.php +++ b/tests/Feature/PaymentTest.php @@ -26,7 +26,6 @@ use App\Models\Payment; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Session; use Illuminate\Validation\ValidationException; @@ -42,7 +41,6 @@ class PaymentTest extends TestCase use MakesHash; use DatabaseTransactions; use MockAccountData; - use WithoutEvents; protected function setUp() :void { diff --git a/tests/Feature/PaymentV2Test.php b/tests/Feature/PaymentV2Test.php index 3365b42adf3f..22a5b83919e5 100644 --- a/tests/Feature/PaymentV2Test.php +++ b/tests/Feature/PaymentV2Test.php @@ -23,7 +23,6 @@ use App\Factory\InvoiceItemFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Session; use Illuminate\Validation\ValidationException; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Foundation\Testing\DatabaseTransactions; @@ -36,7 +35,6 @@ class PaymentV2Test extends TestCase use MakesHash; use DatabaseTransactions; use MockAccountData; - use WithoutEvents; public $faker; diff --git a/tests/Feature/Payments/CreditPaymentTest.php b/tests/Feature/Payments/CreditPaymentTest.php index 2e25dfebe1d3..465a3d7f0cc6 100644 --- a/tests/Feature/Payments/CreditPaymentTest.php +++ b/tests/Feature/Payments/CreditPaymentTest.php @@ -20,7 +20,6 @@ use App\Models\Payment; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Session; use Illuminate\Validation\ValidationException; @@ -35,7 +34,6 @@ class CreditPaymentTest extends TestCase use MakesHash; use DatabaseTransactions; use MockUnitData; - use WithoutEvents; protected function setUp() :void { diff --git a/tests/Feature/Payments/StorePaymentValidationTest.php b/tests/Feature/Payments/StorePaymentValidationTest.php index 72613a0680db..f4de6e935ed6 100644 --- a/tests/Feature/Payments/StorePaymentValidationTest.php +++ b/tests/Feature/Payments/StorePaymentValidationTest.php @@ -14,7 +14,6 @@ namespace Tests\Feature\Payments; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Session; use Illuminate\Validation\ValidationException; @@ -29,7 +28,6 @@ class StorePaymentValidationTest extends TestCase use MakesHash; use DatabaseTransactions; use MockAccountData; - use WithoutEvents; protected function setUp() :void { diff --git a/tests/Feature/Payments/UnappliedPaymentDeleteTest.php b/tests/Feature/Payments/UnappliedPaymentDeleteTest.php index 1803279c9951..b68934fb18ba 100644 --- a/tests/Feature/Payments/UnappliedPaymentDeleteTest.php +++ b/tests/Feature/Payments/UnappliedPaymentDeleteTest.php @@ -17,7 +17,6 @@ use App\Models\Invoice; use App\Models\Payment; use App\Utils\Traits\MakesHash; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Validation\ValidationException; use Tests\MockUnitData; @@ -31,8 +30,7 @@ class UnappliedPaymentDeleteTest extends TestCase use MakesHash; use DatabaseTransactions; use MockUnitData; - use WithoutEvents; - + protected function setUp() :void { parent::setUp(); diff --git a/tests/Feature/Payments/UnappliedPaymentRefundTest.php b/tests/Feature/Payments/UnappliedPaymentRefundTest.php index 04f4cb63bc13..b710be70fec2 100644 --- a/tests/Feature/Payments/UnappliedPaymentRefundTest.php +++ b/tests/Feature/Payments/UnappliedPaymentRefundTest.php @@ -14,7 +14,6 @@ namespace Tests\Feature\Payments; use App\Models\Payment; use App\Utils\Traits\MakesHash; use Illuminate\Foundation\Testing\DatabaseTransactions; -use Illuminate\Foundation\Testing\WithoutEvents; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Validation\ValidationException; use Tests\MockUnitData; @@ -28,7 +27,6 @@ class UnappliedPaymentRefundTest extends TestCase use MakesHash; use DatabaseTransactions; use MockUnitData; - use WithoutEvents; protected function setUp() :void { diff --git a/tests/Feature/Scheduler/ScheduleEntityTest.php b/tests/Feature/Scheduler/ScheduleEntityTest.php index f60a71ea1b47..3bb8e36d8140 100644 --- a/tests/Feature/Scheduler/ScheduleEntityTest.php +++ b/tests/Feature/Scheduler/ScheduleEntityTest.php @@ -21,11 +21,6 @@ use App\Models\RecurringInvoice; use App\Factory\SchedulerFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Session; -use App\DataMapper\Schedule\EmailStatement; -use App\Services\Scheduler\SchedulerService; -use Illuminate\Validation\ValidationException; -use Illuminate\Foundation\Testing\WithoutEvents; -use App\Services\Scheduler\EmailStatementService; use Illuminate\Routing\Middleware\ThrottleRequests; /** @@ -36,7 +31,6 @@ class ScheduleEntityTest extends TestCase { use MakesHash; use MockAccountData; - use WithoutEvents; protected function setUp(): void { diff --git a/tests/Feature/Scheduler/SchedulerTest.php b/tests/Feature/Scheduler/SchedulerTest.php index 6cafea26ef54..82796c7a18af 100644 --- a/tests/Feature/Scheduler/SchedulerTest.php +++ b/tests/Feature/Scheduler/SchedulerTest.php @@ -23,7 +23,6 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Session; use App\DataMapper\Schedule\EmailStatement; use Illuminate\Validation\ValidationException; -use Illuminate\Foundation\Testing\WithoutEvents; use App\Services\Scheduler\EmailStatementService; use App\Services\Scheduler\EmailReport; use Illuminate\Foundation\Testing\DatabaseTransactions; @@ -37,7 +36,6 @@ class SchedulerTest extends TestCase { use MakesHash; use MockAccountData; - use WithoutEvents; use DatabaseTransactions; protected $faker; diff --git a/tests/Feature/UpdatePaymentTest.php b/tests/Feature/UpdatePaymentTest.php index 7c89e86afcb6..9b7054b7f563 100644 --- a/tests/Feature/UpdatePaymentTest.php +++ b/tests/Feature/UpdatePaymentTest.php @@ -33,7 +33,6 @@ class UpdatePaymentTest extends TestCase use MakesHash; use DatabaseTransactions; use MockAccountData; - use WithoutEvents; public $faker; diff --git a/tests/Feature/VendorApiTest.php b/tests/Feature/VendorApiTest.php index d103afc5c1b8..7ef7db016350 100644 --- a/tests/Feature/VendorApiTest.php +++ b/tests/Feature/VendorApiTest.php @@ -15,6 +15,7 @@ use Tests\TestCase; use App\Utils\Ninja; use Tests\MockAccountData; use App\Utils\Traits\MakesHash; +use Illuminate\Support\Facades\Event; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Session; use App\Events\Vendor\VendorContactLoggedIn; @@ -64,7 +65,9 @@ class VendorApiTest extends TestCase event(new VendorContactLoggedIn($vc, $this->company, Ninja::eventVars())); - $this->expectsEvents([VendorContactLoggedIn::class]); + Event::fake(); + + Event::assertDispatched(VendorContactLoggedIn::class); // $vc->fresh(); // $v->fresh(); From e4aeedc36329b7aeb6dded487f9a30bc8566f9dd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 16:43:03 +1000 Subject: [PATCH 09/22] change Event => Bus --- tests/Feature/InvoiceEmailTest.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/Feature/InvoiceEmailTest.php b/tests/Feature/InvoiceEmailTest.php index a2af7cda9a1e..b95761272d50 100644 --- a/tests/Feature/InvoiceEmailTest.php +++ b/tests/Feature/InvoiceEmailTest.php @@ -20,6 +20,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Session; use Illuminate\Validation\ValidationException; use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Support\Facades\Bus; /** * @test @@ -115,16 +116,16 @@ class InvoiceEmailTest extends TestCase $this->invoice->save(); + Bus::fake(); + + $this->invoice->invitations->each(function ($invitation) { if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); - - Event::fake(); - Event::assertDispatched(EmailEntity::class); + Bus::assertDispatched(EmailEntity::class); } }); - $this->assertTrue(true); } public function testTemplateThemes() @@ -144,13 +145,14 @@ class InvoiceEmailTest extends TestCase $this->invoice->save(); + Bus::fake(); + $this->invoice->invitations->each(function ($invitation) { if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); -Event::fake(); -Event::assertDispatched(EmailEntity::class); + Bus::assertDispatched(EmailEntity::class); } }); @@ -174,14 +176,14 @@ Event::assertDispatched(EmailEntity::class); $this->invoice->setRelation('client', $this->client); $this->invoice->save(); + Bus::fake(); $this->invoice->invitations->each(function ($invitation) { if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); -Event::fake(); -Event::assertDispatched(EmailEntity::class); +Bus::assertDispatched(EmailEntity::class); } }); @@ -200,14 +202,14 @@ Event::assertDispatched(EmailEntity::class); $this->invoice->setRelation('client', $this->client); $this->invoice->save(); + Bus::fake(); $this->invoice->invitations->each(function ($invitation) { if ($invitation->contact->send_email && $invitation->contact->email) { EmailEntity::dispatch($invitation, $invitation->company); -Event::fake(); -Event::assertDispatched(EmailEntity::class); +Bus::assertDispatched(EmailEntity::class); } }); From a8aae52bfe91175ec18f44feb82db49e8a536506 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 17:41:24 +1000 Subject: [PATCH 10/22] Fixes for tests --- tests/Feature/VendorApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/VendorApiTest.php b/tests/Feature/VendorApiTest.php index 7ef7db016350..e517d2672574 100644 --- a/tests/Feature/VendorApiTest.php +++ b/tests/Feature/VendorApiTest.php @@ -63,9 +63,9 @@ class VendorApiTest extends TestCase $this->assertNull($v->last_login); $this->assertNull($vc->last_login); + Event::fake(); event(new VendorContactLoggedIn($vc, $this->company, Ninja::eventVars())); - Event::fake(); Event::assertDispatched(VendorContactLoggedIn::class); From dd4f38aeb16f5f3f039a9f15e9f6143809bd0113 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 19:31:25 +1000 Subject: [PATCH 11/22] v5.7.0 --- VERSION.txt | 2 +- app/Http/Controllers/BaseController.php | 2 +- app/Models/CompanyGateway.php | 2 +- composer.json | 2 +- composer.lock | 34 ++++++++++++------------- config/ninja.php | 4 +-- tests/Feature/InvoiceEmailTest.php | 23 ++++++++--------- 7 files changed, 34 insertions(+), 35 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index f3cb8c412987..3b867ccd76c3 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.6.31 \ No newline at end of file +5.7.0 \ No newline at end of file diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 51222f5ab43e..a8f43eae85a3 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -1065,7 +1065,7 @@ class BaseController extends Controller $data = $this->first_load; } } else { - $included = request()->input('include'); + $included = request()->input('include', ''); $included = explode(',', $included); foreach ($included as $include) { diff --git a/app/Models/CompanyGateway.php b/app/Models/CompanyGateway.php index d40c569ba05b..8525a88eb80e 100644 --- a/app/Models/CompanyGateway.php +++ b/app/Models/CompanyGateway.php @@ -411,7 +411,7 @@ class CompanyGateway extends BaseModel $fee = 0; - if ($fees_and_limits->adjust_fee_percent) { + if ($fees_and_limits->adjust_fee_percent ?? false) { $adjusted_fee = 0; if ($fees_and_limits->fee_amount) { diff --git a/composer.json b/composer.json index 42082bfb62c7..92c31140f2c1 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "authorizenet/authorizenet": "^2.0", "awobaz/compoships": "^2.1", "bacon/bacon-qr-code": "^2.0", - "beganovich/snappdf": "^3", + "beganovich/snappdf": "^4", "braintree/braintree_php": "^6.0", "checkout/checkout-sdk-php": "^3.0", "cleverit/ubl_invoice": "^1.3", diff --git a/composer.lock b/composer.lock index fea6971d7c21..899fef7f165a 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": "c6e70e26e10d4836ad93323a7efd7eb5", + "content-hash": "8e1e0864e98afc97b30e13631480c86b", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -674,24 +674,24 @@ }, { "name": "beganovich/snappdf", - "version": "v3.1.0", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/beganovich/snappdf.git", - "reference": "b2656c2c67be086b535cd13a704e27caaf5a7570" + "reference": "e3ba325281fa35faa139add57b6183e22ed71cc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beganovich/snappdf/zipball/b2656c2c67be086b535cd13a704e27caaf5a7570", - "reference": "b2656c2c67be086b535cd13a704e27caaf5a7570", + "url": "https://api.github.com/repos/beganovich/snappdf/zipball/e3ba325281fa35faa139add57b6183e22ed71cc1", + "reference": "e3ba325281fa35faa139add57b6183e22ed71cc1", "shasum": "" }, "require": { "ext-zip": "*", - "php": "^8.0|^8.1", - "symfony/console": "^6.0", - "symfony/filesystem": "^6.0", - "symfony/process": "^6.0" + "php": "^8.1|^8.2", + "symfony/console": "^6.2", + "symfony/filesystem": "^6.2", + "symfony/process": "^6.2" }, "require-dev": { "ext-fileinfo": "*", @@ -720,9 +720,9 @@ "description": "Convert webpages or HTML into the PDF file using Chromium or Google Chrome.", "support": { "issues": "https://github.com/beganovich/snappdf/issues", - "source": "https://github.com/beganovich/snappdf/tree/v3.1.0" + "source": "https://github.com/beganovich/snappdf/tree/v4.0.0" }, - "time": "2022-09-14T10:35:47+00:00" + "time": "2023-04-22T07:49:46+00:00" }, { "name": "braintree/braintree_php", @@ -2586,16 +2586,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.312.0", + "version": "v0.312.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "45d47fed73b28254c511882bc743b1690a99558d" + "reference": "d13797cf251ec0d62f00b70dfa8642aa9550900d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/45d47fed73b28254c511882bc743b1690a99558d", - "reference": "45d47fed73b28254c511882bc743b1690a99558d", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/d13797cf251ec0d62f00b70dfa8642aa9550900d", + "reference": "d13797cf251ec0d62f00b70dfa8642aa9550900d", "shasum": "" }, "require": { @@ -2624,9 +2624,9 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.312.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.312.1" }, - "time": "2023-08-14T00:56:12+00:00" + "time": "2023-08-21T00:52:13+00:00" }, { "name": "google/auth", diff --git a/config/ninja.php b/config/ninja.php index 233559f73bbf..646f456a9cd1 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION','5.6.31'), - 'app_tag' => env('APP_TAG','5.6.31'), + 'app_version' => env('APP_VERSION','5.7.0'), + 'app_tag' => env('APP_TAG','5.7.0'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/tests/Feature/InvoiceEmailTest.php b/tests/Feature/InvoiceEmailTest.php index b95761272d50..9bfcb5512402 100644 --- a/tests/Feature/InvoiceEmailTest.php +++ b/tests/Feature/InvoiceEmailTest.php @@ -11,16 +11,15 @@ namespace Tests\Feature; -use Tests\TestCase; -use Tests\MockAccountData; use App\Jobs\Entity\EmailEntity; -use Illuminate\Support\Facades\Event; use App\Utils\Traits\GeneratesCounter; use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Facades\Session; -use Illuminate\Validation\ValidationException; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Support\Facades\Bus; +use Illuminate\Support\Facades\Session; +use Illuminate\Validation\ValidationException; +use Tests\MockAccountData; +use Tests\TestCase; /** * @test @@ -51,10 +50,10 @@ class InvoiceEmailTest extends TestCase public function testTemplateValidation() { $data = [ - "body" => "hey what's up", - "entity" => 'invoice', - "entity_id"=> $this->invoice->hashed_id, - "subject"=> 'Reminder $number', + "body" => "hey what's up", + "entity" => 'invoice', + "entity_id"=> $this->invoice->hashed_id, + "subject"=> 'Reminder $number', "template"=> "first_custom" ]; @@ -152,7 +151,7 @@ class InvoiceEmailTest extends TestCase EmailEntity::dispatch($invitation, $invitation->company); - Bus::assertDispatched(EmailEntity::class); + Bus::assertDispatched(EmailEntity::class); } }); @@ -183,7 +182,7 @@ class InvoiceEmailTest extends TestCase EmailEntity::dispatch($invitation, $invitation->company); -Bus::assertDispatched(EmailEntity::class); + Bus::assertDispatched(EmailEntity::class); } }); @@ -209,7 +208,7 @@ Bus::assertDispatched(EmailEntity::class); EmailEntity::dispatch($invitation, $invitation->company); -Bus::assertDispatched(EmailEntity::class); + Bus::assertDispatched(EmailEntity::class); } }); From ab39a55eb1c98d82623d9b0cb08fbc2866642a7d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Aug 2023 20:56:06 +1000 Subject: [PATCH 12/22] Adjustment for Purchase Orders in Portal --- .../portal/ninja2020/components/livewire/pdf-slot.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php b/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php index d15f748c6e23..22e7e792c85e 100644 --- a/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php @@ -9,7 +9,7 @@ - @if($settings->enable_e_invoice && $entity_type == 'invoice') + @if($entity_type == 'invoice' && $settings->enable_e_invoice)