From 68fbf616599cf81e3339b1699d35344180d8b0e8 Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Fri, 21 Jun 2024 01:47:33 -0400 Subject: [PATCH 01/10] add add testing --- composer.json | 14 +- composer.lock | 3769 +++++++++++++++++++++++-------- phpunit.xml | 26 + src/Processor.php | 2 + tests/Feature/PopulatorTest.php | 5 + tests/Pest.php | 39 + tests/TestCase.php | 16 + 7 files changed, 2898 insertions(+), 973 deletions(-) create mode 100644 phpunit.xml create mode 100644 tests/Feature/PopulatorTest.php create mode 100644 tests/Pest.php create mode 100644 tests/TestCase.php diff --git a/composer.json b/composer.json index a57426e..5b34c73 100644 --- a/composer.json +++ b/composer.json @@ -13,20 +13,30 @@ "email": "stepan.mocjak@guava.cz" } ], - "require": {}, "require-dev": { - "orchestra/testbench": "^8.0" + "orchestra/testbench": "^8.0", + "pestphp/pest": "^2.34" }, "autoload": { "psr-4": { "Guava\\LaravelPopulator\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, "extra": { "laravel": { "providers": [ "Guava\\LaravelPopulator\\PopulatorServiceProvider" ] } + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true + } } } diff --git a/composer.lock b/composer.lock index 2b43afc..356a43f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,31 +4,124 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "42f543cdc813cad0c65e50f93faf7866", + "content-hash": "b43b6df0dc5e3ebaae135846a11fcd02", "packages": [], "packages-dev": [ + { + "name": "brianium/paratest", + "version": "v7.4.3", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", + "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "fidry/cpu-core-counter": "^1.1.0", + "jean85/pretty-package-versions": "^2.0.5", + "php": "~8.2.0 || ~8.3.0", + "phpunit/php-code-coverage": "^10.1.11 || ^11.0.0", + "phpunit/php-file-iterator": "^4.1.0 || ^5.0.0", + "phpunit/php-timer": "^6.0.0 || ^7.0.0", + "phpunit/phpunit": "^10.5.9 || ^11.0.3", + "sebastian/environment": "^6.0.1 || ^7.0.0", + "symfony/console": "^6.4.3 || ^7.0.3", + "symfony/process": "^6.4.3 || ^7.0.3" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0.0", + "ext-pcov": "*", + "ext-posix": "*", + "phpstan/phpstan": "^1.10.58", + "phpstan/phpstan-deprecation-rules": "^1.1.4", + "phpstan/phpstan-phpunit": "^1.3.15", + "phpstan/phpstan-strict-rules": "^1.5.2", + "squizlabs/php_codesniffer": "^3.9.0", + "symfony/filesystem": "^6.4.3 || ^7.0.3" + }, + "bin": [ + "bin/paratest", + "bin/paratest.bat", + "bin/paratest_for_phpstorm" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v7.4.3" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2024-02-20T07:24:02+00:00" + }, { "name": "brick/math", - "version": "0.10.2", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f" + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.4 || ^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "4.25.0" + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" }, "type": "library", "autoload": { @@ -48,12 +141,17 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.10.2" + "source": "https://github.com/brick/math/tree/0.12.1" }, "funding": [ { @@ -61,7 +159,157 @@ "type": "github" } ], - "time": "2022-08-10T22:54:19+00:00" + "time": "2023-11-29T23:19:16+00:00" + }, + { + "name": "carbonphp/carbon-doctrine-types", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "doctrine/dbal": "<3.7.0 || >=4.0.0" + }, + "require-dev": { + "doctrine/dbal": "^3.7.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2023-12-11T17:09:12+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" }, { "name": "dflydev/dot-access-data", @@ -138,30 +386,77 @@ }, "time": "2022-10-27T11:44:00+00:00" }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, { "name": "doctrine/inflector", - "version": "2.0.6", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { @@ -211,7 +506,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.6" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -227,31 +522,31 @@ "type": "tidelift" } ], - "time": "2022-10-20T09:10:12+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "doctrine/lexer", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", "shasum": "" }, "require": { "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" + "vimeo/psalm": "^5.21" }, "type": "library", "autoload": { @@ -288,7 +583,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" + "source": "https://github.com/doctrine/lexer/tree/3.0.1" }, "funding": [ { @@ -304,20 +599,20 @@ "type": "tidelift" } ], - "time": "2022-12-15T16:57:16+00:00" + "time": "2024-02-05T11:56:58+00:00" }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", "shasum": "" }, "require": { @@ -357,7 +652,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3" }, "funding": [ { @@ -365,20 +660,20 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2023-08-10T19:36:49+00:00" }, { "name": "egulias/email-validator", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff" + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/3a85486b709bc384dae8eb78fb2eec649bdb64ff", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", "shasum": "" }, "require": { @@ -387,8 +682,8 @@ "symfony/polyfill-intl-idn": "^1.26" }, "require-dev": { - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^4.30" + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -424,7 +719,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/4.0.1" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" }, "funding": [ { @@ -432,20 +727,20 @@ "type": "github" } ], - "time": "2023-01-14T14:17:03+00:00" + "time": "2023-10-06T06:47:41+00:00" }, { "name": "fakerphp/faker", - "version": "v1.21.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d" + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/92efad6a967f0b79c499705c69b662f738cc9e4d", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b", + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b", "shasum": "" }, "require": { @@ -471,11 +766,6 @@ "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -498,42 +788,42 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.21.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.23.1" }, - "time": "2022-12-13T13:54:32+00:00" + "time": "2024-01-02T13:46:09+00:00" }, { - "name": "fruitcake/php-cors", - "version": "v1.2.0", + "name": "fidry/cpu-core-counter", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/fruitcake/php-cors.git", - "reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/58571acbaa5f9f462c9c77e911700ac66f446d4e", - "reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", "shasum": "" }, "require": { - "php": "^7.4|^8.0", - "symfony/http-foundation": "^4.4|^5.4|^6" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^9", - "squizlabs/php_codesniffer": "^3.5" + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.1-dev" - } - }, "autoload": { "psr-4": { - "Fruitcake\\Cors\\": "src/" + "Fidry\\CpuCoreCounter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -542,62 +832,63 @@ ], "authors": [ { - "name": "Fruitcake", - "homepage": "https://fruitcake.nl" - }, - { - "name": "Barryvdh", - "email": "barryvdh@gmail.com" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", - "homepage": "https://github.com/fruitcake/php-cors", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "cors", - "laravel", - "symfony" + "CPU", + "core" ], "support": { - "issues": "https://github.com/fruitcake/php-cors/issues", - "source": "https://github.com/fruitcake/php-cors/tree/v1.2.0" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" }, "funding": [ { - "url": "https://fruitcake.nl", - "type": "custom" - }, - { - "url": "https://github.com/barryvdh", + "url": "https://github.com/theofidry", "type": "github" } ], - "time": "2022-02-20T15:07:15+00:00" + "time": "2024-02-07T09:43:46+00:00" }, { - "name": "graham-campbell/result-type", - "version": "v1.1.0", + "name": "filp/whoops", + "version": "2.15.4", "source": { "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" + "url": "https://github.com/filp/whoops.git", + "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", + "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546", + "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" + "php": "^5.5.9 || ^7.0 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, "autoload": { "psr-4": { - "GrahamCampbell\\ResultType\\": "src/" + "Whoops\\": "src/Whoops/" } }, "notification-url": "https://packagist.org/downloads/", @@ -606,63 +897,194 @@ ], "authors": [ { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" } ], - "description": "An Implementation Of The Result Type", + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Result Type", - "Result-Type", - "result" + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" ], "support": { - "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.15.4" }, "funding": [ { - "url": "https://github.com/GrahamCampbell", + "url": "https://github.com/denis-sokolov", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" } ], - "time": "2022-07-30T15:56:11+00:00" + "time": "2023-11-03T12:00:00+00:00" }, { - "name": "guzzlehttp/psr7", - "version": "2.4.3", + "name": "fruitcake/php-cors", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "67c26b443f348a51926030c83481b85718457d3d" + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", - "reference": "67c26b443f348a51926030c83481b85718457d3d", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/3d158f36e7875e2f040f37bc0573956240a5a38b", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3.0" + "php": "^7.4|^8.0", + "symfony/http-foundation": "^4.4|^5.4|^6|^7" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barryvdh", + "email": "barryvdh@gmail.com" + } + ], + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", + "keywords": [ + "cors", + "laravel", + "symfony" + ], + "support": { + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2023-10-12T05:21:21+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", + "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2023-11-12T22:16:48+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", + "bamarni/composer-bin-plugin": "^1.8.2", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "phpunit/phpunit": "^8.5.36 || ^9.6.15" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -672,9 +1094,6 @@ "bamarni-bin": { "bin-links": true, "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" } }, "autoload": { @@ -736,7 +1155,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.3" + "source": "https://github.com/guzzle/psr7/tree/2.6.2" }, "funding": [ { @@ -752,34 +1171,36 @@ "type": "tidelift" } ], - "time": "2022-10-26T14:07:24+00:00" + "time": "2023-12-03T20:05:35+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.1", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2" + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/b945d74a55a25a949158444f09ec0d3c120d69e2", - "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/ecea8feef63bd4fef1f037ecb288386999ecc11c", + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "symfony/polyfill-php80": "^1.17" + "symfony/polyfill-php80": "^1.24" }, "require-dev": { - "phpunit/phpunit": "^8.5.19 || ^9.5.8", + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", "uri-template/tests": "1.0.0" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.0-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -820,7 +1241,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.1" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.3" }, "funding": [ { @@ -836,7 +1257,7 @@ "type": "tidelift" } ], - "time": "2021-10-07T12:57:01+00:00" + "time": "2023-12-03T19:50:20+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -889,22 +1310,81 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "2.0.6", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0.0", + "php": "^7.1|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^7.5|^8.5|^9.4", + "vimeo/psalm": "^4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A library to get pretty versions strings of installed dependencies", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + }, + "time": "2024-03-08T09:58:59+00:00" + }, { "name": "laravel/framework", - "version": "v10.0.0", + "version": "v10.48.13", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "be2ddb5c31b0b9ebc2738d9f37a9d4c960aa3199" + "reference": "2c6816d697a4362c09c066118addda251b70b98a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/be2ddb5c31b0b9ebc2738d9f37a9d4c960aa3199", - "reference": "be2ddb5c31b0b9ebc2738d9f37a9d4c960aa3199", + "url": "https://api.github.com/repos/laravel/framework/zipball/2c6816d697a4362c09c066118addda251b70b98a", + "reference": "2c6816d697a4362c09c066118addda251b70b98a", "shasum": "" }, "require": { - "brick/math": "^0.9.3|^0.10.2|^0.11", + "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12", "composer-runtime-api": "^2.2", "doctrine/inflector": "^2.0.5", "dragonmantank/cron-expression": "^3.3.2", @@ -918,11 +1398,12 @@ "ext-tokenizer": "*", "fruitcake/php-cors": "^1.2", "guzzlehttp/uri-template": "^1.0", + "laravel/prompts": "^0.1.9", "laravel/serializable-closure": "^1.3", "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", "monolog/monolog": "^3.0", - "nesbot/carbon": "^2.62.1", + "nesbot/carbon": "^2.67", "nunomaduro/termwind": "^1.13", "php": "^8.1", "psr/container": "^1.1.1|^2.0.1", @@ -932,7 +1413,7 @@ "symfony/console": "^6.2", "symfony/error-handler": "^6.2", "symfony/finder": "^6.2", - "symfony/http-foundation": "^6.2", + "symfony/http-foundation": "^6.4", "symfony/http-kernel": "^6.2", "symfony/mailer": "^6.2", "symfony/mime": "^6.2", @@ -945,6 +1426,10 @@ "voku/portable-ascii": "^2.0" }, "conflict": { + "carbonphp/carbon-doctrine-types": ">=3.0", + "doctrine/dbal": ">=4.0", + "mockery/mockery": "1.6.8", + "phpunit/phpunit": ">=11.0.0", "tightenco/collect": "<5.5.33" }, "provide": { @@ -999,14 +1484,15 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^8.0", + "nyholm/psr7": "^1.2", + "orchestra/testbench-core": "^8.23.4", "pda/pheanstalk": "^4.0", - "phpstan/phpdoc-parser": "^1.15", "phpstan/phpstan": "^1.4.7", - "phpunit/phpunit": "^9.6.0 || ^10.0.7", + "phpunit/phpunit": "^10.0.7", "predis/predis": "^2.0.2", "symfony/cache": "^6.2", - "symfony/http-client": "^6.2.4" + "symfony/http-client": "^6.2.4", + "symfony/psr-http-message-bridge": "^2.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", @@ -1034,7 +1520,7 @@ "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).", + "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).", @@ -1055,6 +1541,7 @@ "files": [ "src/Illuminate/Collections/helpers.php", "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" ], @@ -1087,20 +1574,78 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-02-14T15:12:47+00:00" + "time": "2024-06-18T16:46:35+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.1.24", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "409b0b4305273472f3754826e68f4edbd0150149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/409b0b4305273472f3754826e68f4edbd0150149", + "reference": "409b0b4305273472f3754826e68f4edbd0150149", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/collections": "^10.0|^11.0", + "php": "^8.1", + "symfony/console": "^6.2|^7.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-mockery": "^1.1" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Add beautiful and user-friendly forms to your command-line applications.", + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.1.24" + }, + "time": "2024-06-17T13:58:22+00:00" }, { "name": "laravel/serializable-closure", - "version": "v1.3.0", + "version": "v1.3.3", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" + "reference": "3dbf8a8e914634c48d389c1234552666b3d43754" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754", + "reference": "3dbf8a8e914634c48d389c1234552666b3d43754", "shasum": "" }, "require": { @@ -1147,20 +1692,86 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-01-30T18:31:20+00:00" + "time": "2023-11-08T14:08:06+00:00" + }, + { + "name": "laravel/tinker", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/502e0fe3f0415d06d5db1f83a472f0f3b754bafe", + "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe", + "shasum": "" + }, + "require": { + "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "php": "^7.2.5|^8.0", + "psy/psysh": "^0.11.1|^0.12.0", + "symfony/var-dumper": "^4.3.4|^5.0|^6.0|^7.0" + }, + "require-dev": { + "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.8|^9.3.3" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0|^11.0)." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Tinker\\TinkerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Tinker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Powerful REPL for the Laravel framework.", + "keywords": [ + "REPL", + "Tinker", + "laravel", + "psysh" + ], + "support": { + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/v2.9.0" + }, + "time": "2024-01-04T16:10:04+00:00" }, { "name": "league/commonmark", - "version": "2.3.9", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5" + "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c1e114f74e518daca2729ea8c4bf1167038fa4b5", - "reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/91c24291965bd6d7c46c46a12ba7492f83b1cadf", + "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf", "shasum": "" }, "require": { @@ -1173,7 +1784,7 @@ }, "require-dev": { "cebe/markdown": "^1.0", - "commonmark/cmark": "0.30.0", + "commonmark/cmark": "0.30.3", "commonmark/commonmark.js": "0.30.0", "composer/package-versions-deprecated": "^1.8", "embed/embed": "^4.4", @@ -1183,10 +1794,10 @@ "michelf/php-markdown": "^1.4 || ^2.0", "nyholm/psr7": "^1.5", "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.21", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3 | ^6.0", - "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", + "symfony/finder": "^5.3 | ^6.0 || ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 || ^7.0", "unleashedtech/php-coding-standard": "^3.1.1", "vimeo/psalm": "^4.24.0 || ^5.0.0" }, @@ -1196,7 +1807,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" } }, "autoload": { @@ -1253,7 +1864,7 @@ "type": "tidelift" } ], - "time": "2023-02-15T14:07:24+00:00" + "time": "2024-02-02T11:59:32+00:00" }, { "name": "league/config", @@ -1339,23 +1950,26 @@ }, { "name": "league/flysystem", - "version": "3.12.2", + "version": "3.28.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f6377c709d2275ed6feaf63e44be7a7162b0e77f" + "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f6377c709d2275ed6feaf63e44be7a7162b0e77f", - "reference": "f6377c709d2275ed6feaf63e44be7a7162b0e77f", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c", + "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c", "shasum": "" }, "require": { + "league/flysystem-local": "^3.0.0", "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", "aws/aws-sdk-php": "3.209.31 || 3.210.0", "guzzlehttp/guzzle": "<7.0", "guzzlehttp/ringphp": "<1.1.1", @@ -1363,20 +1977,23 @@ "symfony/http-client": "<5.2" }, "require-dev": { - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.1", - "aws/aws-sdk-php": "^3.220.0", + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", "composer/semver": "^3.0", "ext-fileinfo": "*", "ext-ftp": "*", + "ext-mongodb": "^1.3", "ext-zip": "*", "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.14", - "phpstan/phpstan": "^0.12.26", - "phpunit/phpunit": "^9.5.11", - "sabre/dav": "^4.3.1" + "mongodb/mongodb": "^1.2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" }, "type": "library", "autoload": { @@ -1410,46 +2027,81 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.12.2" + "source": "https://github.com/thephpleague/flysystem/tree/3.28.0" }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" + "time": "2024-05-22T10:09:12+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.28.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/13f22ea8be526ea58c2ddff9e158ef7c296e4f40", + "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" } ], - "time": "2023-01-19T12:02:19+00:00" + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "source": "https://github.com/thephpleague/flysystem-local/tree/3.28.0" + }, + "time": "2024-05-06T20:05:52+00:00" }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -1470,7 +2122,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" }, "funding": [ { @@ -1482,42 +2134,42 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2024-01-28T23:22:08+00:00" }, { "name": "mockery/mockery", - "version": "1.5.1", + "version": "1.6.12", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { - "psr-0": { - "Mockery": "library/" + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -1528,12 +2180,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -1551,23 +2211,26 @@ "testing" ], "support": { + "docs": "https://docs.mockery.io/", "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.1" + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2022-09-07T15:32:08+00:00" + "time": "2024-05-16T03:13:13+00:00" }, { "name": "monolog/monolog", - "version": "3.3.1", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "9b5daeaffce5b926cac47923798bba91059e60e2" + "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/9b5daeaffce5b926cac47923798bba91059e60e2", - "reference": "9b5daeaffce5b926cac47923798bba91059e60e2", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", + "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", "shasum": "" }, "require": { @@ -1582,7 +2245,7 @@ "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "graylog2/gelf-php": "^1.4.2 || ^2.0", "guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", @@ -1590,7 +2253,7 @@ "phpstan/phpstan": "^1.9", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "^9.5.26", + "phpunit/phpunit": "^10.5.17", "predis/predis": "^1.1 || ^2", "ruflin/elastica": "^7", "symfony/mailer": "^5.4 || ^6", @@ -1643,7 +2306,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.3.1" + "source": "https://github.com/Seldaek/monolog/tree/3.6.0" }, "funding": [ { @@ -1655,20 +2318,20 @@ "type": "tidelift" } ], - "time": "2023-02-06T13:46:10+00:00" + "time": "2024-04-12T21:02:21+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -1676,11 +2339,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -1706,7 +2370,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -1714,32 +2378,37 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nesbot/carbon", - "version": "2.66.0", + "version": "2.72.5", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "496712849902241f04902033b0441b269effe001" + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/496712849902241f04902033b0441b269effe001", - "reference": "496712849902241f04902033b0441b269effe001", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", "shasum": "" }, "require": { + "carbonphp/carbon-doctrine-types": "*", "ext-json": "*", "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", + "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", + "doctrine/orm": "^2.7 || ^3.0", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "ondrejmirtes/better-reflection": "*", @@ -1756,8 +2425,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ @@ -1816,35 +2485,35 @@ "type": "tidelift" } ], - "time": "2023-01-29T18:53:47+00:00" + "time": "2024-06-03T19:18:41+00:00" }, { "name": "nette/schema", - "version": "v1.2.3", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" + "reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "url": "https://api.github.com/repos/nette/schema/zipball/a6d3a6d1f545f01ef38e60f375d1cf1f4de98188", + "reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188", "shasum": "" }, "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.3" }, "require-dev": { - "nette/tester": "^2.3 || ^2.4", + "nette/tester": "^2.4", "phpstan/phpstan-nette": "^1.0", - "tracy/tracy": "^2.7" + "tracy/tracy": "^2.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1876,26 +2545,26 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" + "source": "https://github.com/nette/schema/tree/v1.3.0" }, - "time": "2022-10-13T01:24:26+00:00" + "time": "2023-12-11T11:54:22+00:00" }, { "name": "nette/utils", - "version": "v4.0.0", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": ">=8.0 <8.4" }, "conflict": { "nette/finder": "<3", @@ -1903,7 +2572,7 @@ }, "require-dev": { "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", + "nette/tester": "^2.5", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.9" }, @@ -1913,8 +2582,7 @@ "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-json": "to use Nette\\Utils\\Json", "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" }, "type": "library", "extra": { @@ -1963,31 +2631,33 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v4.0.4" }, - "time": "2023-02-02T10:41:53+00:00" + "time": "2024-01-17T16:50:36+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -1995,7 +2665,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2019,9 +2689,105 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + }, + "time": "2024-03-05T20:51:40+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v7.10.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "49ec67fa7b002712da8526678abd651c09f375b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/49ec67fa7b002712da8526678abd651c09f375b2", + "reference": "49ec67fa7b002712da8526678abd651c09f375b2", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.15.3", + "nunomaduro/termwind": "^1.15.1", + "php": "^8.1.0", + "symfony/console": "^6.3.4" + }, + "conflict": { + "laravel/framework": ">=11.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.3.0", + "laravel/framework": "^10.28.0", + "laravel/pint": "^1.13.3", + "laravel/sail": "^1.25.0", + "laravel/sanctum": "^3.3.1", + "laravel/tinker": "^2.8.2", + "nunomaduro/larastan": "^2.6.4", + "orchestra/testbench-core": "^8.13.0", + "pestphp/pest": "^2.23.2", + "phpunit/phpunit": "^10.4.1", + "sebastian/environment": "^6.0.1", + "spatie/laravel-ignition": "^2.3.1" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" }, - "time": "2023-01-16T22:05:37+00:00" + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2023-10-11T15:45:01+00:00" }, { "name": "nunomaduro/termwind", @@ -2109,29 +2875,176 @@ ], "time": "2023-02-08T01:06:31+00:00" }, + { + "name": "orchestra/canvas", + "version": "v8.11.9", + "source": { + "type": "git", + "url": "https://github.com/orchestral/canvas.git", + "reference": "9bed1ce6084af2ce166e9ea1cb160ff22dc94a6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/orchestral/canvas/zipball/9bed1ce6084af2ce166e9ea1cb160ff22dc94a6d", + "reference": "9bed1ce6084af2ce166e9ea1cb160ff22dc94a6d", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "composer/semver": "^3.0", + "illuminate/console": "^10.48.4", + "illuminate/database": "^10.48.4", + "illuminate/filesystem": "^10.48.4", + "illuminate/support": "^10.48.4", + "orchestra/canvas-core": "^8.10.2", + "orchestra/testbench-core": "^8.19", + "php": "^8.1", + "symfony/polyfill-php83": "^1.28", + "symfony/yaml": "^6.2" + }, + "require-dev": { + "laravel/framework": "^10.48.4", + "laravel/pint": "^1.6", + "mockery/mockery": "^1.5.1", + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^10.5", + "spatie/laravel-ray": "^1.33" + }, + "bin": [ + "canvas" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.0-dev" + }, + "laravel": { + "providers": [ + "Orchestra\\Canvas\\LaravelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Orchestra\\Canvas\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "Code Generators for Laravel Applications and Packages", + "support": { + "issues": "https://github.com/orchestral/canvas/issues", + "source": "https://github.com/orchestral/canvas/tree/v8.11.9" + }, + "time": "2024-06-18T08:26:09+00:00" + }, + { + "name": "orchestra/canvas-core", + "version": "v8.10.2", + "source": { + "type": "git", + "url": "https://github.com/orchestral/canvas-core.git", + "reference": "3af8fb6b1ebd85903ba5d0e6df1c81aedacfedfc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/orchestral/canvas-core/zipball/3af8fb6b1ebd85903ba5d0e6df1c81aedacfedfc", + "reference": "3af8fb6b1ebd85903ba5d0e6df1c81aedacfedfc", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "composer/semver": "^3.0", + "illuminate/console": "^10.38.1", + "illuminate/filesystem": "^10.38.1", + "php": "^8.1", + "symfony/polyfill-php83": "^1.28" + }, + "conflict": { + "orchestra/canvas": "<8.11.0", + "orchestra/testbench-core": "<8.2.0" + }, + "require-dev": { + "laravel/framework": "^10.38.1", + "laravel/pint": "^1.6", + "mockery/mockery": "^1.5.1", + "orchestra/testbench-core": "^8.19", + "phpstan/phpstan": "^1.10.6", + "phpunit/phpunit": "^10.1", + "symfony/yaml": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.0-dev" + }, + "laravel": { + "providers": [ + "Orchestra\\Canvas\\Core\\LaravelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Orchestra\\Canvas\\Core\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "Code Generators Builder for Laravel Applications and Packages", + "support": { + "issues": "https://github.com/orchestral/canvas/issues", + "source": "https://github.com/orchestral/canvas-core/tree/v8.10.2" + }, + "time": "2023-12-28T01:27:59+00:00" + }, { "name": "orchestra/testbench", - "version": "v8.0.0", + "version": "v8.23.2", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "800f9b91d6ce9d6fd0c5775463e0aa7d536b52d2" + "reference": "c9f89b66aaa245a2e36f046aa431587ba46a3f2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/800f9b91d6ce9d6fd0c5775463e0aa7d536b52d2", - "reference": "800f9b91d6ce9d6fd0c5775463e0aa7d536b52d2", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/c9f89b66aaa245a2e36f046aa431587ba46a3f2e", + "reference": "c9f89b66aaa245a2e36f046aa431587ba46a3f2e", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "fakerphp/faker": "^1.21", - "laravel/framework": ">=10.0.0 <10.1.0", + "laravel/framework": "^10.48.10", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": ">=8.0.0 <8.1.0", + "orchestra/testbench-core": "^8.24.3", + "orchestra/workbench": "^1.4.1 || ^8.5", "php": "^8.1", - "phpunit/phpunit": "^9.6 || ^10.0.7", - "spatie/laravel-ray": "^1.32", + "phpunit/phpunit": "^9.6 || ^10.1", "symfony/process": "^6.2", "symfony/yaml": "^6.2", "vlucas/phpdotenv": "^5.4.1" @@ -2153,75 +3066,573 @@ "keywords": [ "BDD", "TDD", + "dev", "laravel", - "orchestra-platform", - "orchestral", + "laravel-packages", "testing" ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v8.0.0" + "source": "https://github.com/orchestral/testbench/tree/v8.23.2" }, - "time": "2023-02-14T15:35:53+00:00" + "time": "2024-06-04T12:24:55+00:00" }, { "name": "orchestra/testbench-core", - "version": "v8.0.0", + "version": "v8.24.3", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "4b9e7932665c52889a6727e4a6235affea8bb925" + "reference": "c4daf2f1929242f4e4cb33b5ebdaaf631df30a46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/4b9e7932665c52889a6727e4a6235affea8bb925", - "reference": "4b9e7932665c52889a6727e4a6235affea8bb925", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/c4daf2f1929242f4e4cb33b5ebdaaf631df30a46", + "reference": "c4daf2f1929242f4e4cb33b5ebdaaf631df30a46", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", - "php": "^8.1" + "php": "^8.1", + "symfony/polyfill-php83": "^1.28" + }, + "conflict": { + "brianium/paratest": "<6.4.0 || >=7.0.0 <7.1.4 || >=8.0.0", + "laravel/framework": "<10.48.2 || >=11.0.0", + "nunomaduro/collision": "<6.4.0 || >=7.0.0 <7.4.0 || >=8.0.0", + "orchestra/testbench-dusk": "<8.21.0 || >=9.0.0", + "orchestra/workbench": "<1.0.0", + "phpunit/phpunit": "<9.6.0 || >=10.6.0" }, "require-dev": { "fakerphp/faker": "^1.21", - "laravel/framework": "^10.0", - "laravel/pint": "^1.4", + "laravel/framework": "^10.48.2", + "laravel/pint": "^1.6", "mockery/mockery": "^1.5.1", - "orchestra/canvas": "^8.0", - "phpstan/phpstan": "^1.9.14", - "phpunit/phpunit": "^9.6 || ^10.0.7", - "spatie/laravel-ray": "^1.32", + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^10.1", + "spatie/laravel-ray": "^1.32.4", "symfony/process": "^6.2", "symfony/yaml": "^6.2", "vlucas/phpdotenv": "^5.4.1" }, "suggest": { - "brianium/paratest": "Allow using parallel tresting (^6.4 || ^7.0).", + "brianium/paratest": "Allow using parallel testing (^6.4 || ^7.1.4).", + "ext-pcntl": "Required to use all features of the console signal trapping.", "fakerphp/faker": "Allow using Faker for testing (^1.21).", - "laravel/framework": "Required for testing (^10.0).", + "laravel/framework": "Required for testing (^10.48.2).", "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", - "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.4 || ^7.0).", + "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.4 || ^7.4).", "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^8.0).", "orchestra/testbench-dusk": "Allow using Laravel Dusk for testing (^8.0).", - "phpunit/phpunit": "Allow using PHPUnit for testing (^9.6 || ^10.0.7).", - "symfony/yaml": "Required for CLI Commander (^6.2).", - "vlucas/phpdotenv": "Required for CLI Commander (^5.4.1)." + "phpunit/phpunit": "Allow using PHPUnit for testing (^9.6 || ^10.1).", + "symfony/process": "Required to use Orchestra\\Testbench\\remote function (^6.2).", + "symfony/yaml": "Required for Testbench CLI (^6.2).", + "vlucas/phpdotenv": "Required for Testbench CLI (^5.4.1)." }, "bin": [ "testbench" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.0-dev" + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Orchestra\\Testbench\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com", + "homepage": "https://github.com/crynobone" + } + ], + "description": "Testing Helper for Laravel Development", + "homepage": "https://packages.tools/testbench", + "keywords": [ + "BDD", + "TDD", + "dev", + "laravel", + "laravel-packages", + "testing" + ], + "support": { + "issues": "https://github.com/orchestral/testbench/issues", + "source": "https://github.com/orchestral/testbench-core" + }, + "time": "2024-06-04T05:00:04+00:00" + }, + { + "name": "orchestra/workbench", + "version": "v8.5.0", + "source": { + "type": "git", + "url": "https://github.com/orchestral/workbench.git", + "reference": "dce002c20de63b6bde74e0cae2ca558d031a8a17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/orchestral/workbench/zipball/dce002c20de63b6bde74e0cae2ca558d031a8a17", + "reference": "dce002c20de63b6bde74e0cae2ca558d031a8a17", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "fakerphp/faker": "^1.21", + "laravel/framework": "^10.38.1", + "laravel/tinker": "^2.8.2", + "nunomaduro/collision": "^6.4 || ^7.10", + "orchestra/canvas": "^8.11.4", + "orchestra/testbench-core": "^8.24", + "php": "^8.1", + "spatie/laravel-ray": "^1.32.4", + "symfony/polyfill-php83": "^1.28", + "symfony/yaml": "^6.2" + }, + "require-dev": { + "laravel/pint": "^1.4", + "mockery/mockery": "^1.5.1", + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^10.1", + "symfony/process": "^6.2" + }, + "suggest": { + "ext-pcntl": "Required to use all features of the console signal trapping." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Orchestra\\Workbench\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "Workbench Companion for Laravel Packages Development", + "keywords": [ + "dev", + "laravel", + "laravel-packages", + "testing" + ], + "support": { + "issues": "https://github.com/orchestral/workbench/issues", + "source": "https://github.com/orchestral/workbench/tree/v8.5.0" + }, + "time": "2024-05-20T23:51:13+00:00" + }, + { + "name": "pestphp/pest", + "version": "v2.34.8", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest.git", + "reference": "e8f122bf47585c06431e0056189ec6bfd6f41f57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest/zipball/e8f122bf47585c06431e0056189ec6bfd6f41f57", + "reference": "e8f122bf47585c06431e0056189ec6bfd6f41f57", + "shasum": "" + }, + "require": { + "brianium/paratest": "^7.3.1", + "nunomaduro/collision": "^7.10.0|^8.1.1", + "nunomaduro/termwind": "^1.15.1|^2.0.1", + "pestphp/pest-plugin": "^2.1.1", + "pestphp/pest-plugin-arch": "^2.7.0", + "php": "^8.1.0", + "phpunit/phpunit": "^10.5.17" + }, + "conflict": { + "phpunit/phpunit": ">10.5.17", + "sebastian/exporter": "<5.1.0", + "webmozart/assert": "<1.11.0" + }, + "require-dev": { + "pestphp/pest-dev-tools": "^2.16.0", + "pestphp/pest-plugin-type-coverage": "^2.8.3", + "symfony/process": "^6.4.0|^7.1.1" + }, + "bin": [ + "bin/pest" + ], + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Plugins\\Bail", + "Pest\\Plugins\\Cache", + "Pest\\Plugins\\Coverage", + "Pest\\Plugins\\Init", + "Pest\\Plugins\\Environment", + "Pest\\Plugins\\Help", + "Pest\\Plugins\\Memory", + "Pest\\Plugins\\Only", + "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", + "Pest\\Plugins\\Profile", + "Pest\\Plugins\\Retry", + "Pest\\Plugins\\Snapshot", + "Pest\\Plugins\\Verbose", + "Pest\\Plugins\\Version", + "Pest\\Plugins\\Parallel" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "files": [ + "src/Functions.php", + "src/Pest.php" + ], + "psr-4": { + "Pest\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "The elegant PHP Testing Framework.", + "keywords": [ + "framework", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest/issues", + "source": "https://github.com/pestphp/pest/tree/v2.34.8" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2024-06-10T22:02:16+00:00" + }, + { + "name": "pestphp/pest-plugin", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin.git", + "reference": "e05d2859e08c2567ee38ce8b005d044e72648c0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/e05d2859e08c2567ee38ce8b005d044e72648c0b", + "reference": "e05d2859e08c2567ee38ce8b005d044e72648c0b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "composer-runtime-api": "^2.2.2", + "php": "^8.1" + }, + "conflict": { + "pestphp/pest": "<2.2.3" + }, + "require-dev": { + "composer/composer": "^2.5.8", + "pestphp/pest": "^2.16.0", + "pestphp/pest-dev-tools": "^2.16.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Pest\\Plugin\\Manager" + }, + "autoload": { + "psr-4": { + "Pest\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest plugin manager", + "keywords": [ + "framework", + "manager", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin/tree/v2.1.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2023-08-22T08:40:06+00:00" + }, + { + "name": "pestphp/pest-plugin-arch", + "version": "v2.7.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-arch.git", + "reference": "d23b2d7498475354522c3818c42ef355dca3fcda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/d23b2d7498475354522c3818c42ef355dca3fcda", + "reference": "d23b2d7498475354522c3818c42ef355dca3fcda", + "shasum": "" + }, + "require": { + "nunomaduro/collision": "^7.10.0|^8.1.0", + "pestphp/pest-plugin": "^2.1.1", + "php": "^8.1", + "ta-tikoma/phpunit-architecture-test": "^0.8.4" + }, + "require-dev": { + "pestphp/pest": "^2.33.0", + "pestphp/pest-dev-tools": "^2.16.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Arch\\Plugin" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Arch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Arch plugin for Pest PHP.", + "keywords": [ + "arch", + "architecture", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.7.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2024-01-26T09:46:42+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" } }, "autoload": { - "files": [ - "src/helpers.php" - ], "psr-4": { - "Orchestra\\Testbench\\": "src/" + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2230,158 +3641,167 @@ ], "authors": [ { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Testing Helper for Laravel Development", - "homepage": "https://packages.tools/testbench", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], "support": { - "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench-core" + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" }, - "time": "2023-02-14T04:54:05+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.3", + "name": "phpdocumentor/reflection-docblock", + "version": "5.4.1", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "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/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" }, - "time": "2021-07-20T11:28:43+00:00" + "time": "2024-05-21T05:55:05+00:00" }, { - "name": "phar-io/version", - "version": "3.2.1", + "name": "phpdocumentor/type-resolver", + "version": "1.8.2", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Library for handling version information and constraints", + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" }, - "time": "2022-02-21T01:04:05+00:00" + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpoption/phpoption", - "version": "1.9.0", + "version": "1.9.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", + "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "type": "library", "extra": { @@ -2423,7 +3843,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.2" }, "funding": [ { @@ -2435,27 +3855,132 @@ "type": "tidelift" } ], - "time": "2022-07-30T15:51:26+00:00" + "time": "2023-11-12T21:59:55+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.29.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + }, + "time": "2024-05-31T08:52:43+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.11.5", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "490f0ae1c92b082f154681d7849aee776a7c1443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/490f0ae1c92b082f154681d7849aee776a7c1443", + "reference": "490f0ae1c92b082f154681d7849aee776a7c1443", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-06-17T15:10:54+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.0.0", + "version": "10.1.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "bf4fbc9c13af7da12b3ea807574fb460f255daba" + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bf4fbc9c13af7da12b3ea807574fb460f255daba", - "reference": "bf4fbc9c13af7da12b3ea807574fb460f255daba", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1", "phpunit/php-file-iterator": "^4.0", "phpunit/php-text-template": "^3.0", @@ -2467,16 +3992,16 @@ "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -2504,7 +4029,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.0" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" }, "funding": [ { @@ -2512,20 +4038,20 @@ "type": "github" } ], - "time": "2023-02-03T07:14:34+00:00" + "time": "2024-03-12T15:33:41+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.0.1", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { @@ -2564,7 +4090,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -2572,7 +4099,7 @@ "type": "github" } ], - "time": "2023-02-10T16:53:14+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", @@ -2639,16 +4166,16 @@ }, { "name": "phpunit/php-text-template", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { @@ -2686,7 +4213,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -2694,7 +4222,7 @@ "type": "github" } ], - "time": "2023-02-03T06:56:46+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", @@ -2757,16 +4285,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.7", + "version": "10.5.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a6f61c5629dd95db79af72f1e94d56702187479a" + "reference": "c1f736a473d21957ead7e94fcc029f571895abf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6f61c5629dd95db79af72f1e94d56702187479a", - "reference": "a6f61c5629dd95db79af72f1e94d56702187479a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c1f736a473d21957ead7e94fcc029f571895abf5", + "reference": "c1f736a473d21957ead7e94fcc029f571895abf5", "shasum": "" }, "require": { @@ -2780,7 +4308,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.0", + "phpunit/php-code-coverage": "^10.1.5", "phpunit/php-file-iterator": "^4.0", "phpunit/php-invoker": "^4.0", "phpunit/php-text-template": "^3.0", @@ -2790,15 +4318,15 @@ "sebastian/comparator": "^5.0", "sebastian/diff": "^5.0", "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", "sebastian/object-enumerator": "^5.0", "sebastian/recursion-context": "^5.0", "sebastian/type": "^4.0", "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "*" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -2806,7 +4334,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -2837,7 +4365,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.7" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.17" }, "funding": [ { @@ -2853,7 +4382,7 @@ "type": "tidelift" } ], - "time": "2023-02-08T15:16:31+00:00" + "time": "2024-04-05T04:39:01+00:00" }, { "name": "pimple/pimple", @@ -2908,6 +4437,54 @@ }, "time": "2021-10-28T11:13:42+00:00" }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, { "name": "psr/container", "version": "2.0.2", @@ -3013,21 +4590,21 @@ }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -3047,10 +4624,10 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -3062,31 +4639,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3101,7 +4678,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -3115,9 +4692,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/log", @@ -3183,18 +4760,95 @@ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, - "require": { - "php": ">=8.0.0" + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.12.4", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "2fd717afa05341b4f8152547f142cd2f130f6818" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/2fd717afa05341b4f8152547f142cd2f130f6818", + "reference": "2fd717afa05341b4f8152547f142cd2f130f6818", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2" }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." + }, + "bin": [ + "bin/psysh" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-main": "0.12.x-dev" + }, + "bamarni-bin": { + "bin-links": false, + "forward-command": false } }, "autoload": { + "files": [ + "src/functions.php" + ], "psr-4": { - "Psr\\SimpleCache\\": "src/" + "Psy\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3203,22 +4857,24 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" } ], - "description": "Common interfaces for simple caching", + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" + "REPL", + "console", + "interactive", + "shell" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.12.4" }, - "time": "2021-10-29T13:26:27+00:00" + "time": "2024-06-10T01:18:23+00:00" }, { "name": "ralouphie/getallheaders", @@ -3355,20 +5011,20 @@ }, { "name": "ramsey/uuid", - "version": "4.7.3", + "version": "4.7.6", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "433b2014e3979047db08a17a205f410ba3869cf2" + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/433b2014e3979047db08a17a205f410ba3869cf2", - "reference": "433b2014e3979047db08a17a205f410ba3869cf2", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", "ext-json": "*", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" @@ -3431,7 +5087,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.3" + "source": "https://github.com/ramsey/uuid/tree/4.7.6" }, "funding": [ { @@ -3443,20 +5099,79 @@ "type": "tidelift" } ], - "time": "2023-01-12T18:13:24+00:00" + "time": "2024-04-27T21:32:50+00:00" + }, + { + "name": "rector/rector", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "556509e2dcf527369892b7d411379c4a02f31859" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/556509e2dcf527369892b7d411379c4a02f31859", + "reference": "556509e2dcf527369892b7d411379c4a02f31859", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.11" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-05-18T09:40:27+00:00" }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -3491,7 +5206,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -3499,7 +5215,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -3614,16 +5330,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { @@ -3634,7 +5350,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { @@ -3678,7 +5394,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -3686,24 +5403,24 @@ "type": "github" } ], - "time": "2023-02-03T07:07:16+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -3712,7 +5429,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -3735,7 +5452,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -3743,20 +5461,20 @@ "type": "github" } ], - "time": "2023-02-03T06:59:47+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "5.0.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -3764,12 +5482,12 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -3801,7 +5519,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -3809,20 +5528,20 @@ "type": "github" } ], - "time": "2023-02-03T07:00:31+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "6.0.0", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { @@ -3837,7 +5556,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -3864,7 +5583,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -3872,20 +5592,20 @@ "type": "github" } ], - "time": "2023-02-03T07:03:04+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "5.0.0", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { @@ -3899,7 +5619,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -3941,7 +5661,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -3949,20 +5670,20 @@ "type": "github" } ], - "time": "2023-02-03T07:06:49+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "aab257c712de87b90194febd52e4d184551c2d44" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", - "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -3996,13 +5717,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -4010,24 +5732,24 @@ "type": "github" } ], - "time": "2023-02-03T07:07:38+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -4059,7 +5781,8 @@ "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/2.0.0" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -4067,7 +5790,7 @@ "type": "github" } ], - "time": "2023-02-03T07:08:02+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -4355,16 +6078,16 @@ }, { "name": "spatie/backtrace", - "version": "1.2.1", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "4ee7d41aa5268107906ea8a4d9ceccde136dbd5b" + "reference": "8373b9d51638292e3bfd736a9c19a654111b4a23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/4ee7d41aa5268107906ea8a4d9ceccde136dbd5b", - "reference": "4ee7d41aa5268107906ea8a4d9ceccde136dbd5b", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/8373b9d51638292e3bfd736a9c19a654111b4a23", + "reference": "8373b9d51638292e3bfd736a9c19a654111b4a23", "shasum": "" }, "require": { @@ -4372,7 +6095,9 @@ }, "require-dev": { "ext-json": "*", + "laravel/serializable-closure": "^1.3", "phpunit/phpunit": "^9.3", + "spatie/phpunit-snapshot-assertions": "^4.2", "symfony/var-dumper": "^5.1" }, "type": "library", @@ -4400,8 +6125,7 @@ "spatie" ], "support": { - "issues": "https://github.com/spatie/backtrace/issues", - "source": "https://github.com/spatie/backtrace/tree/1.2.1" + "source": "https://github.com/spatie/backtrace/tree/1.6.1" }, "funding": [ { @@ -4413,47 +6137,49 @@ "type": "other" } ], - "time": "2021-11-09T10:57:15+00:00" + "time": "2024-04-24T13:22:11+00:00" }, { "name": "spatie/laravel-ray", - "version": "1.32.2", + "version": "1.36.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ray.git", - "reference": "0c28a8274ec261a2857b4318b6f934af98024395" + "reference": "1852faa96e5aa6778ea3401ec3176eee77268718" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/0c28a8274ec261a2857b4318b6f934af98024395", - "reference": "0c28a8274ec261a2857b4318b6f934af98024395", + "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/1852faa96e5aa6778ea3401ec3176eee77268718", + "reference": "1852faa96e5aa6778ea3401ec3176eee77268718", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/contracts": "^7.20|^8.19|^9.0|^10.0", - "illuminate/database": "^7.20|^8.19|^9.0|^10.0", - "illuminate/queue": "^7.20|^8.19|^9.0|^10.0", - "illuminate/support": "^7.20|^8.19|^9.0|^10.0", + "illuminate/contracts": "^7.20|^8.19|^9.0|^10.0|^11.0", + "illuminate/database": "^7.20|^8.19|^9.0|^10.0|^11.0", + "illuminate/queue": "^7.20|^8.19|^9.0|^10.0|^11.0", + "illuminate/support": "^7.20|^8.19|^9.0|^10.0|^11.0", "php": "^7.4|^8.0", + "rector/rector": "^0.19.2|^1.0", "spatie/backtrace": "^1.0", - "spatie/ray": "^1.33", - "symfony/stopwatch": "4.2|^5.1|^6.0", + "spatie/ray": "^1.41.1", + "symfony/stopwatch": "4.2|^5.1|^6.0|^7.0", "zbateson/mail-mime-parser": "^1.3.1|^2.0" }, "require-dev": { "guzzlehttp/guzzle": "^7.3", - "laravel/framework": "^7.20|^8.19|^9.0|^10.0", - "orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0", - "pestphp/pest": "^1.22", - "phpstan/phpstan": "^0.12.93", - "phpunit/phpunit": "^9.3", - "spatie/pest-plugin-snapshots": "^1.1" + "laravel/framework": "^7.20|^8.19|^9.0|^10.0|^11.0", + "orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0|^9.0", + "pestphp/pest": "^1.22|^2.0", + "phpstan/phpstan": "^1.10.57", + "phpunit/phpunit": "^9.3|^10.1", + "spatie/pest-plugin-snapshots": "^1.1|^2.0", + "symfony/var-dumper": "^4.2|^5.1|^6.0|^7.0.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.29.x-dev" + "dev-main": "1.x-dev" }, "laravel": { "providers": [ @@ -4486,7 +6212,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-ray/issues", - "source": "https://github.com/spatie/laravel-ray/tree/1.32.2" + "source": "https://github.com/spatie/laravel-ray/tree/1.36.2" }, "funding": [ { @@ -4498,7 +6224,7 @@ "type": "other" } ], - "time": "2023-02-06T09:46:50+00:00" + "time": "2024-05-02T08:26:02+00:00" }, { "name": "spatie/macroable", @@ -4552,16 +6278,16 @@ }, { "name": "spatie/ray", - "version": "1.36.2", + "version": "1.41.2", "source": { "type": "git", "url": "https://github.com/spatie/ray.git", - "reference": "71dfde21900447ab37698fc07ff28b7f1e1822b8" + "reference": "c44f8cfbf82c69909b505de61d8d3f2d324e93fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/71dfde21900447ab37698fc07ff28b7f1e1822b8", - "reference": "71dfde21900447ab37698fc07ff28b7f1e1822b8", + "url": "https://api.github.com/repos/spatie/ray/zipball/c44f8cfbf82c69909b505de61d8d3f2d324e93fc", + "reference": "c44f8cfbf82c69909b505de61d8d3f2d324e93fc", "shasum": "" }, "require": { @@ -4571,19 +6297,28 @@ "ramsey/uuid": "^3.0|^4.1", "spatie/backtrace": "^1.1", "spatie/macroable": "^1.0|^2.0", - "symfony/stopwatch": "^4.0|^5.1|^6.0", - "symfony/var-dumper": "^4.2|^5.1|^6.0" + "symfony/stopwatch": "^4.0|^5.1|^6.0|^7.0", + "symfony/var-dumper": "^4.2|^5.1|^6.0|^7.0.3" }, "require-dev": { "illuminate/support": "6.x|^8.18|^9.0", "nesbot/carbon": "^2.63", "pestphp/pest": "^1.22", - "phpstan/phpstan": "^0.12.92", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5", + "rector/rector": "^0.19.2", "spatie/phpunit-snapshot-assertions": "^4.2", "spatie/test-time": "^1.2" }, + "bin": [ + "bin/remove-ray.sh" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "files": [ "src/helpers.php" @@ -4612,7 +6347,7 @@ ], "support": { "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.36.2" + "source": "https://github.com/spatie/ray/tree/1.41.2" }, "funding": [ { @@ -4624,28 +6359,28 @@ "type": "other" } ], - "time": "2023-02-10T09:24:13+00:00" + "time": "2024-04-24T14:21:46+00:00" }, { "name": "symfony/console", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3e294254f2191762c1d137aed4b94e966965e985" + "reference": "be5854cee0e8c7b110f00d695d11debdfa1a2a91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3e294254f2191762c1d137aed4b94e966965e985", - "reference": "3e294254f2191762c1d137aed4b94e966965e985", + "url": "https://api.github.com/repos/symfony/console/zipball/be5854cee0e8c7b110f00d695d11debdfa1a2a91", + "reference": "be5854cee0e8c7b110f00d695d11debdfa1a2a91", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/dependency-injection": "<5.4", @@ -4659,18 +6394,16 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4699,12 +6432,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.5" + "source": "https://github.com/symfony/console/tree/v6.4.8" }, "funding": [ { @@ -4720,24 +6453,24 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/css-selector", - "version": "v6.2.5", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "bf1b9d4ad8b1cf0dbde8b08e0135a2f6259b9ba1" + "reference": "1c7cee86c6f812896af54434f8ce29c8d94f9ff4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/bf1b9d4ad8b1cf0dbde8b08e0135a2f6259b9ba1", - "reference": "bf1b9d4ad8b1cf0dbde8b08e0135a2f6259b9ba1", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/1c7cee86c6f812896af54434f8ce29c8d94f9ff4", + "reference": "1c7cee86c6f812896af54434f8ce29c8d94f9ff4", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -4769,7 +6502,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.2.5" + "source": "https://github.com/symfony/css-selector/tree/v7.1.1" }, "funding": [ { @@ -4785,20 +6518,20 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { @@ -4807,7 +6540,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4836,7 +6569,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" }, "funding": [ { @@ -4852,31 +6585,35 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/error-handler", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "0092696af0be8e6124b042fbe2890ca1788d7b28" + "reference": "ef836152bf13472dc5fb5b08b0c0c4cfeddc0fcc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/0092696af0be8e6124b042fbe2890ca1788d7b28", - "reference": "0092696af0be8e6124b042fbe2890ca1788d7b28", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/ef836152bf13472dc5fb5b08b0c0c4cfeddc0fcc", + "reference": "ef836152bf13472dc5fb5b08b0c0c4cfeddc0fcc", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" }, "require-dev": { - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/serializer": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -4907,7 +6644,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.2.5" + "source": "https://github.com/symfony/error-handler/tree/v6.4.8" }, "funding": [ { @@ -4923,28 +6660,29 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.2.5", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f02d108b5e9fd4a6245aa73a9d2df2ec060c3e68" + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f02d108b5e9fd4a6245aa73a9d2df2ec060c3e68", - "reference": "f02d108b5e9fd4a6245aa73a9d2df2ec060c3e68", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -4952,17 +6690,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4990,7 +6724,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.5" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.1.1" }, "funding": [ { @@ -5006,33 +6740,30 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", - "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -5069,7 +6800,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" }, "funding": [ { @@ -5085,27 +6816,27 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/finder", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c90dc446976a612e3312a97a6ec0069ab0c2099c" + "reference": "3ef977a43883215d560a2cecb82ec8e62131471c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c90dc446976a612e3312a97a6ec0069ab0c2099c", - "reference": "c90dc446976a612e3312a97a6ec0069ab0c2099c", + "url": "https://api.github.com/repos/symfony/finder/zipball/3ef977a43883215d560a2cecb82ec8e62131471c", + "reference": "3ef977a43883215d560a2cecb82ec8e62131471c", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { @@ -5133,7 +6864,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.5" + "source": "https://github.com/symfony/finder/tree/v6.4.8" }, "funding": [ { @@ -5149,41 +6880,40 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:45:48+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.2.6", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e8dd1f502bc2b3371d05092aa233b064b03ce7ed" + "reference": "27de8cc95e11db7a50b027e71caaab9024545947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e8dd1f502bc2b3371d05092aa233b064b03ce7ed", - "reference": "e8dd1f502bc2b3371d05092aa233b064b03ce7ed", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27de8cc95e11db7a50b027e71caaab9024545947", + "reference": "27de8cc95e11db7a50b027e71caaab9024545947", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1" + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.2" + "symfony/cache": "<6.3" }, "require-dev": { - "predis/predis": "~1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^5.4|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" - }, - "suggest": { - "symfony/mime": "To use the file extension guesser" + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.3|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -5211,7 +6941,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.2.6" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.8" }, "funding": [ { @@ -5227,29 +6957,29 @@ "type": "tidelift" } ], - "time": "2023-01-30T15:46:28+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.2.6", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "7122db07b0d8dbf0de682267c84217573aee3ea7" + "reference": "6c519aa3f32adcfd1d1f18d923f6b227d9acf3c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/7122db07b0d8dbf0de682267c84217573aee3ea7", - "reference": "7122db07b0d8dbf0de682267c84217573aee3ea7", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6c519aa3f32adcfd1d1f18d923f6b227d9acf3c1", + "reference": "6c519aa3f32adcfd1d1f18d923f6b227d9acf3c1", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^6.1", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.4|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -5257,15 +6987,18 @@ "symfony/cache": "<5.4", "symfony/config": "<6.1", "symfony/console": "<5.4", - "symfony/dependency-injection": "<6.2", + "symfony/dependency-injection": "<6.4", "symfony/doctrine-bridge": "<5.4", "symfony/form": "<5.4", "symfony/http-client": "<5.4", + "symfony/http-client-contracts": "<2.5", "symfony/mailer": "<5.4", "symfony/messenger": "<5.4", "symfony/translation": "<5.4", + "symfony/translation-contracts": "<2.5", "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", + "symfony/validator": "<6.4", + "symfony/var-dumper": "<6.3", "twig/twig": "<2.13" }, "provide": { @@ -5273,29 +7006,29 @@ }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^6.1", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.2", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", - "symfony/uid": "^5.4|^6.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.2|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4.5|^6.0.5|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.4|^7.0.4", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.4|^7.0", + "symfony/var-exporter": "^6.2|^7.0", "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" - }, "type": "library", "autoload": { "psr-4": { @@ -5322,7 +7055,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.2.6" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.8" }, "funding": [ { @@ -5338,20 +7071,20 @@ "type": "tidelift" } ], - "time": "2023-02-01T08:32:25+00:00" + "time": "2024-06-02T16:06:25+00:00" }, { "name": "symfony/mailer", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "29729ac0b4e5113f24c39c46746bd6afb79e0aaa" + "reference": "76326421d44c07f7824b19487cfbf87870b37efc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/29729ac0b4e5113f24c39c46746bd6afb79e0aaa", - "reference": "29729ac0b4e5113f24c39c46746bd6afb79e0aaa", + "url": "https://api.github.com/repos/symfony/mailer/zipball/76326421d44c07f7824b19487cfbf87870b37efc", + "reference": "76326421d44c07f7824b19487cfbf87870b37efc", "shasum": "" }, "require": { @@ -5359,21 +7092,22 @@ "php": ">=8.1", "psr/event-dispatcher": "^1", "psr/log": "^1|^2|^3", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/mime": "^6.2", - "symfony/service-contracts": "^1.1|^2|^3" + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/mime": "^6.2|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "symfony/http-client-contracts": "<2.5", "symfony/http-kernel": "<5.4", "symfony/messenger": "<6.2", "symfony/mime": "<6.2", "symfony/twig-bridge": "<6.2.1" }, "require-dev": { - "symfony/console": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/messenger": "^6.2", - "symfony/twig-bridge": "^6.2" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/messenger": "^6.2|^7.0", + "symfony/twig-bridge": "^6.2|^7.0" }, "type": "library", "autoload": { @@ -5401,7 +7135,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.2.5" + "source": "https://github.com/symfony/mailer/tree/v6.4.8" }, "funding": [ { @@ -5417,24 +7151,25 @@ "type": "tidelift" } ], - "time": "2023-01-10T18:53:53+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/mime", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "4b7b349f67d15cd0639955c8179a76c89f6fd610" + "reference": "618597ab8b78ac86d1c75a9d0b35540cda074f33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/4b7b349f67d15cd0639955c8179a76c89f6fd610", - "reference": "4b7b349f67d15cd0639955c8179a76c89f6fd610", + "url": "https://api.github.com/repos/symfony/mime/zipball/618597ab8b78ac86d1c75a9d0b35540cda074f33", + "reference": "618597ab8b78ac86d1c75a9d0b35540cda074f33", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -5443,16 +7178,17 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<5.4", - "symfony/serializer": "<6.2" + "symfony/serializer": "<6.3.2" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^6.2" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.4|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.3.2|^7.0" }, "type": "library", "autoload": { @@ -5484,7 +7220,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.2.5" + "source": "https://github.com/symfony/mime/tree/v6.4.8" }, "funding": [ { @@ -5500,20 +7236,20 @@ "type": "tidelift" } ], - "time": "2023-01-10T18:53:53+00:00" + "time": "2024-06-01T07:50:16+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -5527,9 +7263,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -5566,7 +7299,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -5582,20 +7315,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "927013f3aac555983a5059aada98e1907d842695" + "reference": "c027e6a3c6aee334663ec21f5852e89738abc805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/927013f3aac555983a5059aada98e1907d842695", - "reference": "927013f3aac555983a5059aada98e1907d842695", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/c027e6a3c6aee334663ec21f5852e89738abc805", + "reference": "c027e6a3c6aee334663ec21f5852e89738abc805", "shasum": "" }, "require": { @@ -5609,9 +7342,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -5649,7 +7379,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.30.0" }, "funding": [ { @@ -5665,20 +7395,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -5689,9 +7419,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -5730,7 +7457,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -5746,20 +7473,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", "shasum": "" }, "require": { @@ -5772,9 +7499,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -5817,7 +7541,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" }, "funding": [ { @@ -5833,20 +7557,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -5857,9 +7581,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -5901,7 +7622,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -5917,20 +7638,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -5944,9 +7665,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -5984,7 +7702,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -6000,20 +7718,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "10112722600777e02d2745716b70c5db4ca70442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/10112722600777e02d2745716b70c5db4ca70442", + "reference": "10112722600777e02d2745716b70c5db4ca70442", "shasum": "" }, "require": { @@ -6021,9 +7739,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -6060,7 +7775,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.30.0" }, "funding": [ { @@ -6076,20 +7791,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -6097,9 +7812,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -6143,7 +7855,83 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.30.0" }, "funding": [ { @@ -6159,20 +7947,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-06-19T12:35:24+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.27.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/2ba1f33797470debcda07fe9dce20a0003df18e9", + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9", "shasum": "" }, "require": { @@ -6186,9 +7974,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -6225,7 +8010,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.30.0" }, "funding": [ { @@ -6241,20 +8026,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/process", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9ead139f63dfa38c4e4a9049cc64a8b2748c83b7" + "reference": "8d92dd79149f29e89ee0f480254db595f6a6a2c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9ead139f63dfa38c4e4a9049cc64a8b2748c83b7", - "reference": "9ead139f63dfa38c4e4a9049cc64a8b2748c83b7", + "url": "https://api.github.com/repos/symfony/process/zipball/8d92dd79149f29e89ee0f480254db595f6a6a2c5", + "reference": "8d92dd79149f29e89ee0f480254db595f6a6a2c5", "shasum": "" }, "require": { @@ -6286,7 +8071,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.5" + "source": "https://github.com/symfony/process/tree/v6.4.8" }, "funding": [ { @@ -6302,24 +8087,25 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/routing", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "589bd742d5d03c192c8521911680fe88f61712fe" + "reference": "8a40d0f9b01f0fbb80885d3ce0ad6714fb603a58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/589bd742d5d03c192c8521911680fe88f61712fe", - "reference": "589bd742d5d03c192c8521911680fe88f61712fe", + "url": "https://api.github.com/repos/symfony/routing/zipball/8a40d0f9b01f0fbb80885d3ce0ad6714fb603a58", + "reference": "8a40d0f9b01f0fbb80885d3ce0ad6714fb603a58", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "doctrine/annotations": "<1.12", @@ -6330,17 +8116,11 @@ "require-dev": { "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", - "symfony/config": "^6.2", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" + "symfony/config": "^6.2|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -6374,7 +8154,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.2.5" + "source": "https://github.com/symfony/routing/tree/v6.4.8" }, "funding": [ { @@ -6390,36 +8170,34 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.2.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/aac98028c69df04ee77eb69b96b86ee51fbf4b75", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -6459,7 +8237,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" }, "funding": [ { @@ -6475,25 +8253,25 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.2.5", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "00b6ac156aacffc53487c930e0ab14587a6607f6" + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/00b6ac156aacffc53487c930e0ab14587a6607f6", - "reference": "00b6ac156aacffc53487c930e0ab14587a6607f6", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -6521,7 +8299,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.2.5" + "source": "https://github.com/symfony/stopwatch/tree/v7.1.1" }, "funding": [ { @@ -6537,38 +8315,39 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:55+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/string", - "version": "v6.2.5", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0" + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0", - "reference": "b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0", + "url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2", + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -6607,7 +8386,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.5" + "source": "https://github.com/symfony/string/tree/v7.1.1" }, "funding": [ { @@ -6623,32 +8402,35 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-06-04T06:40:14+00:00" }, { "name": "symfony/translation", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "60556925a703cfbc1581cde3b3f35b0bb0ea904c" + "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/60556925a703cfbc1581cde3b3f35b0bb0ea904c", - "reference": "60556925a703cfbc1581cde3b3f35b0bb0ea904c", + "url": "https://api.github.com/repos/symfony/translation/zipball/a002933b13989fc4bd0b58e04bf7eec5210e438a", + "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" + "symfony/translation-contracts": "^2.5|^3.0" }, "conflict": { "symfony/config": "<5.4", "symfony/console": "<5.4", "symfony/dependency-injection": "<5.4", + "symfony/http-client-contracts": "<2.5", "symfony/http-kernel": "<5.4", + "symfony/service-contracts": "<2.5", "symfony/twig-bundle": "<5.4", "symfony/yaml": "<5.4" }, @@ -6656,25 +8438,19 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "nikic/php-parser": "To use PhpAstExtractor", - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -6705,7 +8481,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.2.5" + "source": "https://github.com/symfony/translation/tree/v6.4.8" }, "funding": [ { @@ -6721,32 +8497,29 @@ "type": "tidelift" } ], - "time": "2023-01-05T07:00:27+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.2.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "68cce71402305a015f8c1589bfada1280dc64fe7" + "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/68cce71402305a015f8c1589bfada1280dc64fe7", - "reference": "68cce71402305a015f8c1589bfada1280dc64fe7", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", + "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", "shasum": "" }, "require": { "php": ">=8.1" }, - "suggest": { - "symfony/translation-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -6786,7 +8559,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.0" }, "funding": [ { @@ -6802,20 +8575,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/uid", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "8ace895bded57d6496638c9b2d3b788e05b7395b" + "reference": "35904eca37a84bb764c560cbfcac9f0ac2bcdbdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/8ace895bded57d6496638c9b2d3b788e05b7395b", - "reference": "8ace895bded57d6496638c9b2d3b788e05b7395b", + "url": "https://api.github.com/repos/symfony/uid/zipball/35904eca37a84bb764c560cbfcac9f0ac2bcdbdf", + "reference": "35904eca37a84bb764c560cbfcac9f0ac2bcdbdf", "shasum": "" }, "require": { @@ -6823,7 +8596,7 @@ "symfony/polyfill-uuid": "^1.15" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -6860,7 +8633,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.2.5" + "source": "https://github.com/symfony/uid/tree/v6.4.8" }, "funding": [ { @@ -6876,42 +8649,39 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "44b7b81749fd20c1bdf4946c041050e22bc8da27" + "reference": "ad23ca4312395f0a8a8633c831ef4c4ee542ed25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/44b7b81749fd20c1bdf4946c041050e22bc8da27", - "reference": "44b7b81749fd20c1bdf4946c041050e22bc8da27", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ad23ca4312395f0a8a8633c831ef4c4ee542ed25", + "reference": "ad23ca4312395f0a8a8633c831ef4c4ee542ed25", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<5.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^6.3|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, "bin": [ "Resources/bin/var-dump-server" ], @@ -6948,7 +8718,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.8" }, "funding": [ { @@ -6964,34 +8734,32 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:45:48+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/yaml", - "version": "v6.2.5", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19" + "reference": "52903de178d542850f6f341ba92995d3d63e60c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19", - "reference": "2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19", + "url": "https://api.github.com/repos/symfony/yaml/zipball/52903de178d542850f6f341ba92995d3d63e60c9", + "reference": "52903de178d542850f6f341ba92995d3d63e60c9", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "symfony/console": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "symfony/console": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -7022,7 +8790,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.5" + "source": "https://github.com/symfony/yaml/tree/v6.4.8" }, "funding": [ { @@ -7038,20 +8806,79 @@ "type": "tidelift" } ], - "time": "2023-01-10T18:53:53+00:00" + "time": "2024-05-31T14:49:08+00:00" + }, + { + "name": "ta-tikoma/phpunit-architecture-test", + "version": "0.8.4", + "source": { + "type": "git", + "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", + "reference": "89f0dea1cb0f0d5744d3ec1764a286af5e006636" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/89f0dea1cb0f0d5744d3ec1764a286af5e006636", + "reference": "89f0dea1cb0f0d5744d3ec1764a286af5e006636", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18.0 || ^5.0.0", + "php": "^8.1.0", + "phpdocumentor/reflection-docblock": "^5.3.0", + "phpunit/phpunit": "^10.5.5 || ^11.0.0", + "symfony/finder": "^6.4.0 || ^7.0.0" + }, + "require-dev": { + "laravel/pint": "^1.13.7", + "phpstan/phpstan": "^1.10.52" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPUnit\\Architecture\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ni Shi", + "email": "futik0ma011@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Methods for testing application architecture", + "keywords": [ + "architecture", + "phpunit", + "stucture", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", + "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.8.4" + }, + "time": "2024-01-05T14:10:56+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -7080,7 +8907,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -7088,27 +8915,27 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.6", + "version": "v2.2.7", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "c42125b83a4fa63b187fdf29f9c93cb7733da30c" + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/c42125b83a4fa63b187fdf29f9c93cb7733da30c", - "reference": "c42125b83a4fa63b187fdf29f9c93cb7733da30c", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "php": "^5.5 || ^7.0 || ^8.0", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" @@ -7139,37 +8966,37 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.6" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" }, - "time": "2023-01-03T09:29:04+00:00" + "time": "2023-12-08T13:03:43+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v5.5.0", + "version": "v5.6.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" + "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", + "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "graham-campbell/result-type": "^1.1.2", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.2", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -7181,7 +9008,7 @@ "forward-command": true }, "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "autoload": { @@ -7213,7 +9040,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0" }, "funding": [ { @@ -7225,7 +9052,7 @@ "type": "tidelift" } ], - "time": "2022-10-16T01:01:54+00:00" + "time": "2023-11-12T22:43:29+00:00" }, { "name": "voku/portable-ascii", @@ -7361,16 +9188,16 @@ }, { "name": "zbateson/mail-mime-parser", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/zbateson/mail-mime-parser.git", - "reference": "20b3e48eb799537683780bc8782fbbe9bc25934a" + "reference": "ff49e02f6489b38f7cc3d1bd3971adc0f872569c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/20b3e48eb799537683780bc8782fbbe9bc25934a", - "reference": "20b3e48eb799537683780bc8782fbbe9bc25934a", + "url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/ff49e02f6489b38f7cc3d1bd3971adc0f872569c", + "reference": "ff49e02f6489b38f7cc3d1bd3971adc0f872569c", "shasum": "" }, "require": { @@ -7432,20 +9259,20 @@ "type": "github" } ], - "time": "2023-02-14T22:58:03+00:00" + "time": "2024-04-28T00:58:54+00:00" }, { "name": "zbateson/mb-wrapper", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/zbateson/mb-wrapper.git", - "reference": "faf35dddfacfc5d4d5f9210143eafd7a7fe74334" + "reference": "09a8b77eb94af3823a9a6623dcc94f8d988da67f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/faf35dddfacfc5d4d5f9210143eafd7a7fe74334", - "reference": "faf35dddfacfc5d4d5f9210143eafd7a7fe74334", + "url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/09a8b77eb94af3823a9a6623dcc94f8d988da67f", + "reference": "09a8b77eb94af3823a9a6623dcc94f8d988da67f", "shasum": "" }, "require": { @@ -7456,7 +9283,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "*", "phpstan/phpstan": "*", - "phpunit/phpunit": "<=9.0" + "phpunit/phpunit": "<10.0" }, "suggest": { "ext-iconv": "For best support/performance", @@ -7493,7 +9320,7 @@ ], "support": { "issues": "https://github.com/zbateson/mb-wrapper/issues", - "source": "https://github.com/zbateson/mb-wrapper/tree/1.2.0" + "source": "https://github.com/zbateson/mb-wrapper/tree/1.2.1" }, "funding": [ { @@ -7501,31 +9328,31 @@ "type": "github" } ], - "time": "2023-01-11T23:05:44+00:00" + "time": "2024-03-18T04:31:04+00:00" }, { "name": "zbateson/stream-decorators", - "version": "1.1.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/zbateson/stream-decorators.git", - "reference": "7466ff45d249c86b96267a83cdae68365ae1787e" + "reference": "783b034024fda8eafa19675fb2552f8654d3a3e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/7466ff45d249c86b96267a83cdae68365ae1787e", - "reference": "7466ff45d249c86b96267a83cdae68365ae1787e", + "url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/783b034024fda8eafa19675fb2552f8654d3a3e9", + "reference": "783b034024fda8eafa19675fb2552f8654d3a3e9", "shasum": "" }, "require": { "guzzlehttp/psr7": "^1.9 | ^2.0", - "php": ">=7.1", + "php": ">=7.2", "zbateson/mb-wrapper": "^1.0.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", "phpstan/phpstan": "*", - "phpunit/phpunit": "<=9.0" + "phpunit/phpunit": "<10.0" }, "type": "library", "autoload": { @@ -7556,7 +9383,7 @@ ], "support": { "issues": "https://github.com/zbateson/stream-decorators/issues", - "source": "https://github.com/zbateson/stream-decorators/tree/1.1.0" + "source": "https://github.com/zbateson/stream-decorators/tree/1.2.1" }, "funding": [ { @@ -7564,7 +9391,7 @@ "type": "github" } ], - "time": "2023-01-11T23:22:44+00:00" + "time": "2023-05-30T22:51:52+00:00" } ], "aliases": [], @@ -7574,5 +9401,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..859de97 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,26 @@ + + + + + tests/Unit + + + tests/Feature + + + + + + src + + + + + + + + diff --git a/src/Processor.php b/src/Processor.php index 8641f3d..6f972e3 100644 --- a/src/Processor.php +++ b/src/Processor.php @@ -45,6 +45,8 @@ public function process(array|Collection $data, string $name): void $this->data = is_array($data) ? collect($data) : $data; $this->name = $name; + + $this->data->pipeThrough([ $this->relations(...), $this->defaults(...), diff --git a/tests/Feature/PopulatorTest.php b/tests/Feature/PopulatorTest.php new file mode 100644 index 0000000..da4326e --- /dev/null +++ b/tests/Feature/PopulatorTest.php @@ -0,0 +1,5 @@ +toBe([]); +}); \ No newline at end of file diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..015be07 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,39 @@ +in('Feature'); + +/* +|-------------------------------------------------------------------------- +| Expectations +|-------------------------------------------------------------------------- +| +| When you're writing tests, you often need to check that values meet certain conditions. The +| "expect()" function gives you access to a set of "expectations" methods that you can use +| to assert different things. Of course, you may extend the Expectation API at any time. +| +*/ + +/* +|-------------------------------------------------------------------------- +| Functions +|-------------------------------------------------------------------------- +| +| While Pest is very powerful out-of-the-box, you may have some testing code specific to your +| project that you don't want to repeat in every file. Here you can also expose helpers as +| global functions to help you to reduce the number of lines of code in your test files. +| +*/ diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..723435d --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,16 @@ + Date: Fri, 21 Jun 2024 01:55:17 -0400 Subject: [PATCH 02/10] add phpstan --- composer.json | 9 +- composer.lock | 623 +++++++++++++++++++++++++++++++++++++++++++++++++- phpstan.neon | 11 + 3 files changed, 641 insertions(+), 2 deletions(-) create mode 100644 phpstan.neon diff --git a/composer.json b/composer.json index 5b34c73..65834b7 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,16 @@ "email": "stepan.mocjak@guava.cz" } ], + "scripts": { + "phpstan": "vendor/bin/phpstan analyze" + }, "require-dev": { "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.34" + "pestphp/pest": "^2.34", + "pestphp/pest-plugin-laravel": "^2.4", + "phpstan/phpstan": "^1.11", + "pestphp/pest-plugin-watch": "^2.1", + "larastan/larastan": "^2.9" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 356a43f..a41febf 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": "b43b6df0dc5e3ebaae135846a11fcd02", + "content-hash": "3f258070b04873bc8c812078ee97885f", "packages": [], "packages-dev": [ { @@ -729,6 +729,53 @@ ], "time": "2023-10-06T06:47:41+00:00" }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, { "name": "fakerphp/faker", "version": "v1.23.1", @@ -1369,6 +1416,108 @@ }, "time": "2024-03-08T09:58:59+00:00" }, + { + "name": "larastan/larastan", + "version": "v2.9.7", + "source": { + "type": "git", + "url": "https://github.com/larastan/larastan.git", + "reference": "5c805f636095cc2e0b659e3954775cf8f1dad1bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/larastan/larastan/zipball/5c805f636095cc2e0b659e3954775cf8f1dad1bb", + "reference": "5c805f636095cc2e0b659e3954775cf8f1dad1bb", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/container": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/contracts": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/database": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/http": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/pipeline": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/support": "^9.52.16 || ^10.28.0 || ^11.0", + "php": "^8.0.2", + "phpmyadmin/sql-parser": "^5.9.0", + "phpstan/phpstan": "^1.11.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0", + "nikic/php-parser": "^4.19.1", + "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.2", + "orchestra/testbench": "^7.33.0 || ^8.13.0 || ^9.0.3", + "phpunit/phpunit": "^9.6.13 || ^10.5.16" + }, + "suggest": { + "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Larastan\\Larastan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Can Vural", + "email": "can9119@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "larastan", + "laravel", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/larastan/larastan/issues", + "source": "https://github.com/larastan/larastan/tree/v2.9.7" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/canvural", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2024-05-27T18:33:26+00:00" + }, { "name": "laravel/framework", "version": "v10.48.13", @@ -3489,6 +3638,161 @@ ], "time": "2024-01-26T09:46:42+00:00" }, + { + "name": "pestphp/pest-plugin-laravel", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-laravel.git", + "reference": "53df51169a7f9595e06839cce638c73e59ace5e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-laravel/zipball/53df51169a7f9595e06839cce638c73e59ace5e8", + "reference": "53df51169a7f9595e06839cce638c73e59ace5e8", + "shasum": "" + }, + "require": { + "laravel/framework": "^10.48.9|^11.5.0", + "pestphp/pest": "^2.34.7", + "php": "^8.1.0" + }, + "require-dev": { + "laravel/dusk": "^7.13.0", + "orchestra/testbench": "^8.22.3|^9.0.4", + "pestphp/pest-dev-tools": "^2.16.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Pest\\Laravel\\PestServiceProvider" + ] + }, + "pest": { + "plugins": [ + "Pest\\Laravel\\Plugin" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Laravel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Laravel Plugin", + "keywords": [ + "framework", + "laravel", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-laravel/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2024-04-27T10:41:54+00:00" + }, + { + "name": "pestphp/pest-plugin-watch", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-watch.git", + "reference": "fd1866fac88215b9dbf0242a857864c95c26042e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-watch/zipball/fd1866fac88215b9dbf0242a857864c95c26042e", + "reference": "fd1866fac88215b9dbf0242a857864c95c26042e", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^2.1.1", + "php": "^8.1.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.5.0" + }, + "conflict": { + "evenement/evenement": "^1.0", + "pestphp/pest": "<2.33.0" + }, + "require-dev": { + "pestphp/pest": "^2.33.0", + "pestphp/pest-dev-tools": "^2.16.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + }, + "pest": { + "plugins": [ + "Pest\\Watch\\Plugin" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\Watch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Caneco", + "email": "caneco@me.com" + } + ], + "description": "The Pest Watch Plugin", + "keywords": [ + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit", + "watch" + ], + "support": { + "issues": "https://github.com/pestphp/pest-plugin-watch/issues", + "source": "https://github.com/pestphp/pest-plugin-watch/tree/v2.1.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2024-01-26T09:18:46+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.4", @@ -3782,6 +4086,94 @@ }, "time": "2024-02-23T11:10:43+00:00" }, + { + "name": "phpmyadmin/sql-parser", + "version": "5.9.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/sql-parser.git", + "reference": "011fa18a4e55591fac6545a821921dd1d61c6984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/011fa18a4e55591fac6545a821921dd1d61c6984", + "reference": "011fa18a4e55591fac6545a821921dd1d61c6984", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, + "require-dev": { + "phpbench/phpbench": "^1.1", + "phpmyadmin/coding-standard": "^3.0", + "phpmyadmin/motranslator": "^4.0 || ^5.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.9.12", + "phpstan/phpstan-phpunit": "^1.3.3", + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.11", + "zumba/json-serializer": "~3.0.2" + }, + "suggest": { + "ext-mbstring": "For best performance", + "phpmyadmin/motranslator": "Translate messages to your favorite locale" + }, + "bin": [ + "bin/highlight-query", + "bin/lint-query", + "bin/sql-parser", + "bin/tokenize-query" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", + "homepage": "https://github.com/phpmyadmin/sql-parser", + "keywords": [ + "analysis", + "lexer", + "parser", + "query linter", + "sql", + "sql lexer", + "sql linter", + "sql parser", + "sql syntax highlighter", + "sql tokenizer" + ], + "support": { + "issues": "https://github.com/phpmyadmin/sql-parser/issues", + "source": "https://github.com/phpmyadmin/sql-parser" + }, + "funding": [ + { + "url": "https://www.phpmyadmin.net/donate/", + "type": "other" + } + ], + "time": "2024-01-20T20:34:02+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.2", @@ -5101,6 +5493,235 @@ ], "time": "2024-04-27T21:32:50+00:00" }, + { + "name": "react/child-process", + "version": "v0.6.5", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-09-16T13:41:56+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, { "name": "rector/rector", "version": "1.1.0", diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..ecbc3af --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,11 @@ +includes: + - vendor/larastan/larastan/extension.neon +parameters: + noModelMake: false + paths: + - src/ + + # Level 9 is the highest level + level: 5 + reportUnmatchedIgnoredErrors: false + ignoreErrors: From be9aa61ff1248e3898a93d23bcda6ed4e43dff3e Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Fri, 21 Jun 2024 13:29:07 -0400 Subject: [PATCH 03/10] Basic framework for tests --- .gitignore | 2 + .phpunit-watcher.yml | 3 + composer.json | 8 +- composer.lock | 460 +++++++++++++++++- database/factories/TestPostFactory.php | 20 + database/factories/TestUserFactory.php | 25 + phpunit.xml | 8 + pint.json | 3 + src/Bundle.php | 26 +- src/Concerns/HasData.php | 15 + src/Concerns/HasPipeline.php | 22 + src/Concerns/Pipe/DefaultsPipe.php | 2 +- src/Concerns/Pipe/GeneratorsPipe.php | 2 +- src/Concerns/Pipe/InsertPipe.php | 3 +- src/Concerns/Pipe/MutatorsPipe.php | 2 +- src/Concerns/Pipe/RelatedPipe.php | 2 +- src/Concerns/Pipe/RelationsPipe.php | 2 +- src/Contracts/InteractsWithPipeline.php | 12 + src/Populator.php | 5 +- src/PopulatorServiceProvider.php | 3 + src/Processor.php | 20 +- .../Processors/InsertPipelineInvoker.php | 23 + src/Support/Processors/PipelineInvoker.php | 37 ++ tests/Feature/BundleTest.php | 58 +++ .../Concerns/Pipe/DefaultsPipeTest.php | 38 ++ .../Concerns/Pipe/GeneratorsPipeTest.php | 33 ++ .../Feature/Concerns/Pipe/InsertPipeTest.php | 41 ++ .../Concerns/Pipe/MutatorsPipeTest.php | 33 ++ .../Concerns/Pipe/RelationsPipeTest.php | 51 ++ tests/Feature/HasEnvironmentTest.php | 46 ++ tests/Feature/HasNameTest.php | 64 +++ tests/Feature/PipelineInvokerTest.php | 43 ++ tests/Feature/PopulatorTest.php | 37 +- tests/Fixtures/NullPipelineInvoker.php | 20 + tests/Fixtures/TestPost.php | 26 + tests/Fixtures/TestUser.php | 62 +++ .../Fixtures/database/create_posts_table.php | 28 ++ .../Fixtures/database/create_users_table.php | 29 ++ .../initial/test-post/example-post.php | 6 + .../initial/test-user/example-user.php | 7 + tests/TestCase.php | 28 ++ tests/Unit/HasDefaultsTest.php | 31 ++ tests/Unit/HasGeneratorsTest.php | 30 ++ tests/Unit/HasMutatorsTest.php | 31 ++ tests/Unit/HasRecordsTest.php | 53 ++ tests/Unit/MemoryTest.php | 35 ++ 46 files changed, 1507 insertions(+), 28 deletions(-) create mode 100644 .phpunit-watcher.yml create mode 100644 database/factories/TestPostFactory.php create mode 100644 database/factories/TestUserFactory.php create mode 100644 pint.json create mode 100644 src/Concerns/HasData.php create mode 100644 src/Concerns/HasPipeline.php create mode 100644 src/Contracts/InteractsWithPipeline.php create mode 100644 src/Support/Processors/InsertPipelineInvoker.php create mode 100644 src/Support/Processors/PipelineInvoker.php create mode 100644 tests/Feature/BundleTest.php create mode 100644 tests/Feature/Concerns/Pipe/DefaultsPipeTest.php create mode 100644 tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php create mode 100644 tests/Feature/Concerns/Pipe/InsertPipeTest.php create mode 100644 tests/Feature/Concerns/Pipe/MutatorsPipeTest.php create mode 100644 tests/Feature/Concerns/Pipe/RelationsPipeTest.php create mode 100644 tests/Feature/HasEnvironmentTest.php create mode 100644 tests/Feature/HasNameTest.php create mode 100644 tests/Feature/PipelineInvokerTest.php create mode 100644 tests/Fixtures/NullPipelineInvoker.php create mode 100644 tests/Fixtures/TestPost.php create mode 100644 tests/Fixtures/TestUser.php create mode 100644 tests/Fixtures/database/create_posts_table.php create mode 100644 tests/Fixtures/database/create_users_table.php create mode 100644 tests/Fixtures/database/populators/initial/test-post/example-post.php create mode 100644 tests/Fixtures/database/populators/initial/test-user/example-user.php create mode 100644 tests/Unit/HasDefaultsTest.php create mode 100644 tests/Unit/HasGeneratorsTest.php create mode 100644 tests/Unit/HasMutatorsTest.php create mode 100644 tests/Unit/HasRecordsTest.php create mode 100644 tests/Unit/MemoryTest.php diff --git a/.gitignore b/.gitignore index 2df6bef..823dcc0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /node_modules /.idea **/.DS_Store +/.phpunit.result.cache +/build \ No newline at end of file diff --git a/.phpunit-watcher.yml b/.phpunit-watcher.yml new file mode 100644 index 0000000..ccaf5a5 --- /dev/null +++ b/.phpunit-watcher.yml @@ -0,0 +1,3 @@ +notifications: + passingTests: false + failingTests: false \ No newline at end of file diff --git a/composer.json b/composer.json index 65834b7..f8549c9 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,9 @@ "pestphp/pest-plugin-laravel": "^2.4", "phpstan/phpstan": "^1.11", "pestphp/pest-plugin-watch": "^2.1", - "larastan/larastan": "^2.9" + "larastan/larastan": "^2.9", + "spatie/phpunit-watcher": "^1.24", + "laravel/pint": "^1.16" }, "autoload": { "psr-4": { @@ -31,7 +33,9 @@ }, "autoload-dev": { "psr-4": { - "Tests\\": "tests/" + "Tests\\": "tests/", + "Guava\\LaravelPopulator\\": "src/", + "Guava\\LaravelPopulator\\Database\\Factories\\": "database/factories" } }, "extra": { diff --git a/composer.lock b/composer.lock index a41febf..1d9f539 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": "3f258070b04873bc8c812078ee97885f", + "content-hash": "0e80d4bb51536514c6713b31620dc0aa", "packages": [], "packages-dev": [ { @@ -230,6 +230,218 @@ ], "time": "2023-12-11T17:09:12+00:00" }, + { + "name": "clue/stdio-react", + "version": "v2.6.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-stdio.git", + "reference": "dfa6c378aabdff718202d4e2453f752c38ea3399" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-stdio/zipball/dfa6c378aabdff718202d4e2453f752c38ea3399", + "reference": "dfa6c378aabdff718202d4e2453f752c38ea3399", + "shasum": "" + }, + "require": { + "clue/term-react": "^1.0 || ^0.1.1", + "clue/utf8-react": "^1.0 || ^0.1", + "php": ">=5.3", + "react/event-loop": "^1.2", + "react/stream": "^1.2" + }, + "require-dev": { + "clue/arguments": "^2.0", + "clue/commander": "^1.2", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "suggest": { + "ext-mbstring": "Using ext-mbstring should provide slightly better performance for handling I/O" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\Stdio\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Async, event-driven console input & output (STDIN, STDOUT) for truly interactive CLI applications, built on top of ReactPHP", + "homepage": "https://github.com/clue/reactphp-stdio", + "keywords": [ + "async", + "autocomplete", + "autocompletion", + "cli", + "history", + "interactive", + "reactphp", + "readline", + "stdin", + "stdio", + "stdout" + ], + "support": { + "issues": "https://github.com/clue/reactphp-stdio/issues", + "source": "https://github.com/clue/reactphp-stdio/tree/v2.6.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-03-18T15:09:30+00:00" + }, + { + "name": "clue/term-react", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-term.git", + "reference": "00f297dc597eaee2ebf98af8f27cca5d21d60fa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-term/zipball/00f297dc597eaee2ebf98af8f27cca5d21d60fa3", + "reference": "00f297dc597eaee2ebf98af8f27cca5d21d60fa3", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\Term\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming terminal emulator, built on top of ReactPHP.", + "homepage": "https://github.com/clue/reactphp-term", + "keywords": [ + "C0", + "CSI", + "ansi", + "apc", + "ascii", + "c1", + "control codes", + "dps", + "osc", + "pm", + "reactphp", + "streaming", + "terminal", + "vt100", + "xterm" + ], + "support": { + "issues": "https://github.com/clue/reactphp-term/issues", + "source": "https://github.com/clue/reactphp-term/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2024-01-30T10:22:09+00:00" + }, + { + "name": "clue/utf8-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-utf8.git", + "reference": "d5cd04d39cb5457aa5df830b7c4b301d2694217e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-utf8/zipball/d5cd04d39cb5457aa5df830b7c4b301d2694217e", + "reference": "d5cd04d39cb5457aa5df830b7c4b301d2694217e", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4 || ^0.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/stream": "^1.0 || ^0.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\Utf8\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming UTF-8 parser, built on top of ReactPHP.", + "homepage": "https://github.com/clue/reactphp-utf8", + "keywords": [ + "reactphp", + "streaming", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "issues": "https://github.com/clue/reactphp-utf8/issues", + "source": "https://github.com/clue/reactphp-utf8/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2023-12-06T14:52:17+00:00" + }, { "name": "composer/semver", "version": "3.4.0", @@ -1416,6 +1628,123 @@ }, "time": "2024-03-08T09:58:59+00:00" }, + { + "name": "jolicode/jolinotif", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/jolicode/JoliNotif.git", + "reference": "b34dac1826c8d33e9fd5c300546261e94f1ebdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/b34dac1826c8d33e9fd5c300546261e94f1ebdb8", + "reference": "b34dac1826c8d33e9fd5c300546261e94f1ebdb8", + "shasum": "" + }, + "require": { + "jolicode/php-os-helper": "^0.1.0", + "php": ">=8.1", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/deprecation-contracts": "^3", + "symfony/process": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-ffi": "Needed to send notifications via libnotify on Linux" + }, + "bin": [ + "jolinotif" + ], + "type": "library", + "autoload": { + "psr-4": { + "Joli\\JoliNotif\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Loïck Piera", + "email": "pyrech@gmail.com" + } + ], + "description": "Send desktop notifications on Windows, Linux, MacOS.", + "keywords": [ + "MAC", + "growl", + "linux", + "notification", + "windows" + ], + "support": { + "issues": "https://github.com/jolicode/JoliNotif/issues", + "source": "https://github.com/jolicode/JoliNotif/tree/v2.7.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/jolicode/jolinotif", + "type": "tidelift" + } + ], + "time": "2024-06-01T06:05:49+00:00" + }, + { + "name": "jolicode/php-os-helper", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/jolicode/php-os-helper.git", + "reference": "1622ad8bbcab98e62b5c041397e8519f10d90e29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jolicode/php-os-helper/zipball/1622ad8bbcab98e62b5c041397e8519f10d90e29", + "reference": "1622ad8bbcab98e62b5c041397e8519f10d90e29", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "^6.3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "JoliCode\\PhpOsHelper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Loïck Piera", + "email": "pyrech@gmail.com" + } + ], + "description": "Helpers to detect the OS of the machine where PHP is running.", + "keywords": [ + "linux", + "os", + "osx", + "php", + "windows" + ], + "support": { + "issues": "https://github.com/jolicode/php-os-helper/issues", + "source": "https://github.com/jolicode/php-os-helper/tree/v0.1.0" + }, + "time": "2023-12-03T12:46:03+00:00" + }, { "name": "larastan/larastan", "version": "v2.9.7", @@ -1725,6 +2054,72 @@ }, "time": "2024-06-18T16:46:35+00:00" }, + { + "name": "laravel/pint", + "version": "v1.16.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "9266a47f1b9231b83e0cfd849009547329d871b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/9266a47f1b9231b83e0cfd849009547329d871b1", + "reference": "9266a47f1b9231b83e0cfd849009547329d871b1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.59.3", + "illuminate/view": "^10.48.12", + "larastan/larastan": "^2.9.7", + "laravel-zero/framework": "^10.4.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.34.8" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2024-06-18T16:50:05+00:00" + }, { "name": "laravel/prompts", "version": "v0.1.24", @@ -6897,6 +7292,69 @@ }, "time": "2021-03-26T22:39:02+00:00" }, + { + "name": "spatie/phpunit-watcher", + "version": "1.24.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/phpunit-watcher.git", + "reference": "9353e6a6e49254cf266d860ab7fec2b5d37dab00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/9353e6a6e49254cf266d860ab7fec2b5d37dab00", + "reference": "9353e6a6e49254cf266d860ab7fec2b5d37dab00", + "shasum": "" + }, + "require": { + "clue/stdio-react": "^2.6", + "jolicode/jolinotif": "^2.7.1", + "php": "^8.1", + "symfony/console": "^6 | ^7.0.7", + "symfony/finder": "^6 | ^7.0.7", + "symfony/process": "^6 | ^7.0.7", + "symfony/yaml": "^6 | ^7.0.7" + }, + "conflict": { + "symfony/console": "<5.2" + }, + "require-dev": { + "phpunit/phpunit": "^10.5.20 | ^11.1.3", + "symfony/filesystem": "^6 | ^7.0.7" + }, + "bin": [ + "phpunit-watcher" + ], + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\PhpUnitWatcher\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Automatically rerun PHPUnit tests when source code changes", + "homepage": "https://github.com/spatie/phpunit-watcher", + "keywords": [ + "phpunit-watcher", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/phpunit-watcher/issues", + "source": "https://github.com/spatie/phpunit-watcher/tree/1.24.0" + }, + "time": "2024-05-22T09:31:00+00:00" + }, { "name": "spatie/ray", "version": "1.41.2", diff --git a/database/factories/TestPostFactory.php b/database/factories/TestPostFactory.php new file mode 100644 index 0000000..924c956 --- /dev/null +++ b/database/factories/TestPostFactory.php @@ -0,0 +1,20 @@ + TestUser::factory(), + 'content' => $this->faker->paragraph(), + ]; + } +} \ No newline at end of file diff --git a/database/factories/TestUserFactory.php b/database/factories/TestUserFactory.php new file mode 100644 index 0000000..4dc6690 --- /dev/null +++ b/database/factories/TestUserFactory.php @@ -0,0 +1,25 @@ + $this->faker->name(), + 'email' => $this->faker->safeEmail(), + 'password' => Hash::make('password'), + 'email_verified_at' => now(), + 'remember_token' => Str::random(10), + 'is_admin' => true, + ]; + } +} \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 859de97..666589e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -21,6 +21,14 @@ + + + + + + + + diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..70b0e18 --- /dev/null +++ b/pint.json @@ -0,0 +1,3 @@ +{ + "preset": "laravel" +} \ No newline at end of file diff --git a/src/Bundle.php b/src/Bundle.php index bc2ff15..12073c2 100644 --- a/src/Bundle.php +++ b/src/Bundle.php @@ -2,6 +2,7 @@ namespace Guava\LaravelPopulator; +use Closure; use Exception; use Guava\LaravelPopulator\Concerns\Bundle\HasDefaults; use Guava\LaravelPopulator\Concerns\Bundle\HasGenerators; @@ -9,6 +10,8 @@ use Guava\LaravelPopulator\Concerns\Bundle\HasRecords; use Guava\LaravelPopulator\Concerns\HasEnvironments; use Guava\LaravelPopulator\Concerns\HasName; +use Guava\LaravelPopulator\Concerns\HasPipeline; +use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; @@ -25,11 +28,14 @@ class Bundle use HasMutators; use HasGenerators; use HasRecords; + use HasPipeline; public Model $model; public string $table; public Populator $populator; + protected ?Closure $makeProcessorUsing = null; + /** * Can be used to set up repeating samples. @@ -58,7 +64,8 @@ public function handle(Populator $populator): void collect($this->records) ->each(function (array $record, $key) { $modelName = $this->model::class; - Processor::make($this) + $this->makeProcessor() + ->pipeableUsing($this->populator->getPipeable() ?? $this->getPipeable()) ->process($record, is_int($key) ? "{$modelName}-$key" : $key); }); @@ -88,6 +95,7 @@ public function handle(Populator $populator): void ->toString(); Processor::make($this) + ->pipeableUsing($this->getPipeable() ?? $this->populator->getPipeable()) ->process($data, $name); }); }); @@ -98,6 +106,22 @@ public function handle(Populator $populator): void } } + public function makeProcessorUsing(?Closure $closure): static + { + $this->makeProcessorUsing = $closure; + return $this; + } + + + protected function makeProcessor(): Processor + { + if($processor = $this->makeProcessorUsing) { + return $processor($this); + } + return Processor::make($this); + + } + /** * Creates an instance of the class. */ diff --git a/src/Concerns/HasData.php b/src/Concerns/HasData.php new file mode 100644 index 0000000..3118608 --- /dev/null +++ b/src/Concerns/HasData.php @@ -0,0 +1,15 @@ +data; + } +} \ No newline at end of file diff --git a/src/Concerns/HasPipeline.php b/src/Concerns/HasPipeline.php new file mode 100644 index 0000000..89e4299 --- /dev/null +++ b/src/Concerns/HasPipeline.php @@ -0,0 +1,22 @@ +pipeable = $withPipeline; + } + return $this; + } + + public function getPipeable(): ?InteractsWithPipeline { + return $this->pipeable; + } +} \ No newline at end of file diff --git a/src/Concerns/Pipe/DefaultsPipe.php b/src/Concerns/Pipe/DefaultsPipe.php index ea626b0..626f60d 100644 --- a/src/Concerns/Pipe/DefaultsPipe.php +++ b/src/Concerns/Pipe/DefaultsPipe.php @@ -13,7 +13,7 @@ trait DefaultsPipe * @param Collection $data * @return Collection */ - protected function defaults(Collection $data): Collection + public function defaults(Collection $data): Collection { return $data ->when($this->bundle->model->usesTimestamps(), diff --git a/src/Concerns/Pipe/GeneratorsPipe.php b/src/Concerns/Pipe/GeneratorsPipe.php index 463c676..660fcaa 100644 --- a/src/Concerns/Pipe/GeneratorsPipe.php +++ b/src/Concerns/Pipe/GeneratorsPipe.php @@ -13,7 +13,7 @@ trait GeneratorsPipe * @param Collection $data * @return Collection */ - protected function generators(Collection $data): Collection + public function generators(Collection $data): Collection { return $data ->when(fn() => !empty($this->bundle->generators), diff --git a/src/Concerns/Pipe/InsertPipe.php b/src/Concerns/Pipe/InsertPipe.php index 5023ac8..2d7436a 100644 --- a/src/Concerns/Pipe/InsertPipe.php +++ b/src/Concerns/Pipe/InsertPipe.php @@ -13,7 +13,7 @@ trait InsertPipe * @param Collection $data * @return Collection */ - protected function insert(Collection $data): Collection + public function insert(Collection $data): Collection { $id = DB::table($this->bundle->table) ->insertGetId($data->toArray()); @@ -22,7 +22,6 @@ protected function insert(Collection $data): Collection if (!$this->bundle->model->getIncrementing()) { $id = $data->get($this->bundle->model->getKeyName()); } - $this->bundle->populator->memory->set($this->bundle->model::class, $this->name, $id); return $data; diff --git a/src/Concerns/Pipe/MutatorsPipe.php b/src/Concerns/Pipe/MutatorsPipe.php index 83c2e6e..57ba597 100644 --- a/src/Concerns/Pipe/MutatorsPipe.php +++ b/src/Concerns/Pipe/MutatorsPipe.php @@ -13,7 +13,7 @@ trait MutatorsPipe * @param Collection $data * @return Collection */ - protected function mutate(Collection $data): Collection + public function mutate(Collection $data): Collection { return $data ->when(fn() => !empty($this->bundle->mutators), diff --git a/src/Concerns/Pipe/RelatedPipe.php b/src/Concerns/Pipe/RelatedPipe.php index 2661e9c..11b1696 100644 --- a/src/Concerns/Pipe/RelatedPipe.php +++ b/src/Concerns/Pipe/RelatedPipe.php @@ -19,7 +19,7 @@ trait RelatedPipe * @param Collection $data * @return Collection */ - protected function related(Collection $data): Collection + public function related(Collection $data): Collection { $id = $this->bundle->populator->memory->get($this->bundle->model::class, $this->name); diff --git a/src/Concerns/Pipe/RelationsPipe.php b/src/Concerns/Pipe/RelationsPipe.php index 0116768..11cbeaa 100644 --- a/src/Concerns/Pipe/RelationsPipe.php +++ b/src/Concerns/Pipe/RelationsPipe.php @@ -29,7 +29,7 @@ trait RelationsPipe * @return Collection * @throws InvalidBundleException */ - protected function relations(Collection $data): Collection + public function relations(Collection $data): Collection { return $data ->mapWithKeys(function ($value, $relationName) { diff --git a/src/Contracts/InteractsWithPipeline.php b/src/Contracts/InteractsWithPipeline.php new file mode 100644 index 0000000..2b7b027 --- /dev/null +++ b/src/Contracts/InteractsWithPipeline.php @@ -0,0 +1,12 @@ +memory = new Memory(); - foreach ($this->bundles as $bundle) { $bundle->handle($this); } @@ -66,6 +66,7 @@ private function handle(): void */ private function __construct(string $name) { $this->name = $name; + $this->memory = new Memory(); } /** diff --git a/src/PopulatorServiceProvider.php b/src/PopulatorServiceProvider.php index 3380c41..e02d219 100644 --- a/src/PopulatorServiceProvider.php +++ b/src/PopulatorServiceProvider.php @@ -4,6 +4,8 @@ use Guava\LaravelPopulator\Console\MakePopulatorCommand; use Guava\LaravelPopulator\Console\MakeSampleCommand; +use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; +use Guava\LaravelPopulator\Support\Processors\InsertPipelineInvoker; use Illuminate\Support\ServiceProvider; class PopulatorServiceProvider extends ServiceProvider @@ -12,6 +14,7 @@ class PopulatorServiceProvider extends ServiceProvider public function register(): void { $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'populator'); + $this->app->bind(InteractsWithPipeline::class, InsertPipelineInvoker::class); } public function boot(): void diff --git a/src/Processor.php b/src/Processor.php index 6f972e3..1c5f82a 100644 --- a/src/Processor.php +++ b/src/Processor.php @@ -2,12 +2,15 @@ namespace Guava\LaravelPopulator; +use Guava\LaravelPopulator\Concerns\HasData; +use Guava\LaravelPopulator\Concerns\HasPipeline; use Guava\LaravelPopulator\Concerns\Pipe\DefaultsPipe; use Guava\LaravelPopulator\Concerns\Pipe\GeneratorsPipe; use Guava\LaravelPopulator\Concerns\Pipe\InsertPipe; use Guava\LaravelPopulator\Concerns\Pipe\MutatorsPipe; use Guava\LaravelPopulator\Concerns\Pipe\RelatedPipe; use Guava\LaravelPopulator\Concerns\Pipe\RelationsPipe; +use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; use Guava\LaravelPopulator\Storage\Memory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -24,11 +27,12 @@ class Processor use GeneratorsPipe; use InsertPipe; use RelatedPipe; + use HasData; + use HasPipeline; protected Bundle $bundle; protected \SplFileInfo $file; - protected Collection $data; protected string $name; protected Memory $memory; @@ -44,17 +48,8 @@ public function process(array|Collection $data, string $name): void { $this->data = is_array($data) ? collect($data) : $data; $this->name = $name; + $this->pipeable->processPipeline($this, $this->data); - - - $this->data->pipeThrough([ - $this->relations(...), - $this->defaults(...), - $this->mutate(...), - $this->generators(...), - $this->insert(...), - $this->related(...), - ]); } /** @@ -92,9 +87,10 @@ protected function getPrimaryId(Model $model, string $identifier): int|string|nu /** * Creates an instance of the class. */ - private function __construct(Bundle $bundle) + public function __construct(Bundle $bundle, ?InteractsWithPipeline $invoker = null) { $this->bundle = $bundle; + $this->pipeable = $invoker ?? app(InteractsWithPipeline::class); $this->memory = new Memory(); } diff --git a/src/Support/Processors/InsertPipelineInvoker.php b/src/Support/Processors/InsertPipelineInvoker.php new file mode 100644 index 0000000..42dc2cb --- /dev/null +++ b/src/Support/Processors/InsertPipelineInvoker.php @@ -0,0 +1,23 @@ +relations(...), + $processor->defaults(...), + $processor->mutate(...), + $processor->generators(...), + $processor->insert(...), + $processor->related(...), + ]; + } +} \ No newline at end of file diff --git a/src/Support/Processors/PipelineInvoker.php b/src/Support/Processors/PipelineInvoker.php new file mode 100644 index 0000000..93d4e3e --- /dev/null +++ b/src/Support/Processors/PipelineInvoker.php @@ -0,0 +1,37 @@ +pipeThrough($this->pipes($processor)); + } + + public function usingPipes(Closure $pipes): static + { + $this->usingPipes = $pipes; + return $this; + } + + protected function pipes(Processor $processor): array + { + if($pipe = $this->usingPipes) { + return $pipe($processor); + } + return $this->defaultPipes($processor); + } + + abstract function defaultPipes(Processor $processor): array; + +} \ No newline at end of file diff --git a/tests/Feature/BundleTest.php b/tests/Feature/BundleTest.php new file mode 100644 index 0000000..c69b750 --- /dev/null +++ b/tests/Feature/BundleTest.php @@ -0,0 +1,58 @@ +records([ + 'user-foo' => TestUser::factory()->raw([ + 'name' => 'Foo', + 'email' => 'foo@example.com', + ]), + ]); + $bundle->handle($populator); + + $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); + } + + public function test_handle_with_filesystem_backed_records() + { + $populator = Populator::make('initial'); + (Bundle::make(TestUser::class))->handle($populator); + (Bundle::make(TestPost::class))->handle($populator); + + $this->assertEquals(1, TestUser::whereEmail('foo@example.com')->count('posts')); + + } + + public function test_handle_with_filesystem_backed_records_throws_missing_directory_exception() + { + $this->expectExceptionMessageMatches('/^A directory for the bundle of/'); + $populator = Populator::make('initial_v2'); + $bundle = Bundle::make(TestUser::class); + $bundle->handle($populator); + } + + // public function test_setup() + // { + // + // } + // + // public function test_make() + // { + // + // } +} diff --git a/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php b/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php new file mode 100644 index 0000000..c923f22 --- /dev/null +++ b/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php @@ -0,0 +1,38 @@ +pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [ + $processor->defaults(...), + function (Collection $collection) { + $this->assertEquals('bar', $collection->get('foo')); + }, + ] + )) + ->bundles([ + Bundle::make(TestUser::class) + ->default('foo', 'bar'), + ]); + $populator->call(); + + } +} diff --git a/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php b/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php new file mode 100644 index 0000000..301ae81 --- /dev/null +++ b/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php @@ -0,0 +1,33 @@ +pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [ + $processor->generators(...), + function (Collection $collection) { + $this->assertEquals('bar', $collection->get('foo')); + }, + ] + )) + ->bundles([ + Bundle::make(TestUser::class) + ->generate('foo', fn () => 'bar'), + ]); + $populator->call(); + + } +} diff --git a/tests/Feature/Concerns/Pipe/InsertPipeTest.php b/tests/Feature/Concerns/Pipe/InsertPipeTest.php new file mode 100644 index 0000000..11b14c0 --- /dev/null +++ b/tests/Feature/Concerns/Pipe/InsertPipeTest.php @@ -0,0 +1,41 @@ +pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [$processor->insert(...)] + )) + ->bundles([ + Bundle::make(TestUser::class), + ]) + ->call(); + + $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); + } + + public function test_insert_non_incrementing_id() + { + Populator::make('initial') + ->pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [$processor->insert(...)] + )) + ->bundles([ + Bundle::make(TestUser::class), + ]) + ->call(); + + $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); + } +} diff --git a/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php b/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php new file mode 100644 index 0000000..7d3f15a --- /dev/null +++ b/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php @@ -0,0 +1,33 @@ +pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [ + $processor->mutate(...), + function (Collection $collection) { + $this->assertEquals('FOO@EXAMPLE.COM', $collection->get('email')); + }, + ] + )) + ->bundles([ + Bundle::make(TestUser::class) + ->mutate('email', fn ($value) => strtoupper($value)), + ]); + $populator->call(); + + } +} diff --git a/tests/Feature/Concerns/Pipe/RelationsPipeTest.php b/tests/Feature/Concerns/Pipe/RelationsPipeTest.php new file mode 100644 index 0000000..6e0d747 --- /dev/null +++ b/tests/Feature/Concerns/Pipe/RelationsPipeTest.php @@ -0,0 +1,51 @@ +pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [ + $processor->relations(...), + function (Collection $collection) { + $this->assertEquals(1, $collection->get('user_id')); + }, + ] + )) + ->bundles([ + Bundle::make(TestPost::class) + ->makeProcessorUsing(function (Bundle $bundle) { + $processor = \Mockery::mock( + Processor::class, + [$bundle] + ) + ->makePartial(); + + return $processor + ->shouldAllowMockingProtectedMethods() + ->shouldReceive('getPrimaryId')->once()->andReturn(1) + ->getMock(); + }) + ->records([ + 'post-one' => [ + 'owner' => 'email:foo@example.com', + 'content' => 'test', + ], + ]), + ]); + $populator->call(); + + } +} diff --git a/tests/Feature/HasEnvironmentTest.php b/tests/Feature/HasEnvironmentTest.php new file mode 100644 index 0000000..bc30c36 --- /dev/null +++ b/tests/Feature/HasEnvironmentTest.php @@ -0,0 +1,46 @@ +target = new class + { + use HasEnvironments; + }; + } + + public function test_environments_starts_empty() + { + $this->assertEmpty($this->target->environments); + } + + public function test_environments_sets_environments() + { + $this->target->environments(['foo', 'bar']); + $this->assertEquals(['foo', 'bar'], $this->target->environments); + } + + public function test_get_environments_returns_environments() + { + $this->target->environments(['foo', 'bar']); + $this->assertEquals($this->target->environments, $this->target->getEnvironments()); + } + + public function test_check_environment_checks_against_laravel_environment() + { + $this->target->environments(['foo', 'bar']); + $this->assertFalse($this->target->checkEnvironment()); + $this->target->environments(['testing']); + $this->assertTrue($this->target->checkEnvironment()); + } +} diff --git a/tests/Feature/HasNameTest.php b/tests/Feature/HasNameTest.php new file mode 100644 index 0000000..dca9436 --- /dev/null +++ b/tests/Feature/HasNameTest.php @@ -0,0 +1,64 @@ +target = new class + { + use HasName; + }; + } + + public function test_name_starts_uninitialized() + { + $this->assertFalse(isset($this->target->name)); + } + + public function test_get_name_returns_name_if_set() + { + $this->target->name = 'foo'; + $this->assertEquals('foo', $this->target->getName()); + } + + public function test_get_name_class_with_namespace() + { + $this->target->name = null; + $this->assertEquals('app.-foo', //FIXME this doesn't seem to be the desired behavior + $this->target->getName('App\\Foo', true) + ); + } + + public function test_get_name_class_without_namespace() + { + $this->target->name = null; + $this->assertEquals('foo', + $this->target->getName('App\\Foo', false) + ); + } + + public function test_get_name_without_class_calls_static_class_for_name() + { + $this->target->name = null; + $this->assertStringStartsWith('has-name-test.php', + $this->target->getName() + ); + } + + public function test_get_name_removes_the_string_populator_from_class() + { + $this->target->name = null; + $this->assertEquals('foo', + $this->target->getName('App\\FooPopulator', false) + ); + } +} diff --git a/tests/Feature/PipelineInvokerTest.php b/tests/Feature/PipelineInvokerTest.php new file mode 100644 index 0000000..1b9423e --- /dev/null +++ b/tests/Feature/PipelineInvokerTest.php @@ -0,0 +1,43 @@ +app->bind(InteractsWithPipeline::class, fn () => (new InsertPipelineInvoker())->usingPipes( + fn (Processor $processor) => [$processor->insert(...)] + )); + + Populator::make('initial') + ->bundles([ + Bundle::make(TestUser::class), + ]) + ->call(); + + $this->assertNotNull($user = TestUser::whereEmail('foo@example.com')->sole()); + + $user->delete(); + + $this->app->bind(InteractsWithPipeline::class, fn () => (new InsertPipelineInvoker())->usingPipes( + fn (Processor $processor) => [] + )); + + Populator::make('initial') + ->bundles([ + Bundle::make(TestUser::class), + ]) + ->call(); + + $this->assertFalse(TestUser::whereEmail('foo@example.com')->exists()); + } +} diff --git a/tests/Feature/PopulatorTest.php b/tests/Feature/PopulatorTest.php index da4326e..cb2cf41 100644 --- a/tests/Feature/PopulatorTest.php +++ b/tests/Feature/PopulatorTest.php @@ -1,5 +1,36 @@ toBe([]); -}); \ No newline at end of file +namespace Tests\Feature; + +use Guava\LaravelPopulator\Bundle; +use Guava\LaravelPopulator\Populator; +use Tests\Fixtures\TestUser; +use Tests\TestCase; + +class PopulatorTest extends TestCase +{ + public function test_bundles_sets_bundles() + { + $bundle = Bundle::make(TestUser::class); + $this->assertEquals([$bundle], Populator::make('test') + ->bundles([ + $bundle, + ])->bundles); + } + + public function test_only_handles_in_current_environment() + { + $bundle = $this->spy(Bundle::class); + Populator::make('test') + ->bundles([$bundle]) + ->call(); + $bundle->shouldHaveReceived('handle'); + + $bundle = $this->spy(Bundle::class); + Populator::make('test') + ->environments(['local']) + ->bundles([$bundle]) + ->call(); + $bundle->shouldNotHaveReceived('handle'); + } +} diff --git a/tests/Fixtures/NullPipelineInvoker.php b/tests/Fixtures/NullPipelineInvoker.php new file mode 100644 index 0000000..9b67e3b --- /dev/null +++ b/tests/Fixtures/NullPipelineInvoker.php @@ -0,0 +1,20 @@ + + */ + public function owner(): BelongsTo + { + return $this->belongsTo(TestUser::class, 'user_id'); + } +} diff --git a/tests/Fixtures/TestUser.php b/tests/Fixtures/TestUser.php new file mode 100644 index 0000000..86681fc --- /dev/null +++ b/tests/Fixtures/TestUser.php @@ -0,0 +1,62 @@ + 'boolean', + ]; + + /** + * @return HasMany + */ + public function posts(): HasMany + { + return $this->hasMany(TestPost::class, 'user_id'); + } + + public function getAuthIdentifierName(): string + { + return 'test-user-auth-identifier-name'; + } + + public function getAuthIdentifier(): string + { + return 'test-user-auth-identifier'; + } + + public function getAuthPassword(): string + { + return 'test-user-auth-password'; + } + + public function getRememberToken(): string + { + return 'test-user-remember-token'; + } + + public function setRememberToken($value): void + { + // + } + + public function getRememberTokenName(): string + { + return 'test-user-remember-token-name'; + } +} diff --git a/tests/Fixtures/database/create_posts_table.php b/tests/Fixtures/database/create_posts_table.php new file mode 100644 index 0000000..d46d243 --- /dev/null +++ b/tests/Fixtures/database/create_posts_table.php @@ -0,0 +1,28 @@ +id(); + $table->timestamps(); + $table->foreignId('user_id') + ->constrained('users') + ->cascadeOnDelete() + ->cascadeOnUpdate(); + $table->text('content'); + }); + } + + public function down(): void + { + Schema::dropIfExists('posts'); + } +}; diff --git a/tests/Fixtures/database/create_users_table.php b/tests/Fixtures/database/create_users_table.php new file mode 100644 index 0000000..a3ced88 --- /dev/null +++ b/tests/Fixtures/database/create_users_table.php @@ -0,0 +1,29 @@ +id(); + $table->string('name'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->rememberToken(); + $table->boolean('is_admin')->default(false); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('users'); + } +}; diff --git a/tests/Fixtures/database/populators/initial/test-post/example-post.php b/tests/Fixtures/database/populators/initial/test-post/example-post.php new file mode 100644 index 0000000..cdadcaa --- /dev/null +++ b/tests/Fixtures/database/populators/initial/test-post/example-post.php @@ -0,0 +1,6 @@ + 'example-user', + 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', +]; diff --git a/tests/Fixtures/database/populators/initial/test-user/example-user.php b/tests/Fixtures/database/populators/initial/test-user/example-user.php new file mode 100644 index 0000000..5999e05 --- /dev/null +++ b/tests/Fixtures/database/populators/initial/test-user/example-user.php @@ -0,0 +1,7 @@ + 'Foo', + 'email' => 'foo@example.com', + 'password' => 'password', +]; diff --git a/tests/TestCase.php b/tests/TestCase.php index 723435d..761fa3d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,14 +3,42 @@ namespace Tests; use Guava\LaravelPopulator\PopulatorServiceProvider; +use Illuminate\Database\Eloquent\Factories\Factory; use Orchestra\Testbench\TestCase as Orchestra; abstract class TestCase extends Orchestra { + protected function todo(): void + { + $caller = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]; + self::markTestIncomplete(sprintf('Todo: %s::%s', $caller['class'], $caller['function'])); + } + + protected function setUp(): void + { + parent::setUp(); + + Factory::guessFactoryNamesUsing( + fn ( + string $modelName, + ) => 'Guava\\LaravelPopulator\\Database\\Factories\\'.class_basename($modelName).'Factory' + ); + } + protected function getPackageProviders($app) { return [ PopulatorServiceProvider::class, ]; } + + protected function defineDatabaseMigrations(): void + { + $this->loadMigrationsFrom(__DIR__.'/Fixtures/database'); + } + + public function defineEnvironment($app): void + { + $app->useDatabasePath(__DIR__.'/Fixtures/database'); + } } diff --git a/tests/Unit/HasDefaultsTest.php b/tests/Unit/HasDefaultsTest.php new file mode 100644 index 0000000..819f7bf --- /dev/null +++ b/tests/Unit/HasDefaultsTest.php @@ -0,0 +1,31 @@ +target = new class + { + use HasDefaults; + }; + } + + public function test_defaults_starts_empty() + { + $this->assertEmpty($this->target->defaults); + } + + public function test_default() + { + $this->target->default('foo', 'bar'); + $this->assertArrayHasKey('foo', $this->target->defaults); + $this->assertEquals('bar', $this->target->defaults['foo']); + } +} diff --git a/tests/Unit/HasGeneratorsTest.php b/tests/Unit/HasGeneratorsTest.php new file mode 100644 index 0000000..5152c99 --- /dev/null +++ b/tests/Unit/HasGeneratorsTest.php @@ -0,0 +1,30 @@ +target = new class + { + use HasGenerators; + }; + } + + public function test_generators_starts_empty() + { + $this->assertEmpty($this->target->generators); + } + + public function test_generate() + { + $this->target->generate('foo', fn () => 'bar'); + $this->assertIsCallable($this->target->generators['foo']); + } +} diff --git a/tests/Unit/HasMutatorsTest.php b/tests/Unit/HasMutatorsTest.php new file mode 100644 index 0000000..28edfc9 --- /dev/null +++ b/tests/Unit/HasMutatorsTest.php @@ -0,0 +1,31 @@ +target = new class + { + use HasMutators; + }; + } + + public function test_mutate_starts_empty() + { + $this->assertEmpty($this->target->mutators); + } + + public function test_mutate() + { + $this->target->mutate('foo', fn () => 'bar'); + $this->assertArrayHasKey('foo', $this->target->mutators); + $this->assertIsCallable($this->target->mutators['foo']); + } +} diff --git a/tests/Unit/HasRecordsTest.php b/tests/Unit/HasRecordsTest.php new file mode 100644 index 0000000..8ca35af --- /dev/null +++ b/tests/Unit/HasRecordsTest.php @@ -0,0 +1,53 @@ +target = new class + { + use HasRecords; + }; + } + + public function test_records_starts_empty() + { + $this->assertEmpty($this->target->records); + } + + public function test_record() + { + $this->target->record('foo', fn () => [ + 'baz' => 'bee', + ]); + $this->target->record('bar', [ + 'baz' => 'bee', + ]); + $this->assertEquals(['foo' => ['baz' => 'bee'], 'bar' => ['baz' => 'bee']], $this->target->records); + } + + public function test_records_callable() + { + $this->target->records(fn () => [ + 'foo' => ['baz' => 'bee'], + 'bar' => ['baz' => 'bee'], + ]); + $this->assertEquals(['foo' => ['baz' => 'bee'], 'bar' => ['baz' => 'bee']], $this->target->records); + } + + public function test_records_array() + { + $this->target->records([ + 'foo' => ['baz' => 'bee'], + 'bar' => ['baz' => 'bee'], + ]); + $this->assertEquals(['foo' => ['baz' => 'bee'], 'bar' => ['baz' => 'bee']], $this->target->records); + } +} diff --git a/tests/Unit/MemoryTest.php b/tests/Unit/MemoryTest.php new file mode 100644 index 0000000..544c651 --- /dev/null +++ b/tests/Unit/MemoryTest.php @@ -0,0 +1,35 @@ +storage = new Memory(); + } + + public function test_all_starts_empty() + { + $this->assertEmpty($this->storage->all()); + } + + public function test_get_value() + { + $this->assertNull($this->storage->get('foo', 'bar')); + $this->storage->set('foo', 'bar', 'baz'); + $this->assertEquals('baz', $this->storage->get('foo', 'bar')); + } + + public function test_has_value() + { + $this->assertFalse($this->storage->has('foo', 'bar')); + $this->storage->set('foo', 'bar', 'baz'); + $this->assertTrue($this->storage->has('foo', 'bar')); + } +} From 45c5e3e23ae3923ceb6b0d0aab1510e1eaefbef9 Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Fri, 21 Jun 2024 21:08:30 -0400 Subject: [PATCH 04/10] fixed issue where HasOne, HasMany, MorphsOne and MorphsMany relationships were not being created --- src/Concerns/Pipe/RelatedPipe.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Concerns/Pipe/RelatedPipe.php b/src/Concerns/Pipe/RelatedPipe.php index 11b1696..9b72bf2 100644 --- a/src/Concerns/Pipe/RelatedPipe.php +++ b/src/Concerns/Pipe/RelatedPipe.php @@ -4,7 +4,11 @@ use Guava\LaravelPopulator\Bundle; use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasOneOrMany; +use Illuminate\Database\Eloquent\Relations\MorphMany; +use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphOneOrMany; use Illuminate\Database\Eloquent\Relations\MorphToMany; use Illuminate\Support\Collection; @@ -27,7 +31,11 @@ public function related(Collection $data): Collection foreach ($relations as $name => $relation) { - if ($relation['relation'] === HasOneOrMany::class) { + if ( + $relation['relation'] === HasOneOrMany::class + || $relation['relation'] === HasOne::class + || $relation['relation'] === HasMany::class + ) { $bundle = Bundle::make($relation['related']); $bundle->populator = $this->bundle->populator; @@ -52,7 +60,10 @@ public function related(Collection $data): Collection ]); } - if ($relation['relation'] === MorphOneOrMany::class) { + if ($relation['relation'] === MorphOneOrMany::class + || $relation['relation'] === MorphOne::class + || $relation['relation'] === MorphMany::class + ) { $bundle = Bundle::make($relation['related']); $bundle->populator = $this->bundle->populator; From 0be9a5cd15e35aa3c589b32f3f7ec9067d4db59f Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Fri, 21 Jun 2024 23:00:33 -0400 Subject: [PATCH 05/10] fixed array to string conversion error --- src/Concerns/Pipe/Relations/MorphRelations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Concerns/Pipe/Relations/MorphRelations.php b/src/Concerns/Pipe/Relations/MorphRelations.php index 6cfee73..71bb1f7 100644 --- a/src/Concerns/Pipe/Relations/MorphRelations.php +++ b/src/Concerns/Pipe/Relations/MorphRelations.php @@ -29,7 +29,7 @@ protected function morphTo(MorphTo $relation, array $value): array if (!$id) { $bundleName = $this->bundle->model::class; - throw new InvalidBundleException("Item {$this->name} from Sample {$bundleName} has an invalid belongsToMany relation set for {$relation->getRelationName()} (value: {$value})."); + throw new InvalidBundleException("Item {$this->name} from Sample {$bundleName} has an invalid belongsToMany relation set for {$relation->getRelationName()} (value: {$value[0]})."); } return [$relation->getForeignKeyName() => $id, $relation->getMorphType() => $value[1]]; From c445355d19d649fa82eb5a7765dd3dbeaf002a9c Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Fri, 21 Jun 2024 23:48:24 -0400 Subject: [PATCH 06/10] removed unused method --- src/Bundle.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/Bundle.php b/src/Bundle.php index 12073c2..8329daa 100644 --- a/src/Bundle.php +++ b/src/Bundle.php @@ -37,15 +37,6 @@ class Bundle protected ?Closure $makeProcessorUsing = null; - /** - * Can be used to set up repeating samples. - * - * @return void - */ - public function setup(): void - { - } - /** * Parses all samples from the populators directory and attempts to insert them into the database. * @param Populator $populator From 69b690799fb68ec2f6266748e56982ad4ccf256c Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Sat, 22 Jun 2024 00:23:53 -0400 Subject: [PATCH 07/10] tests completed --- composer.json | 3 - composer.lock | 1055 +---------------- src/Concerns/HasData.php | 5 - src/PopulatorServiceProvider.php | 2 - tests/Feature/BundleTest.php | 23 +- .../{ => Concerns}/HasEnvironmentTest.php | 2 +- tests/Feature/{ => Concerns}/HasNameTest.php | 2 +- .../Concerns/Pipe/RelationsPipeTest.php | 2 +- .../Feature/PopulatorServiceProviderTest.php | 27 + tests/Feature/ProcessorTest.php | 305 +++++ tests/Fixtures/FakeBelongsTo.php | 35 + tests/Fixtures/TestComment.php | 19 + tests/Fixtures/TestImage.php | 19 + tests/Fixtures/TestPhone.php | 21 + tests/Fixtures/TestPost.php | 40 +- tests/Fixtures/TestRole.php | 28 + tests/Fixtures/TestTag.php | 42 + tests/Fixtures/TestUser.php | 29 + ... 2024_06_22_000001_create_users_table.php} | 0 ... 2024_06_22_000002_create_posts_table.php} | 2 +- ...024_06_22_000003_create_comments_table.php | 22 + .../2024_06_22_000003_create_images_table.php | 22 + ...24_06_22_000003_create_role_user_table.php | 24 + .../2024_06_22_000003_create_roles_table.php | 21 + .../2024_06_22_000003_create_tags_table.php | 21 + ...24_06_22_000004_create_taggables_table.php | 20 + .../2024_06_22_000005_create_phones_table.php | 25 + .../initial/test-post/example-post.php | 3 +- 28 files changed, 751 insertions(+), 1068 deletions(-) rename tests/Feature/{ => Concerns}/HasEnvironmentTest.php (97%) rename tests/Feature/{ => Concerns}/HasNameTest.php (97%) create mode 100644 tests/Feature/PopulatorServiceProviderTest.php create mode 100644 tests/Feature/ProcessorTest.php create mode 100644 tests/Fixtures/FakeBelongsTo.php create mode 100644 tests/Fixtures/TestComment.php create mode 100644 tests/Fixtures/TestImage.php create mode 100644 tests/Fixtures/TestPhone.php create mode 100644 tests/Fixtures/TestRole.php create mode 100644 tests/Fixtures/TestTag.php rename tests/Fixtures/database/{create_users_table.php => 2024_06_22_000001_create_users_table.php} (100%) rename tests/Fixtures/database/{create_posts_table.php => 2024_06_22_000002_create_posts_table.php} (93%) create mode 100644 tests/Fixtures/database/2024_06_22_000003_create_comments_table.php create mode 100644 tests/Fixtures/database/2024_06_22_000003_create_images_table.php create mode 100644 tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php create mode 100644 tests/Fixtures/database/2024_06_22_000003_create_roles_table.php create mode 100644 tests/Fixtures/database/2024_06_22_000003_create_tags_table.php create mode 100644 tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php create mode 100644 tests/Fixtures/database/2024_06_22_000005_create_phones_table.php diff --git a/composer.json b/composer.json index f8549c9..bcc46d3 100644 --- a/composer.json +++ b/composer.json @@ -18,10 +18,7 @@ }, "require-dev": { "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.34", - "pestphp/pest-plugin-laravel": "^2.4", "phpstan/phpstan": "^1.11", - "pestphp/pest-plugin-watch": "^2.1", "larastan/larastan": "^2.9", "spatie/phpunit-watcher": "^1.24", "laravel/pint": "^1.16" diff --git a/composer.lock b/composer.lock index 1d9f539..b8ca2bb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,103 +4,9 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0e80d4bb51536514c6713b31620dc0aa", + "content-hash": "b0b9d4f7e3483ea7bb1e49cf576bba80", "packages": [], "packages-dev": [ - { - "name": "brianium/paratest", - "version": "v7.4.3", - "source": { - "type": "git", - "url": "https://github.com/paratestphp/paratest.git", - "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", - "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-simplexml": "*", - "fidry/cpu-core-counter": "^1.1.0", - "jean85/pretty-package-versions": "^2.0.5", - "php": "~8.2.0 || ~8.3.0", - "phpunit/php-code-coverage": "^10.1.11 || ^11.0.0", - "phpunit/php-file-iterator": "^4.1.0 || ^5.0.0", - "phpunit/php-timer": "^6.0.0 || ^7.0.0", - "phpunit/phpunit": "^10.5.9 || ^11.0.3", - "sebastian/environment": "^6.0.1 || ^7.0.0", - "symfony/console": "^6.4.3 || ^7.0.3", - "symfony/process": "^6.4.3 || ^7.0.3" - }, - "require-dev": { - "doctrine/coding-standard": "^12.0.0", - "ext-pcov": "*", - "ext-posix": "*", - "phpstan/phpstan": "^1.10.58", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "squizlabs/php_codesniffer": "^3.9.0", - "symfony/filesystem": "^6.4.3 || ^7.0.3" - }, - "bin": [ - "bin/paratest", - "bin/paratest.bat", - "bin/paratest_for_phpstorm" - ], - "type": "library", - "autoload": { - "psr-4": { - "ParaTest\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Scaturro", - "email": "scaturrob@gmail.com", - "role": "Developer" - }, - { - "name": "Filippo Tessarotto", - "email": "zoeslam@gmail.com", - "role": "Developer" - } - ], - "description": "Parallel testing for PHP", - "homepage": "https://github.com/paratestphp/paratest", - "keywords": [ - "concurrent", - "parallel", - "phpunit", - "testing" - ], - "support": { - "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.4.3" - }, - "funding": [ - { - "url": "https://github.com/sponsors/Slamdunk", - "type": "github" - }, - { - "url": "https://paypal.me/filippotessarotto", - "type": "paypal" - } - ], - "time": "2024-02-20T07:24:02+00:00" - }, { "name": "brick/math", "version": "0.12.1", @@ -598,53 +504,6 @@ }, "time": "2022-10-27T11:44:00+00:00" }, - { - "name": "doctrine/deprecations", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" - }, - "time": "2024-01-30T19:34:25+00:00" - }, { "name": "doctrine/inflector", "version": "2.0.10", @@ -1051,67 +910,6 @@ }, "time": "2024-01-02T13:46:09+00:00" }, - { - "name": "fidry/cpu-core-counter", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "fidry/php-cs-fixer-config": "^1.1.2", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^8.5.31 || ^9.5.26", - "webmozarts/strict-phpunit": "^7.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "time": "2024-02-07T09:43:46+00:00" - }, { "name": "filp/whoops", "version": "2.15.4", @@ -1569,65 +1367,6 @@ }, "time": "2020-07-09T08:09:16+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "2.0.6", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A library to get pretty versions strings of installed dependencies", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" - }, - "time": "2024-03-08T09:58:59+00:00" - }, { "name": "jolicode/jolinotif", "version": "v2.7.2", @@ -3767,426 +3506,22 @@ ], "authors": [ { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com" - } - ], - "description": "Workbench Companion for Laravel Packages Development", - "keywords": [ - "dev", - "laravel", - "laravel-packages", - "testing" - ], - "support": { - "issues": "https://github.com/orchestral/workbench/issues", - "source": "https://github.com/orchestral/workbench/tree/v8.5.0" - }, - "time": "2024-05-20T23:51:13+00:00" - }, - { - "name": "pestphp/pest", - "version": "v2.34.8", - "source": { - "type": "git", - "url": "https://github.com/pestphp/pest.git", - "reference": "e8f122bf47585c06431e0056189ec6bfd6f41f57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/e8f122bf47585c06431e0056189ec6bfd6f41f57", - "reference": "e8f122bf47585c06431e0056189ec6bfd6f41f57", - "shasum": "" - }, - "require": { - "brianium/paratest": "^7.3.1", - "nunomaduro/collision": "^7.10.0|^8.1.1", - "nunomaduro/termwind": "^1.15.1|^2.0.1", - "pestphp/pest-plugin": "^2.1.1", - "pestphp/pest-plugin-arch": "^2.7.0", - "php": "^8.1.0", - "phpunit/phpunit": "^10.5.17" - }, - "conflict": { - "phpunit/phpunit": ">10.5.17", - "sebastian/exporter": "<5.1.0", - "webmozart/assert": "<1.11.0" - }, - "require-dev": { - "pestphp/pest-dev-tools": "^2.16.0", - "pestphp/pest-plugin-type-coverage": "^2.8.3", - "symfony/process": "^6.4.0|^7.1.1" - }, - "bin": [ - "bin/pest" - ], - "type": "library", - "extra": { - "pest": { - "plugins": [ - "Pest\\Plugins\\Bail", - "Pest\\Plugins\\Cache", - "Pest\\Plugins\\Coverage", - "Pest\\Plugins\\Init", - "Pest\\Plugins\\Environment", - "Pest\\Plugins\\Help", - "Pest\\Plugins\\Memory", - "Pest\\Plugins\\Only", - "Pest\\Plugins\\Printer", - "Pest\\Plugins\\ProcessIsolation", - "Pest\\Plugins\\Profile", - "Pest\\Plugins\\Retry", - "Pest\\Plugins\\Snapshot", - "Pest\\Plugins\\Verbose", - "Pest\\Plugins\\Version", - "Pest\\Plugins\\Parallel" - ] - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "files": [ - "src/Functions.php", - "src/Pest.php" - ], - "psr-4": { - "Pest\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "The elegant PHP Testing Framework.", - "keywords": [ - "framework", - "pest", - "php", - "test", - "testing", - "unit" - ], - "support": { - "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.34.8" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - } - ], - "time": "2024-06-10T22:02:16+00:00" - }, - { - "name": "pestphp/pest-plugin", - "version": "v2.1.1", - "source": { - "type": "git", - "url": "https://github.com/pestphp/pest-plugin.git", - "reference": "e05d2859e08c2567ee38ce8b005d044e72648c0b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/e05d2859e08c2567ee38ce8b005d044e72648c0b", - "reference": "e05d2859e08c2567ee38ce8b005d044e72648c0b", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^2.0.0", - "composer-runtime-api": "^2.2.2", - "php": "^8.1" - }, - "conflict": { - "pestphp/pest": "<2.2.3" - }, - "require-dev": { - "composer/composer": "^2.5.8", - "pestphp/pest": "^2.16.0", - "pestphp/pest-dev-tools": "^2.16.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Pest\\Plugin\\Manager" - }, - "autoload": { - "psr-4": { - "Pest\\Plugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "The Pest plugin manager", - "keywords": [ - "framework", - "manager", - "pest", - "php", - "plugin", - "test", - "testing", - "unit" - ], - "support": { - "source": "https://github.com/pestphp/pest-plugin/tree/v2.1.1" - }, - "funding": [ - { - "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - }, - { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" - } - ], - "time": "2023-08-22T08:40:06+00:00" - }, - { - "name": "pestphp/pest-plugin-arch", - "version": "v2.7.0", - "source": { - "type": "git", - "url": "https://github.com/pestphp/pest-plugin-arch.git", - "reference": "d23b2d7498475354522c3818c42ef355dca3fcda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/d23b2d7498475354522c3818c42ef355dca3fcda", - "reference": "d23b2d7498475354522c3818c42ef355dca3fcda", - "shasum": "" - }, - "require": { - "nunomaduro/collision": "^7.10.0|^8.1.0", - "pestphp/pest-plugin": "^2.1.1", - "php": "^8.1", - "ta-tikoma/phpunit-architecture-test": "^0.8.4" - }, - "require-dev": { - "pestphp/pest": "^2.33.0", - "pestphp/pest-dev-tools": "^2.16.0" - }, - "type": "library", - "extra": { - "pest": { - "plugins": [ - "Pest\\Arch\\Plugin" - ] - } - }, - "autoload": { - "files": [ - "src/Autoload.php" - ], - "psr-4": { - "Pest\\Arch\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "The Arch plugin for Pest PHP.", - "keywords": [ - "arch", - "architecture", - "framework", - "pest", - "php", - "plugin", - "test", - "testing", - "unit" - ], - "support": { - "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.7.0" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - } - ], - "time": "2024-01-26T09:46:42+00:00" - }, - { - "name": "pestphp/pest-plugin-laravel", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/pestphp/pest-plugin-laravel.git", - "reference": "53df51169a7f9595e06839cce638c73e59ace5e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-laravel/zipball/53df51169a7f9595e06839cce638c73e59ace5e8", - "reference": "53df51169a7f9595e06839cce638c73e59ace5e8", - "shasum": "" - }, - "require": { - "laravel/framework": "^10.48.9|^11.5.0", - "pestphp/pest": "^2.34.7", - "php": "^8.1.0" - }, - "require-dev": { - "laravel/dusk": "^7.13.0", - "orchestra/testbench": "^8.22.3|^9.0.4", - "pestphp/pest-dev-tools": "^2.16.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Pest\\Laravel\\PestServiceProvider" - ] - }, - "pest": { - "plugins": [ - "Pest\\Laravel\\Plugin" - ] - } - }, - "autoload": { - "files": [ - "src/Autoload.php" - ], - "psr-4": { - "Pest\\Laravel\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "The Pest Laravel Plugin", - "keywords": [ - "framework", - "laravel", - "pest", - "php", - "test", - "testing", - "unit" - ], - "support": { - "source": "https://github.com/pestphp/pest-plugin-laravel/tree/v2.4.0" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - } - ], - "time": "2024-04-27T10:41:54+00:00" - }, - { - "name": "pestphp/pest-plugin-watch", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/pestphp/pest-plugin-watch.git", - "reference": "fd1866fac88215b9dbf0242a857864c95c26042e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-watch/zipball/fd1866fac88215b9dbf0242a857864c95c26042e", - "reference": "fd1866fac88215b9dbf0242a857864c95c26042e", - "shasum": "" - }, - "require": { - "pestphp/pest-plugin": "^2.1.1", - "php": "^8.1.0", - "react/child-process": "^0.6.5", - "react/event-loop": "^1.5.0" - }, - "conflict": { - "evenement/evenement": "^1.0", - "pestphp/pest": "<2.33.0" - }, - "require-dev": { - "pestphp/pest": "^2.33.0", - "pestphp/pest-dev-tools": "^2.16.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - }, - "pest": { - "plugins": [ - "Pest\\Watch\\Plugin" - ] - } - }, - "autoload": { - "psr-4": { - "Pest\\Watch\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Caneco", - "email": "caneco@me.com" - } - ], - "description": "The Pest Watch Plugin", - "keywords": [ - "framework", - "pest", - "php", - "plugin", - "test", - "testing", - "unit", - "watch" - ], - "support": { - "issues": "https://github.com/pestphp/pest-plugin-watch/issues", - "source": "https://github.com/pestphp/pest-plugin-watch/tree/v2.1.0" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" } ], - "time": "2024-01-26T09:18:46+00:00" + "description": "Workbench Companion for Laravel Packages Development", + "keywords": [ + "dev", + "laravel", + "laravel-packages", + "testing" + ], + "support": { + "issues": "https://github.com/orchestral/workbench/issues", + "source": "https://github.com/orchestral/workbench/tree/v8.5.0" + }, + "time": "2024-05-20T23:51:13+00:00" }, { "name": "phar-io/manifest", @@ -4306,181 +3641,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.1", - "ext-filter": "*", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.5", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" - }, - "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": "opensource@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.4.1" - }, - "time": "2024-05-21T05:55:05+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.8.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.3 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" - }, - "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.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" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" - }, - "time": "2024-02-23T11:10:43+00:00" - }, { "name": "phpmyadmin/sql-parser", "version": "5.9.0", @@ -4644,53 +3804,6 @@ ], "time": "2023-11-12T21:59:55+00:00" }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.29.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" - }, - "time": "2024-05-31T08:52:43+00:00" - }, { "name": "phpstan/phpstan", "version": "1.11.5", @@ -5888,85 +5001,6 @@ ], "time": "2024-04-27T21:32:50+00:00" }, - { - "name": "react/child-process", - "version": "v0.6.5", - "source": { - "type": "git", - "url": "https://github.com/reactphp/child-process.git", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/event-loop": "^1.2", - "react/stream": "^1.2" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/socket": "^1.8", - "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\ChildProcess\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven library for executing child processes with ReactPHP.", - "keywords": [ - "event-driven", - "process", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.5" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-09-16T13:41:56+00:00" - }, { "name": "react/event-loop", "version": "v1.5.0", @@ -9887,65 +8921,6 @@ ], "time": "2024-05-31T14:49:08+00:00" }, - { - "name": "ta-tikoma/phpunit-architecture-test", - "version": "0.8.4", - "source": { - "type": "git", - "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", - "reference": "89f0dea1cb0f0d5744d3ec1764a286af5e006636" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/89f0dea1cb0f0d5744d3ec1764a286af5e006636", - "reference": "89f0dea1cb0f0d5744d3ec1764a286af5e006636", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18.0 || ^5.0.0", - "php": "^8.1.0", - "phpdocumentor/reflection-docblock": "^5.3.0", - "phpunit/phpunit": "^10.5.5 || ^11.0.0", - "symfony/finder": "^6.4.0 || ^7.0.0" - }, - "require-dev": { - "laravel/pint": "^1.13.7", - "phpstan/phpstan": "^1.10.52" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPUnit\\Architecture\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ni Shi", - "email": "futik0ma011@gmail.com" - }, - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "Methods for testing application architecture", - "keywords": [ - "architecture", - "phpunit", - "stucture", - "test", - "testing" - ], - "support": { - "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", - "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.8.4" - }, - "time": "2024-01-05T14:10:56+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/src/Concerns/HasData.php b/src/Concerns/HasData.php index 3118608..0bd6d95 100644 --- a/src/Concerns/HasData.php +++ b/src/Concerns/HasData.php @@ -7,9 +7,4 @@ trait HasData { protected Collection $data; - - public function getData(): Collection - { - return $this->data; - } } \ No newline at end of file diff --git a/src/PopulatorServiceProvider.php b/src/PopulatorServiceProvider.php index e02d219..ab59496 100644 --- a/src/PopulatorServiceProvider.php +++ b/src/PopulatorServiceProvider.php @@ -3,7 +3,6 @@ namespace Guava\LaravelPopulator; use Guava\LaravelPopulator\Console\MakePopulatorCommand; -use Guava\LaravelPopulator\Console\MakeSampleCommand; use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; use Guava\LaravelPopulator\Support\Processors\InsertPipelineInvoker; use Illuminate\Support\ServiceProvider; @@ -26,7 +25,6 @@ public function boot(): void $this->commands([ MakePopulatorCommand::class, -// MakeSampleCommand::class, ]); } } diff --git a/tests/Feature/BundleTest.php b/tests/Feature/BundleTest.php index c69b750..74f02aa 100644 --- a/tests/Feature/BundleTest.php +++ b/tests/Feature/BundleTest.php @@ -34,7 +34,7 @@ public function test_handle_with_filesystem_backed_records() (Bundle::make(TestUser::class))->handle($populator); (Bundle::make(TestPost::class))->handle($populator); - $this->assertEquals(1, TestUser::whereEmail('foo@example.com')->count('posts')); + $this->assertEquals(1, TestUser::whereEmail('foo@example.com')->withCount('posts')->sole()->posts_count); } @@ -46,13 +46,16 @@ public function test_handle_with_filesystem_backed_records_throws_missing_direct $bundle->handle($populator); } - // public function test_setup() - // { - // - // } - // - // public function test_make() - // { - // - // } + public function test_handle_only_runs_in_correct_environment() + { + $this->assertEquals(0, TestUser::count()); + $populator = Populator::make('test'); + $bundle = Bundle::make(TestUser::class) + ->environments(['not-this-env']) + ->record('user-foo', [ + 'name' => 'Foo', + ]); + $bundle->handle($populator); + $this->assertEquals(0, TestUser::count()); + } } diff --git a/tests/Feature/HasEnvironmentTest.php b/tests/Feature/Concerns/HasEnvironmentTest.php similarity index 97% rename from tests/Feature/HasEnvironmentTest.php rename to tests/Feature/Concerns/HasEnvironmentTest.php index bc30c36..a0c7cf9 100644 --- a/tests/Feature/HasEnvironmentTest.php +++ b/tests/Feature/Concerns/HasEnvironmentTest.php @@ -1,6 +1,6 @@ records([ 'post-one' => [ - 'owner' => 'email:foo@example.com', + 'user' => 'email:foo@example.com', 'content' => 'test', ], ]), diff --git a/tests/Feature/PopulatorServiceProviderTest.php b/tests/Feature/PopulatorServiceProviderTest.php new file mode 100644 index 0000000..f6287a2 --- /dev/null +++ b/tests/Feature/PopulatorServiceProviderTest.php @@ -0,0 +1,27 @@ +artisan('vendor:publish', [ + '--provider' => 'Guava\LaravelPopulator\PopulatorServiceProvider' + ]); + + $this->assertFileExists(config_path('populator.php')); + $this->assertFileIsReadable(config_path('populator.php')); +// $this->assertFileEquals(config_path('larapoke.php'), __DIR__ . '/../../config/larapoke.php'); + $this->assertTrue(unlink(config_path('populator.php'))); + } + + public function test_registers_commands() + { + $commands = \Artisan::all(); + $this->assertArrayHasKey('make:populator', $commands); +// $this->assertArrayHasKey('make:sample', $commands); + } +} \ No newline at end of file diff --git a/tests/Feature/ProcessorTest.php b/tests/Feature/ProcessorTest.php new file mode 100644 index 0000000..b86f3cb --- /dev/null +++ b/tests/Feature/ProcessorTest.php @@ -0,0 +1,305 @@ +bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'id' => 1, + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'phone' => [ + 'phone' => '5555555555', + ] + ]), + Bundle::make(TestPost::class) + ->generate('id', fn() => Str::uuid()) + ->records([ + 'post-one'=> [ + 'user' => 1, + 'content' => 'test one', + ], + 'post-two'=> [ + 'user' => 'email:foo@example.com', + 'content' => 'test two', + ], + ]), + ]) + ->call(); + $this->assertEquals(2, TestUser::sole()->withCount('posts')->sole()->posts_count); + } + + public function test_has_one_relation() + { + $this->assertEquals(0, TestPhone::count()); + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'phone' => [ + 'phone' => '5555555555', + ] + ]) + ]) + ->call(); + + $this->assertEquals(1, TestPhone::count()); + } + + public function test_has_one_relation_throws_on_invalid_relationship() + { + $this->expectException(InvalidBundleException::class); + $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); + Populator::make('test') + ->bundles([ + Bundle::make(TestPhone::class) + ->record('user-test', [ + 'user' => 'invalid', + 'phone' => '5555555555', + ]) + ]) + ->call(); + + } + + public function test_has_many_relation() + { + $this->assertEquals(0, TestPost::count()); + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'posts' => [ + [ + 'id' => '1a4d5b58-8ee4-4adc-9628-98dcc5691b63', + 'content' => 'foobar', + ], + ] + ]) + ]) + ->call(); + + $this->assertEquals(1, TestPost::count()); + } + + public function test_belongs_to_many_relation() + { + Populator::make('test') + ->bundles([ + Bundle::make(TestRole::class) + ->record('role-users', [ + 'name' => 'users', + ]), + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'roles' => [ + 'role-users', + ] + ]) + ]) + ->call(); + + $this->assertEquals(1, + TestUser::whereEmail('foo@example.com') + ->withCount('roles')->sole()->roles_count, + ); + } + + public function test_belongs_to_many_relation_throws_on_invalid_relationship(){ + + $this->expectException(InvalidBundleException::class); + $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); + + Populator::make('test') + ->bundles([ + Bundle::make(TestRole::class) + ->record('role-users', [ + 'name' => 'users', + ]), + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'roles' => [ + 'role-users-invalid', + ] + ]) + ]) + ->call(); + + } + + public function test_morphs_one_relation() + { + $this->assertEquals(0, TestImage::count()); + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'image' => [ + 'url' => 'localhost/image.png', + ] + ]) + ]) + ->call(); + + $this->assertEquals(1, TestImage::count()); + } + + public function test_morphs_one_relation_throws_on_invalid_relationship(){ + $this->expectException(InvalidBundleException::class); + $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); + Populator::make('test') + ->bundles([ + Bundle::make(TestImage::class) + ->record('invalid-test', [ + 'url' => 'localhost/image.png', + 'imageable' => ['invalid-test', TestUser::class], + ]) + ]) + ->call(); + } + + public function test_morphs_many_relation() + { + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + ]), + Bundle::make(TestPost::class) + ->generate('id', fn() => Str::uuid()) + ->record('post-test', [ + 'user' => 'user-test', + 'content' => 'foobar', + 'comments' => [ + ['body' => 'comment body'] + ] + ]) + ]) + ->call(); + + $this->assertEquals(1, TestPost::withCount('comments')->sole()->comments_count); + + } + + public function test_morphs_many_relation_throws_on_invalid_relationship() { + $this->expectException(InvalidBundleException::class); + $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); + Populator::make('test') + ->bundles([ + Bundle::make(TestComment::class) + ->record('invalid-test', [ + 'body' => 'comment body', + 'commentable' => ['invalid-test', TestPost::class], + ]) + ]) + ->call(); + } + + public function test_morphs_to_many_relation_throws_on_invalid_relationship() { + $this->expectException(InvalidBundleException::class); + $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); + + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + ]), + Bundle::make(TestPost::class) + ->generate('id', fn() => Str::uuid()) + ->record('post-test', [ + 'user' => 'user-test', + 'content' => 'foobar', + 'tags' => ['invalid-tag'], + ]) + ]) + ->call(); + } + + public function test_morphs_to_many_relation() + { + Populator::make('test') + ->bundles([ + Bundle::make(TestTag::class) + ->record('tag-test', [ + 'name' => 'test', + ]), + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + ]), + Bundle::make(TestPost::class) + ->generate('id', fn() => Str::uuid()) + ->record('post-test', [ + 'user' => 'user-test', + 'content' => 'foobar', + 'tags' => ['tag-test'], + ]) + ]) + ->call(); + + $this->assertEquals(1, + TestPost::withCount('tags')->sole()->tags_count + ); + + } + + public function test_throws_for_invalid_relationship() + { + $this->expectException(InvalidBundleException::class); + $this->expectExceptionMessage('The relation type of faux is not supported yet'); + Populator::make('test') + ->bundles([ + Bundle::make(TestTag::class) + ->record('tag-test', [ + 'name' => 'test', + 'faux' => '', + ]), + ])->call(); + } +} \ No newline at end of file diff --git a/tests/Fixtures/FakeBelongsTo.php b/tests/Fixtures/FakeBelongsTo.php new file mode 100644 index 0000000..54eba36 --- /dev/null +++ b/tests/Fixtures/FakeBelongsTo.php @@ -0,0 +1,35 @@ +morphTo(); + } +} \ No newline at end of file diff --git a/tests/Fixtures/TestImage.php b/tests/Fixtures/TestImage.php new file mode 100644 index 0000000..97b225e --- /dev/null +++ b/tests/Fixtures/TestImage.php @@ -0,0 +1,19 @@ +morphTo(); + } +} \ No newline at end of file diff --git a/tests/Fixtures/TestPhone.php b/tests/Fixtures/TestPhone.php new file mode 100644 index 0000000..6ca3a74 --- /dev/null +++ b/tests/Fixtures/TestPhone.php @@ -0,0 +1,21 @@ + + */ + public function user(): BelongsTo + { + return $this->belongsTo(TestUser::class,'user_id'); + } +} \ No newline at end of file diff --git a/tests/Fixtures/TestPost.php b/tests/Fixtures/TestPost.php index 21f2257..1861048 100644 --- a/tests/Fixtures/TestPost.php +++ b/tests/Fixtures/TestPost.php @@ -2,13 +2,17 @@ namespace Tests\Fixtures; +use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\MorphMany; +use Illuminate\Database\Eloquent\Relations\MorphOne; +use Illuminate\Database\Eloquent\Relations\MorphToMany; class TestPost extends Model { - use HasFactory; + use HasFactory, HasUuids; protected $table = 'posts'; @@ -19,8 +23,38 @@ class TestPost extends Model /** * @return BelongsTo */ - public function owner(): BelongsTo + public function user(): BelongsTo { - return $this->belongsTo(TestUser::class, 'user_id'); + return $this->belongsTo(TestUser::class, 'user_id', 'id'); + } + + /** + * @return MorphOne + */ + public function image(): MorphOne + { + return $this->morphOne(TestImage::class, 'imageable'); + } + + /** + * @return MorphMany + */ + public function comments(): MorphMany + { + return $this->morphMany(TestComment::class, 'commentable'); + } + + /** + * @return MorphToMany + */ + public function tags(): MorphToMany + { + return $this->morphToMany( + TestTag::class, + 'taggable', + 'taggables', + 'taggable_id', + 'tag_id' + ); } } diff --git a/tests/Fixtures/TestRole.php b/tests/Fixtures/TestRole.php new file mode 100644 index 0000000..3916835 --- /dev/null +++ b/tests/Fixtures/TestRole.php @@ -0,0 +1,28 @@ + + */ + public function users(): BelongsToMany + { + return $this->belongsToMany( + TestUser::class, + 'role_user', + 'role_id', + 'user_id', + ); + } + +} \ No newline at end of file diff --git a/tests/Fixtures/TestTag.php b/tests/Fixtures/TestTag.php new file mode 100644 index 0000000..096f14e --- /dev/null +++ b/tests/Fixtures/TestTag.php @@ -0,0 +1,42 @@ + + */ + public function posts(): MorphToMany + { + return $this->morphedByMany(TestPost::class, 'taggable'); + } + + public function faux(): FakeBelongsTo + { + return new FakeBelongsTo( + TestUser::query(), + new TestUser(), + ); + } + + public function invalid(): BelongsTo + { + return new BelongsTo( + TestUser::query(), + new TestUser(), + 'user_id', + 'id', + 'invalid', + ); + } +} \ No newline at end of file diff --git a/tests/Fixtures/TestUser.php b/tests/Fixtures/TestUser.php index 86681fc..7587071 100644 --- a/tests/Fixtures/TestUser.php +++ b/tests/Fixtures/TestUser.php @@ -5,7 +5,10 @@ use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\MorphOne; class TestUser extends Model implements Authenticatable { @@ -22,6 +25,11 @@ class TestUser extends Model implements Authenticatable 'is_admin' => 'boolean', ]; + public function phone(): HasOne + { + return $this->hasOne(TestPhone::class, 'user_id'); + } + /** * @return HasMany */ @@ -30,6 +38,27 @@ public function posts(): HasMany return $this->hasMany(TestPost::class, 'user_id'); } + /** + * @return BelongsToMany + */ + public function roles(): BelongsToMany + { + return $this->belongsToMany( + TestRole::class, + 'role_user', + 'user_id', + 'role_id' + ); + } + + /** + * @return MorphOne + */ + public function image(): MorphOne + { + return $this->morphOne(TestImage::class, 'imageable'); + } + public function getAuthIdentifierName(): string { return 'test-user-auth-identifier-name'; diff --git a/tests/Fixtures/database/create_users_table.php b/tests/Fixtures/database/2024_06_22_000001_create_users_table.php similarity index 100% rename from tests/Fixtures/database/create_users_table.php rename to tests/Fixtures/database/2024_06_22_000001_create_users_table.php diff --git a/tests/Fixtures/database/create_posts_table.php b/tests/Fixtures/database/2024_06_22_000002_create_posts_table.php similarity index 93% rename from tests/Fixtures/database/create_posts_table.php rename to tests/Fixtures/database/2024_06_22_000002_create_posts_table.php index d46d243..d2b6564 100644 --- a/tests/Fixtures/database/create_posts_table.php +++ b/tests/Fixtures/database/2024_06_22_000002_create_posts_table.php @@ -11,7 +11,7 @@ public function up(): void { Schema::create('posts', static function (Blueprint $table): void { - $table->id(); + $table->uuid('id')->primary(); $table->timestamps(); $table->foreignId('user_id') ->constrained('users') diff --git a/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php b/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php new file mode 100644 index 0000000..42359dd --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php @@ -0,0 +1,22 @@ +id(); + $table->timestamps(); + $table->string('body'); + $table->morphs('commentable'); + }); + } + + public function down(): void + { + Schema::dropIfExists('comments'); + } +}; diff --git a/tests/Fixtures/database/2024_06_22_000003_create_images_table.php b/tests/Fixtures/database/2024_06_22_000003_create_images_table.php new file mode 100644 index 0000000..f6d7882 --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000003_create_images_table.php @@ -0,0 +1,22 @@ +id(); + $table->timestamps(); + $table->string('url'); + $table->morphs('imageable'); + }); + } + + public function down(): void + { + Schema::dropIfExists('images'); + } +}; diff --git a/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php b/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php new file mode 100644 index 0000000..fe459a2 --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php @@ -0,0 +1,24 @@ +foreignId('role_id') + ->constrained('roles') + ->cascadeOnDelete(); + $table->foreignId('user_id') + ->constrained('users') + ->cascadeOnDelete(); + }); + } + + public function down(): void + { + Schema::dropIfExists('roles'); + } +}; diff --git a/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php b/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php new file mode 100644 index 0000000..cef316c --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php @@ -0,0 +1,21 @@ +id(); + $table->timestamps(); + $table->string('name'); + }); + } + + public function down(): void + { + Schema::dropIfExists('roles'); + } +}; diff --git a/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php b/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php new file mode 100644 index 0000000..16e00ad --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php @@ -0,0 +1,21 @@ +id(); + $table->timestamps(); + $table->string('name'); + }); + } + + public function down(): void + { + Schema::dropIfExists('tags'); + } +}; diff --git a/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php b/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php new file mode 100644 index 0000000..a9818e7 --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php @@ -0,0 +1,20 @@ +foreignId('tag_id'); + $table->morphs('taggable'); + }); + } + + public function down(): void + { + Schema::dropIfExists('taggables'); + } +}; diff --git a/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php b/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php new file mode 100644 index 0000000..08435ac --- /dev/null +++ b/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php @@ -0,0 +1,25 @@ +id(); + $table->timestamps(); + $table->foreignId('user_id') + ->constrained('users') + ->cascadeOnDelete(); + $table->string('phone'); + + }); + } + + public function down(): void + { + Schema::dropIfExists('phones'); + } +}; diff --git a/tests/Fixtures/database/populators/initial/test-post/example-post.php b/tests/Fixtures/database/populators/initial/test-post/example-post.php index cdadcaa..bbe508a 100644 --- a/tests/Fixtures/database/populators/initial/test-post/example-post.php +++ b/tests/Fixtures/database/populators/initial/test-post/example-post.php @@ -1,6 +1,7 @@ 'example-user', + 'id' => '1a4d5b58-8ee4-4adc-9628-98dcc5691b63', + 'user' => 'example-user', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', ]; From d60fef6ad7974aa9a52f8e5e92c6f2cf8daedc2f Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Sat, 22 Jun 2024 02:39:14 -0400 Subject: [PATCH 08/10] - Inserts via callable - Overrideable model for tracking populated entries - Increased phpstan level to 6, fixed errors with relations - Added composer scripts for invoking testing, analyzing and formatting - Populator rollback logic --- README.md | 155 ++++++++++++ composer.json | 14 +- config/config.php | 6 +- database/factories/PopulationFactory.php | 23 ++ .../2024_06_22_000001_create_populations.php | 28 +++ phpstan.neon | 11 +- phpunit.xml | 7 - pint.json | 12 +- src/Bundle.php | 117 +++++---- src/Concerns/Bundle/HasDefaults.php | 10 +- src/Concerns/Bundle/HasGenerators.php | 8 +- src/Concerns/Bundle/HasMutators.php | 8 +- src/Concerns/Bundle/HasRecords.php | 15 +- src/Concerns/HasData.php | 5 +- src/Concerns/HasEnvironments.php | 10 +- src/Concerns/HasName.php | 15 +- src/Concerns/HasPipeline.php | 8 +- src/Concerns/HasPopulation.php | 23 ++ src/Concerns/Pipe/DefaultsPipe.php | 24 +- src/Concerns/Pipe/GeneratorsPipe.php | 18 +- src/Concerns/Pipe/InsertPipe.php | 67 ++++- src/Concerns/Pipe/MutatorsPipe.php | 13 +- src/Concerns/Pipe/RelatedPipe.php | 11 +- .../Pipe/Relations/BelongsRelations.php | 21 +- .../Pipe/Relations/HasOneOrManyRelations.php | 19 +- .../Pipe/Relations/MorphRelations.php | 39 ++- src/Concerns/Pipe/RelationsPipe.php | 18 +- src/Concerns/Pipe/TracksPopulationPipe.php | 42 ++++ src/Console/MakePopulatorCommand.php | 30 ++- src/Console/MakeSampleCommand.php | 44 ++-- src/Contracts/InteractsWithBundleInsert.php | 15 ++ src/Contracts/InteractsWithPipeline.php | 8 +- src/Contracts/TracksPopulatedEntries.php | 10 + src/Exceptions/FeatureNotEnabledException.php | 5 + src/Exceptions/InvalidBundleException.php | 4 +- src/Facades/Feature.php | 17 ++ src/Features.php | 105 ++++++++ src/Models/Population.php | 39 +++ src/Populator.php | 66 ++++- src/PopulatorServiceProvider.php | 11 +- src/Processor.php | 87 +++++-- src/Storage/Memory.php | 22 +- .../Processors/InsertPipelineInvoker.php | 14 +- src/Support/Processors/PipelineInvoker.php | 33 ++- stubs/populator.stub.php | 2 +- stubs/sample.stub.php | 6 +- tests/Feature/BundleTest.php | 32 ++- tests/Feature/Concerns/HasEnvironmentTest.php | 8 +- tests/Feature/Concerns/HasNameTest.php | 12 +- .../Concerns/Pipe/DefaultsPipeTest.php | 10 +- .../Concerns/Pipe/GeneratorsPipeTest.php | 5 +- .../Feature/Concerns/Pipe/InsertPipeTest.php | 37 ++- .../Concerns/Pipe/MutatorsPipeTest.php | 5 +- .../Concerns/Pipe/RelationsPipeTest.php | 11 +- tests/Feature/FeaturesTest.php | 72 ++++++ tests/Feature/Models/PopulationTest.php | 24 ++ tests/Feature/PipelineInvokerTest.php | 11 +- .../Feature/PopulatorServiceProviderTest.php | 12 +- tests/Feature/PopulatorTest.php | 80 +++++- tests/Feature/ProcessorTest.php | 229 +++++++++++++----- tests/Fixtures/FakeBelongsTo.php | 3 +- tests/Fixtures/TestComment.php | 3 +- tests/Fixtures/TestImage.php | 3 +- tests/Fixtures/TestPhone.php | 4 +- tests/Fixtures/TestPopulation.php | 7 + tests/Fixtures/TestPost.php | 3 +- tests/Fixtures/TestRole.php | 4 +- tests/Fixtures/TestTag.php | 3 +- tests/Fixtures/TestUser.php | 7 +- .../2024_06_22_000002_create_posts_table.php | 7 +- ...024_06_22_000003_create_comments_table.php | 3 +- .../2024_06_22_000003_create_images_table.php | 3 +- ...24_06_22_000003_create_role_user_table.php | 9 +- .../2024_06_22_000003_create_roles_table.php | 3 +- .../2024_06_22_000003_create_tags_table.php | 3 +- ...24_06_22_000004_create_taggables_table.php | 3 +- .../2024_06_22_000005_create_phones_table.php | 6 +- .../database}/factories/TestPostFactory.php | 9 +- .../database}/factories/TestUserFactory.php | 13 +- .../2024_06_22_000001_create_populations.php | 28 +++ tests/TestCase.php | 16 +- tests/Unit/HasDefaultsTest.php | 4 +- tests/Unit/HasGeneratorsTest.php | 4 +- tests/Unit/HasMutatorsTest.php | 4 +- tests/Unit/HasRecordsTest.php | 8 +- tests/Unit/MemoryTest.php | 6 +- 86 files changed, 1528 insertions(+), 451 deletions(-) create mode 100644 database/factories/PopulationFactory.php create mode 100644 database/migrations/2024_06_22_000001_create_populations.php create mode 100644 src/Concerns/HasPopulation.php create mode 100644 src/Concerns/Pipe/TracksPopulationPipe.php create mode 100644 src/Contracts/InteractsWithBundleInsert.php create mode 100644 src/Contracts/TracksPopulatedEntries.php create mode 100644 src/Exceptions/FeatureNotEnabledException.php create mode 100644 src/Facades/Feature.php create mode 100644 src/Features.php create mode 100644 src/Models/Population.php create mode 100644 tests/Feature/FeaturesTest.php create mode 100644 tests/Feature/Models/PopulationTest.php create mode 100644 tests/Fixtures/TestPopulation.php rename {database => tests/Fixtures/database}/factories/TestPostFactory.php (83%) rename {database => tests/Fixtures/database}/factories/TestUserFactory.php (75%) create mode 100644 tests/Fixtures/database/migrations/2024_06_22_000001_create_populations.php diff --git a/README.md b/README.md index ae64761..1581d5f 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,30 @@ You can install the package with composer: composer require guava/laravel-populator ``` + +You can optionally publish the database migrations if you plan to enable [tracking](#tracking-inserted-models) + +```bash +php artisan vendor:publish --provider 'Guava\LaravelPopulator\PopulatorServiceProvider' --tag 'migrations' +php artisan migrate +``` + +or publish the config + +```bash +php artisan vendor:publish --provider 'Guava\LaravelPopulator\PopulatorServiceProvider' --tag 'config' +``` + +which currently provides the following options + +**config/populator.php** +```php +return [ + 'tracking' => false, + 'population_model' => '\Guava\LaravelPopulator\Models\Population', +]; +``` + ## How it works There are three major terms that Laravel Populator introduces: @@ -137,6 +161,42 @@ Populator::make('v1') This will call your populator and all it's defined bundles (more information in the Bundles section) +### Reversing a populator +The records inserted by a populator can be removed if [tracking](#enabling-tracking) is enabled when the populator was run. + +```php +Populator::make('v1') + ->bundles([//your bundles to reverse or leave blank for all bundles in the populator]) + ->rollback() +``` + +Rollbacks will filter using the following condition + +1. Population populator name +2. Bundle model classes +3. Bundle name + +This allows you to control what bundles are rolled back from a populator. + +For example you can rollback a subset of the bundles from the populator + +```php + +Populator::make('initial') + ->bundles([ + Bundle::make(User::class), + Bundle::make(Post::class), + ]) + ->call(); +//User and Post entries now exist + +Populator::make('initial') + ->bundles([Bundle::make(Post::class)]) + ->rollback(); +//Post entries were removed +``` + + ### Environment Populators can be set to be executed only on specific environments. You might most likely want to seed different data for your local environment and your production environment. @@ -211,6 +271,22 @@ Bundle::make(User::class) ... ``` +## Override insert behavior + +If you need to customize the insertion behavior for records you can call `performInsertUsing()` on a bundle. + +For example, to perform an updateOrCreate instead of an insert + +```php + Bundle::make(User::class) + ->performInsertUsing(function (array $data, Bundle $bundle) { + return $bundle->model::updateOrCreate( + Arr::only($data, ['email']), + Arr::except($data, ['email']) + )->getKey(); + }); +``` + ## Relations Records can of course have relations with other records. Currently supported relations are: @@ -342,6 +418,85 @@ return [ ``` This will automatically create two Like's with the defined attributes and a relationship to the post they have been created in. +## Tracking inserted models + +Inserted models by a populator can be tracked in the database by enabling the tracking feature in Laravel populator. + +```php +\Guava\LaravelPopulator\Models\Population::first() +->populatable; //provides access to the model that was inserted by Laravel populator. +``` + +Laravel populator provides a trait `[HasPopulation.php](src%2FConcerns%2FHasPopulation.php)` to access +the Population from models + +```php +class User extends Model implements TracksPopulatedEntries +{ + use HasPopulation; +} +``` + +The model then has access to the Population relationship by `$model->population` + +### Enabling tracking +Tracking can be enabled either by enabling the feature inside the published configuration file or by enabling it +in the boot method of a service provider. + +*Enabling by config*: + +**config/populator.php** +```php +return [ + 'tracking' => true, + //...other options +]; +``` + +*Enabling by provider*: + +**AppServiceProvider.php** +```php +public function boot() { + \Guava\LaravelPopulator\Facades\Feature::enableTrackingFeature(); +} +``` + +### Marking models for tracking + +Models must implement [TracksPopulatedEntries.php](src%2FContracts%2FTracksPopulatedEntries.php) to opt in for saving populations. + +```php +class User extends Model implements TracksPopulatedEntries +{ +} +``` + +### Swapping the Population model + +The population model can be changed by setting the model class inside the published configuration file or by enabling it +in the boot method of a service provider + +*Enabling by config*: + +**config/populator.php** +```php +return [ + 'population_model' => SomeModel::class, + //...other options +]; +``` + +*Enabling by provider*: + +**AppServiceProvider.php** +```php +public function boot() { + \Guava\LaravelPopulator\Facades\Feature::customPopulationModel(SomeModel::class); +} +``` + + ## Other packages - [Filament Icon Picker](https://github.com/LukasFreyCZ/filament-icon-picker) - [Filament Drafts](https://github.com/GuavaCZ/filament-drafts) diff --git a/composer.json b/composer.json index bcc46d3..0dd34a4 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,11 @@ } ], "scripts": { - "phpstan": "vendor/bin/phpstan analyze" + "analyze": "vendor/bin/phpstan analyze", + "format": "vendor/bin/pint", + "test": "vendor/bin/phpunit", + "coverage": "vendor/bin/phpunit -d xdebug.mode=coverage", + "dev-test": "vendor/bin/phpunit-watcher watch" }, "require-dev": { "orchestra/testbench": "^8.0", @@ -32,7 +36,8 @@ "psr-4": { "Tests\\": "tests/", "Guava\\LaravelPopulator\\": "src/", - "Guava\\LaravelPopulator\\Database\\Factories\\": "database/factories" + "Guava\\LaravelPopulator\\Database\\Factories\\": "database/factories", + "Tests\\Database\\Factories\\": "tests/Fixtures/database/factories" } }, "extra": { @@ -41,10 +46,5 @@ "Guava\\LaravelPopulator\\PopulatorServiceProvider" ] } - }, - "config": { - "allow-plugins": { - "pestphp/pest-plugin": true - } } } diff --git a/config/config.php b/config/config.php index 881ab67..9c02f5f 100644 --- a/config/config.php +++ b/config/config.php @@ -1,2 +1,6 @@ false, + 'population_model' => '\Guava\LaravelPopulator\Models\Population', +]; diff --git a/database/factories/PopulationFactory.php b/database/factories/PopulationFactory.php new file mode 100644 index 0000000..49761b4 --- /dev/null +++ b/database/factories/PopulationFactory.php @@ -0,0 +1,23 @@ + + */ +class PopulationFactory extends Factory +{ + protected $model = Population::class; + + public function definition(): array + { + return [ + 'populator' => $this->faker->slug(), + 'key' => $this->faker->unique()->sha1(), + 'bundle' => $this->faker->unique()->sha1(), + ]; + } +} diff --git a/database/migrations/2024_06_22_000001_create_populations.php b/database/migrations/2024_06_22_000001_create_populations.php new file mode 100644 index 0000000..e78582e --- /dev/null +++ b/database/migrations/2024_06_22_000001_create_populations.php @@ -0,0 +1,28 @@ +id(); + $table->timestamps(); + $table->string('populator'); + $table->string('bundle'); + $table->string('key'); + $table->morphs('populatable'); + // $table->unique(['populatable_type', 'populatable_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('populations'); + } +}; diff --git a/phpstan.neon b/phpstan.neon index ecbc3af..15f531b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,9 +3,14 @@ includes: parameters: noModelMake: false paths: - - src/ - + - src + - config + - database # Level 9 is the highest level - level: 5 + level: 6 + typeAliases: + PopulatorArray: 'array' + PopulatorCollection: 'Collection' + PopulatorData: 'PopulatorArray|PopulatorCollection' reportUnmatchedIgnoredErrors: false ignoreErrors: diff --git a/phpunit.xml b/phpunit.xml index 666589e..5d29de8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,11 +24,4 @@ - - - - - - - diff --git a/pint.json b/pint.json index 70b0e18..2a63655 100644 --- a/pint.json +++ b/pint.json @@ -1,3 +1,13 @@ { - "preset": "laravel" + "preset": "laravel", + "rules": { + "method_argument_space": true, + "multiline_whitespace_before_semicolons": { + "strategy": "new_line_for_chained_calls" + }, + "types_spaces": { + "space": "single" + }, + "concat_space": false + } } \ No newline at end of file diff --git a/src/Bundle.php b/src/Bundle.php index 8329daa..3af850b 100644 --- a/src/Bundle.php +++ b/src/Bundle.php @@ -11,6 +11,7 @@ use Guava\LaravelPopulator\Concerns\HasEnvironments; use Guava\LaravelPopulator\Concerns\HasName; use Guava\LaravelPopulator\Concerns\HasPipeline; +use Guava\LaravelPopulator\Contracts\InteractsWithBundleInsert; use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\File; @@ -21,44 +22,46 @@ */ class Bundle { - use HasName; - use HasEnvironments; - use HasDefaults; - use HasMutators; + use HasEnvironments; use HasGenerators; - use HasRecords; + use HasMutators; + use HasName; use HasPipeline; + use HasRecords; public Model $model; + public string $table; public Populator $populator; + protected ?Closure $makeProcessorUsing = null; + protected null | Closure | InteractsWithPipeline $performInsertUsing = null; /** * Parses all samples from the populators directory and attempts to insert them into the database. - * @param Populator $populator - * @return void + * * @throws Exception */ public function handle(Populator $populator): void { - if (!$this->checkEnvironment()) { + if (! $this->checkEnvironment()) { return; } $this->populator = $populator; - if (!empty($this->records)) { + if (! empty($this->records)) { collect($this->records) ->each(function (array $record, $key) { - $modelName = $this->model::class; - $this->makeProcessor() + $this->makeProcessor() ->pipeableUsing($this->populator->getPipeable() ?? $this->getPipeable()) - ->process($record, is_int($key) ? "{$modelName}-$key" : $key); - }); + ->process($record, $key) + ; + }) + ; return; } @@ -70,68 +73,88 @@ public function handle(Populator $populator): void database_path("populators/{$populator->getName()}/{$singular}"), ]); - $found = false; - - $paths - ->filter(fn($path) => File::exists($path)) - ->each(function ($path) use (&$found) { - if ($found) return; - $found = true; - - collect(File::files($path)) - ->each(function (\SplFileInfo $file) { - $data = include $file->getPathname(); - $name = str($file->getFilename()) - ->beforeLast('.') - ->toString(); - - Processor::make($this) - ->pipeableUsing($this->getPipeable() ?? $this->populator->getPipeable()) - ->process($data, $name); - }); - }); - - if (!$found) { + $found = $paths + ->filter(fn ($path) => File::exists($path)) + ->first() + ; + if ($found) { + collect(File::files($found)) + ->each(function (\SplFileInfo $file) { + $data = include $file->getPathname(); + $name = str($file->getFilename()) + ->beforeLast('.') + ->toString() + ; + + $this->makeProcessor() + ->pipeableUsing($this->getPipeable() ?? $this->populator->getPipeable()) + ->process($data, $name) + ; + }) + ; + } else { $modelName = $this->model::class; - throw new Exception("A directory for the bundle of '$modelName' does not exist. Please make sure to create one of the following directories: \n" . $paths->map(fn($path) => str($path)->prepend("\t - "))->implode("\n")); + throw new Exception("A directory for the bundle of '$modelName' does not exist. Please make sure to create one of the following directories: \n" . $paths->map(fn ($path) => str($path)->prepend("\t - "))->implode("\n")); } } + /** + * Custom @Processor instantiation by closure + * + * @param Closure():Processor|null $closure + * @return $this + */ public function makeProcessorUsing(?Closure $closure): static { $this->makeProcessorUsing = $closure; + return $this; } - + /** + * Instantiates @return Processor + * + * @see Processor to process the bundle + */ protected function makeProcessor(): Processor { - if($processor = $this->makeProcessorUsing) { - return $processor($this); + if ($factory = $this->makeProcessorUsing) { + $processor = $factory($this); + } else { + $processor = Processor::make($this); } - return Processor::make($this); + return $processor->performInsertUsing($this->performInsertUsing); + } + + /** + * Custom @Model insertion by closure which needs to return the key for the model, typically by + * `getKey()` operation on the model. + * + * @param InteractsWithBundleInsert|Closure(array,Bundle):(string|int)|null $closure + * @return $this + */ + public function performInsertUsing(null | InteractsWithBundleInsert | Closure $closure): static + { + $this->performInsertUsing = $closure; + + return $this; } /** * Creates an instance of the class. */ - private final function __construct(string $model, string $name = null) + final private function __construct(string $model, ?string $name = null) { $this->model = new $model; $this->name = $name; $this->table = $this->model->getTable(); } - /** * Static factory to create an instance of the class. - * - * @param string $model - * @param string|null $name - * @return static */ - public static function make(string $model, string $name = null): static + public static function make(string $model, ?string $name = null): static { return new static($model, $name); } diff --git a/src/Concerns/Bundle/HasDefaults.php b/src/Concerns/Bundle/HasDefaults.php index 35762d0..63b31b0 100644 --- a/src/Concerns/Bundle/HasDefaults.php +++ b/src/Concerns/Bundle/HasDefaults.php @@ -2,16 +2,20 @@ namespace Guava\LaravelPopulator\Concerns\Bundle; +use Closure; + trait HasDefaults { - + /** + * @var array + */ public array $defaults = []; /** * Adds a default attribute to the record. * - * @param string $attribute Name of the attribute. - * @param mixed $closure Callback to run on the attribute. + * @param string $attribute Name of the attribute. + * @param mixed $closure Callback to run on the attribute. * @return $this */ public function default(string $attribute, mixed $closure): static diff --git a/src/Concerns/Bundle/HasGenerators.php b/src/Concerns/Bundle/HasGenerators.php index bd79060..0a393b4 100644 --- a/src/Concerns/Bundle/HasGenerators.php +++ b/src/Concerns/Bundle/HasGenerators.php @@ -6,14 +6,16 @@ trait HasGenerators { - + /** + * @var array):scalar> + */ public array $generators = []; /** * Adds a generated attribute to the record. * - * @param string $attribute Name of the attribute. - * @param Closure $closure Callback to run on the attribute. + * @param string $attribute Name of the attribute. + * @param Closure(array):scalar $closure Callback to run on the attribute. * @return $this */ public function generate(string $attribute, Closure $closure): static diff --git a/src/Concerns/Bundle/HasMutators.php b/src/Concerns/Bundle/HasMutators.php index 62232ca..d36c1e2 100644 --- a/src/Concerns/Bundle/HasMutators.php +++ b/src/Concerns/Bundle/HasMutators.php @@ -6,14 +6,16 @@ trait HasMutators { - + /** + * @var array + */ public array $mutators = []; /** * Mutates the specified attribute using the given callback. * - * @param string $attribute Attribute to mutate. - * @param Closure $closure Callback to run on the attribute. + * @param string $attribute Attribute to mutate. + * @param Closure(scalar):scalar $closure Callback to run on the attribute. * @return $this */ public function mutate(string $attribute, Closure $closure): static diff --git a/src/Concerns/Bundle/HasRecords.php b/src/Concerns/Bundle/HasRecords.php index 6d8e99d..42ff2d7 100644 --- a/src/Concerns/Bundle/HasRecords.php +++ b/src/Concerns/Bundle/HasRecords.php @@ -6,16 +6,18 @@ trait HasRecords { + /** + * @var array> + */ public array $records = []; /** * Adds a record to the bundle for population. * - * @param string $key Key to access the record by from other records. - * @param array|Closure $record Data to populate the record with or closure returning the data. - * @return static + * @param string $key Key to access the record by from other records. + * @param array|Closure():array $record Data to populate the record with or closure returning the data. */ - public function record(string $key, array|Closure $record): static + public function record(string $key, array | Closure $record): static { $this->records[$key] = is_callable($record) ? $record() : $record; @@ -25,10 +27,9 @@ public function record(string $key, array|Closure $record): static /** * Adds an array of records to the bundle for population. * - * @param array|Closure $records Records to populate the bundle with or closure returning the records. - * @return static + * @param array|Closure():array $records Records to populate the bundle with or closure returning the records. */ - public function records(array|Closure $records): static + public function records(array | Closure $records): static { $this->records = is_callable($records) ? $records() : $records; diff --git a/src/Concerns/HasData.php b/src/Concerns/HasData.php index 0bd6d95..c9e8065 100644 --- a/src/Concerns/HasData.php +++ b/src/Concerns/HasData.php @@ -6,5 +6,8 @@ trait HasData { + /** + * @var Collection + */ protected Collection $data; -} \ No newline at end of file +} diff --git a/src/Concerns/HasEnvironments.php b/src/Concerns/HasEnvironments.php index 89454a1..58640b1 100644 --- a/src/Concerns/HasEnvironments.php +++ b/src/Concerns/HasEnvironments.php @@ -4,12 +4,15 @@ trait HasEnvironments { + /** + * @var string[] + */ public array $environments = []; /** * Sets the allowed environments. * - * @param array $environments + * @param string[] $environments * @return $this */ public function environments(array $environments): static @@ -22,7 +25,7 @@ public function environments(array $environments): static /** * Returns the allowed environments. * - * @return array + * @return string[] */ public function getEnvironments(): array { @@ -31,12 +34,9 @@ public function getEnvironments(): array /** * Checks whether the environment is valid. - * - * @return bool */ public function checkEnvironment(): bool { return empty($this->getEnvironments()) || app()->environment($this->getEnvironments()); } - } diff --git a/src/Concerns/HasName.php b/src/Concerns/HasName.php index 2b89203..3b87cc2 100644 --- a/src/Concerns/HasName.php +++ b/src/Concerns/HasName.php @@ -4,16 +4,12 @@ trait HasName { - public string|null $name; + public ?string $name; /** * Returns the name of the class. - * - * @param string|null $class - * @param bool $withNamespace - * @return string */ - public function getName(string $class = null, bool $withNamespace = false): string + public function getName(?string $class = null, bool $withNamespace = false): string { if ($this->name) { return $this->name; @@ -21,10 +17,11 @@ public function getName(string $class = null, bool $withNamespace = false): stri $class = $class ?? static::class; $class = $withNamespace ? str($class)->replace('\\', '.') : class_basename($class); + return str($class) - ->whenEndsWith('Populator', fn($str) => $str->replaceLast('Populator', '')) + ->whenEndsWith('Populator', fn ($str) => $str->replaceLast('Populator', '')) ->kebab() - ->toString(); + ->toString() + ; } - } diff --git a/src/Concerns/HasPipeline.php b/src/Concerns/HasPipeline.php index 89e4299..1e5294d 100644 --- a/src/Concerns/HasPipeline.php +++ b/src/Concerns/HasPipeline.php @@ -10,13 +10,15 @@ trait HasPipeline public function pipeableUsing(?InteractsWithPipeline $withPipeline): static { - if($withPipeline !== null) { + if ($withPipeline !== null) { $this->pipeable = $withPipeline; } + return $this; } - public function getPipeable(): ?InteractsWithPipeline { + public function getPipeable(): ?InteractsWithPipeline + { return $this->pipeable; } -} \ No newline at end of file +} diff --git a/src/Concerns/HasPopulation.php b/src/Concerns/HasPopulation.php new file mode 100644 index 0000000..3ffb722 --- /dev/null +++ b/src/Concerns/HasPopulation.php @@ -0,0 +1,23 @@ + + */ + public function population(): MorphOne + { + return $this->morphOne(Population::class, 'populatable'); + } +} diff --git a/src/Concerns/Pipe/DefaultsPipe.php b/src/Concerns/Pipe/DefaultsPipe.php index 626f60d..d1f0786 100644 --- a/src/Concerns/Pipe/DefaultsPipe.php +++ b/src/Concerns/Pipe/DefaultsPipe.php @@ -6,28 +6,32 @@ trait DefaultsPipe { - /** * Adds default values for attributes that are not set. * - * @param Collection $data - * @return Collection + * @param Collection $data + * @return Collection */ public function defaults(Collection $data): Collection { return $data - ->when($this->bundle->model->usesTimestamps(), - fn(Collection $collection) => $collection->merge([ + ->when( + $this->bundle->model->usesTimestamps(), + fn (Collection $collection) => $collection->merge([ 'created_at' => now(), 'updated_at' => now(), - ])) - ->when(fn() => !empty($this->bundle->defaults), - fn(Collection $collection) => $collection->merge( + ]) + ) + ->when( + fn () => ! empty($this->bundle->defaults), + fn (Collection $collection) => $collection->merge( collect($this->bundle->defaults) - ->filter(fn($item, $key) => !$data->has($key)) + ->filter(fn ($item, $key) => ! $data->has($key)) ->map(function ($value) { return is_callable($value) ? $value() : $value; }) - )); + ) + ) + ; } } diff --git a/src/Concerns/Pipe/GeneratorsPipe.php b/src/Concerns/Pipe/GeneratorsPipe.php index 660fcaa..bbc5ffe 100644 --- a/src/Concerns/Pipe/GeneratorsPipe.php +++ b/src/Concerns/Pipe/GeneratorsPipe.php @@ -6,23 +6,25 @@ trait GeneratorsPipe { - /** * Adds default values for attributes that are not set. * - * @param Collection $data - * @return Collection + * @param Collection $data + * @return Collection */ public function generators(Collection $data): Collection { return $data - ->when(fn() => !empty($this->bundle->generators), - fn(Collection $collection) => $collection->merge( + ->when( + fn () => ! empty($this->bundle->generators), + fn (Collection $collection) => $collection->merge( collect($this->bundle->generators) - ->filter(fn($item, $key) => !$data->has($key)) + ->filter(fn ($item, $key) => ! $data->has($key)) ->map(fn ($value) => app()->call($value, [ - 'attributes' => $data->toArray() + 'attributes' => $data->toArray(), ])) - )); + ) + ) + ; } } diff --git a/src/Concerns/Pipe/InsertPipe.php b/src/Concerns/Pipe/InsertPipe.php index 2d7436a..2890ef3 100644 --- a/src/Concerns/Pipe/InsertPipe.php +++ b/src/Concerns/Pipe/InsertPipe.php @@ -2,28 +2,79 @@ namespace Guava\LaravelPopulator\Concerns\Pipe; +use Closure; +use Guava\LaravelPopulator\Bundle; +use Guava\LaravelPopulator\Contracts\InteractsWithBundleInsert; +use Guava\LaravelPopulator\Exceptions\InvalidBundleException; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; trait InsertPipe { + protected ?InteractsWithBundleInsert $performInsertUsing = null; + /** * Inserts the model into the database. * - * @param Collection $data - * @return Collection + * @param Collection $data + * @return Collection + * + * @throws InvalidBundleException */ public function insert(Collection $data): Collection { - $id = DB::table($this->bundle->table) - ->insertGetId($data->toArray()); + $id = $this->insertBundle($data->toArray(), $this->bundle); + throw_unless($id, InvalidBundleException::class, 'insertBundle cannot return a blank value'); + $this->bundle->populator->memory->set($this->bundle->model::class, $this->name, $id); + + return $data; + } + + /** + * @param array $data + */ + public function insertBundle(array $data, Bundle $bundle): int | string + { + if ($this->performInsertUsing) { + return $this->performInsertUsing->insertDataFromBundle($data, $bundle); + } + $id = DB::table($bundle->table) + ->insertGetId($data) + ; // Get the ID if it's not auto incrementing - if (!$this->bundle->model->getIncrementing()) { - $id = $data->get($this->bundle->model->getKeyName()); + if (! $bundle->model->getIncrementing()) { + return data_get($data, $bundle->model->getKeyName()); } - $this->bundle->populator->memory->set($this->bundle->model::class, $this->name, $id); - return $data; + return $id; + } + + /** + * @param Closure(array,Bundle):(int|string)|InteractsWithBundleInsert|null $withBundleInsert + * @return $this + */ + public function performInsertUsing(null | Closure | InteractsWithBundleInsert $withBundleInsert): static + { + if ($withBundleInsert) { + $this->performInsertUsing = $withBundleInsert instanceof InteractsWithBundleInsert ? + $withBundleInsert : + new readonly class($withBundleInsert) implements InteractsWithBundleInsert + { + public function __construct( + protected Closure $insert + ) {} + + /** + * @param array $data + */ + public function insertDataFromBundle(array $data, Bundle $bundle): int | string + { + return forward_static_call($this->insert, $data, $bundle); + } + }; + } + + return $this; } } diff --git a/src/Concerns/Pipe/MutatorsPipe.php b/src/Concerns/Pipe/MutatorsPipe.php index 57ba597..c517414 100644 --- a/src/Concerns/Pipe/MutatorsPipe.php +++ b/src/Concerns/Pipe/MutatorsPipe.php @@ -10,15 +10,18 @@ trait MutatorsPipe /** * Mutes the attributes of the model using the defined mutators. * - * @param Collection $data - * @return Collection + * @param Collection $data + * @return Collection */ public function mutate(Collection $data): Collection { return $data - ->when(fn() => !empty($this->bundle->mutators), - fn(Collection $collection) => $collection->map(function ($value, $key) { + ->when( + fn () => ! empty($this->bundle->mutators), + fn (Collection $collection) => $collection->map(function ($value, $key) { return Arr::exists($this->bundle->mutators, $key) ? $this->bundle->mutators[$key]($value) : $value; - })); + }) + ) + ; } } diff --git a/src/Concerns/Pipe/RelatedPipe.php b/src/Concerns/Pipe/RelatedPipe.php index 9b72bf2..ae783fb 100644 --- a/src/Concerns/Pipe/RelatedPipe.php +++ b/src/Concerns/Pipe/RelatedPipe.php @@ -16,12 +16,11 @@ trait RelatedPipe { - /** * Handles the queued related models and inserts them into the database. * - * @param Collection $data - * @return Collection + * @param Collection $data + * @return Collection */ public function related(Collection $data): Collection { @@ -49,7 +48,8 @@ public function related(Collection $data): Collection $relation['foreign']['pivot_key'] => $id, $relation['foreign']['morph_type'] => $this->bundle->model::class, $relation['related']['pivot_key'] => $relation['related']['id'], - ]); + ]) + ; } if ($relation['relation'] === BelongsToMany::class) { @@ -57,7 +57,8 @@ public function related(Collection $data): Collection ->insert([ $relation['foreign']['pivot_key'] => $id, $relation['related']['pivot_key'] => $relation['related']['id'], - ]); + ]) + ; } if ($relation['relation'] === MorphOneOrMany::class diff --git a/src/Concerns/Pipe/Relations/BelongsRelations.php b/src/Concerns/Pipe/Relations/BelongsRelations.php index 050a3a7..bf7240f 100644 --- a/src/Concerns/Pipe/Relations/BelongsRelations.php +++ b/src/Concerns/Pipe/Relations/BelongsRelations.php @@ -3,26 +3,25 @@ namespace Guava\LaravelPopulator\Concerns\Pipe\Relations; use Guava\LaravelPopulator\Exceptions\InvalidBundleException; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; trait BelongsRelations { - - /** * Processes the belongs to relationship and sets the foreign key. * - * @param BelongsTo $relation - * @param string $value - * @return array + * @param BelongsTo $relation + * @return array + * * @throws InvalidBundleException */ protected function belongsTo(BelongsTo $relation, string $value): array { $id = $this->getPrimaryId($relation->getRelated(), $value); - if (!$id) { + if (! $id) { $bundleName = $this->bundle->model::class; throw new InvalidBundleException("Item {$this->name} from Sample {$bundleName} has an invalid belongsTo relation set for {$relation->getRelationName()} (value: {$value})."); } @@ -33,9 +32,9 @@ protected function belongsTo(BelongsTo $relation, string $value): array /** * Processes the belongs to many relationship and queues the relation for creation. * - * @param BelongsToMany $relation - * @param array $value - * @return void + * @param BelongsToMany $relation + * @param string[] $value + * * @throws InvalidBundleException */ protected function belongsToMany(BelongsToMany $relation, array $value): void @@ -43,7 +42,7 @@ protected function belongsToMany(BelongsToMany $relation, array $value): void foreach ($value as $identifier) { $id = $this->getPrimaryId($relation->getRelated(), $identifier); - if (!$id) { + if (! $id) { $bundleName = $this->bundle->model::class; throw new InvalidBundleException("Item {$this->name} from Sample {$bundleName} has an invalid belongsToMany relation set for {$relation->getRelationName()} (value: {$identifier})."); } @@ -51,7 +50,7 @@ protected function belongsToMany(BelongsToMany $relation, array $value): void $this->memory->set($relation->getTable(), $identifier, [ 'relation' => $relation::class, 'foreign' => [ - 'pivot_key' => $relation->getForeignPivotKeyName() + 'pivot_key' => $relation->getForeignPivotKeyName(), ], 'related' => [ 'pivot_key' => $relation->getRelatedPivotKeyName(), diff --git a/src/Concerns/Pipe/Relations/HasOneOrManyRelations.php b/src/Concerns/Pipe/Relations/HasOneOrManyRelations.php index e8a6863..8bdfd92 100644 --- a/src/Concerns/Pipe/Relations/HasOneOrManyRelations.php +++ b/src/Concerns/Pipe/Relations/HasOneOrManyRelations.php @@ -2,6 +2,7 @@ namespace Guava\LaravelPopulator\Concerns\Pipe\Relations; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasOneOrMany; @@ -9,13 +10,11 @@ trait HasOneOrManyRelations { - /** * Handles the hasOne relation of the processed record. * - * @param HasOne $relation - * @param array $record - * @return void + * @param HasOne $relation + * @param array> $record */ protected function hasOne(HasOne $relation, array $record): void { @@ -27,9 +26,8 @@ protected function hasOne(HasOne $relation, array $record): void /** * Handles the hasMany relation of the processed record. * - * @param HasMany $relation - * @param array $records - * @return void + * @param HasMany $relation + * @param array>> $records */ protected function hasMany(HasMany $relation, array $records): void { @@ -39,9 +37,8 @@ protected function hasMany(HasMany $relation, array $records): void /** * Handles the hasOneOrMany relation of the procesed record. * - * @param HasOneOrMany $relation - * @param array $records - * @return void + * @param HasOneOrMany $relation + * @param array>> $records */ protected function hasOneOrMany(HasOneOrMany $relation, array $records): void { @@ -54,7 +51,7 @@ protected function hasOneOrMany(HasOneOrMany $relation, array $records): void 'related' => $relation->getRelated()::class, 'record' => array_merge($record, [ $relationName => $this->name, - ]) + ]), ]); $index++; } diff --git a/src/Concerns/Pipe/Relations/MorphRelations.php b/src/Concerns/Pipe/Relations/MorphRelations.php index 71bb1f7..beb0d64 100644 --- a/src/Concerns/Pipe/Relations/MorphRelations.php +++ b/src/Concerns/Pipe/Relations/MorphRelations.php @@ -3,31 +3,31 @@ namespace Guava\LaravelPopulator\Concerns\Pipe\Relations; use Guava\LaravelPopulator\Exceptions\InvalidBundleException; -use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphOneOrMany; use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Support\Arr; use Illuminate\Support\Str; trait MorphRelations { - - /** * Processes the morph to relationship and sets the foreign key. * - * @param MorphTo $relation - * @param array $value - * @return array + * @param MorphTo $relation + * @param string[]|int[] $value + * @return array + * * @throws InvalidBundleException */ protected function morphTo(MorphTo $relation, array $value): array { $id = $this->getPrimaryId(new $value[1], $value[0]); - if (!$id) { + if (! $id) { $bundleName = $this->bundle->model::class; throw new InvalidBundleException("Item {$this->name} from Sample {$bundleName} has an invalid belongsToMany relation set for {$relation->getRelationName()} (value: {$value[0]})."); } @@ -38,9 +38,8 @@ protected function morphTo(MorphTo $relation, array $value): array /** * Processes the morph one relationship and sets the foreign key. * - * @param MorphOne $relation - * @param array $record - * @return void + * @param MorphOne $relation + * @param array $record */ protected function morphOne(MorphOneOrMany $relation, array $record): void { @@ -52,9 +51,8 @@ protected function morphOne(MorphOneOrMany $relation, array $record): void /** * Processes the morph many relationship and sets the foreign key. * - * @param MorphMany $relation - * @param array $items - * @return void + * @param MorphMany $relation + * @param string[]|int[] $items */ protected function morphMany(MorphMany $relation, array $items): void { @@ -64,16 +62,15 @@ protected function morphMany(MorphMany $relation, array $items): void /** * Processes the morph one or many relationship and sets the foreign key. * - * @param MorphOneOrMany $relation - * @param array $records - * @return void + * @param MorphOneOrMany $relation + * @param array>|array $records */ protected function morphOneOrMany(MorphOneOrMany $relation, array $records): void { $index = 0; foreach ($records as $record) { $morphName = Str::beforeLast($relation->getForeignKeyName(), '_'); - $record = collect($record)->merge([ + $record = collect(Arr::wrap($record))->merge([ $morphName => [$this->name, $relation->getMorphClass()], ])->toArray(); @@ -91,9 +88,9 @@ protected function morphOneOrMany(MorphOneOrMany $relation, array $records): voi /** * Processes the belongs to many relationship and queues the relation for creation. * - * @param MorphToMany $relation - * @param array $value - * @return void + * @param MorphToMany $relation + * @param string[]|int[] $value + * * @throws InvalidBundleException */ protected function morphToMany(MorphToMany $relation, array $value): void @@ -101,7 +98,7 @@ protected function morphToMany(MorphToMany $relation, array $value): void foreach ($value as $identifier) { $id = $this->getPrimaryId($relation->getRelated(), $identifier); - if (!$id) { + if (! $id) { $bundleName = $this->bundle->model::class; throw new InvalidBundleException("Item {$this->name} from Sample {$bundleName} has an invalid belongsToMany relation set for {$relation->getRelationName()} (value: {$identifier})."); } diff --git a/src/Concerns/Pipe/RelationsPipe.php b/src/Concerns/Pipe/RelationsPipe.php index 11cbeaa..b14c7fd 100644 --- a/src/Concerns/Pipe/RelationsPipe.php +++ b/src/Concerns/Pipe/RelationsPipe.php @@ -18,15 +18,16 @@ trait RelationsPipe { - use HasOneOrManyRelations; use BelongsRelations; + use HasOneOrManyRelations; use MorphRelations; /** * Parses the relations defined on the model and processes the supported relations. * - * @param Collection $data - * @return Collection + * @param Collection $data + * @return Collection|bool|float|int|string> + * * @throws InvalidBundleException */ public function relations(Collection $data): Collection @@ -35,29 +36,33 @@ public function relations(Collection $data): Collection ->mapWithKeys(function ($value, $relationName) { if ($this->bundle->model->isRelation($relationName)) { $relation = $this->bundle->model->$relationName(); - switch ($relation) { case $relation instanceof MorphTo: return $this->morphTo($relation, $value); case $relation instanceof MorphOne: $this->morphOne($relation, $value); + return []; case $relation instanceof MorphMany: $this->morphMany($relation, $value); + return []; case $relation instanceof MorphToMany: $this->morphToMany($relation, $value); + return []; case $relation instanceof HasOne: $this->hasOne($relation, $value); + return []; case $relation instanceof HasMany: $this->hasMany($relation, $value); + return []; case $relation instanceof BelongsTo: @@ -65,6 +70,7 @@ public function relations(Collection $data): Collection case $relation instanceof BelongsToMany: $this->belongsToMany($relation, $value); + return []; default: @@ -73,7 +79,7 @@ public function relations(Collection $data): Collection } else { return [$relationName => $value]; } - }); + }) + ; } - } diff --git a/src/Concerns/Pipe/TracksPopulationPipe.php b/src/Concerns/Pipe/TracksPopulationPipe.php new file mode 100644 index 0000000..818c427 --- /dev/null +++ b/src/Concerns/Pipe/TracksPopulationPipe.php @@ -0,0 +1,42 @@ + $data + * @return Collection + */ + public function track(Collection $data): Collection + { + $model = $this->bundle->model; + if ($model instanceof TracksPopulatedEntries && static::hasTrackingFeature()) { + assert($model instanceof Model); + $processor = $this->bundle->populator->getName(); + foreach (data_get($this->bundle->populator->memory->all(), $model::class) as $key => $id) { + Population::insert([ + 'key' => $key, + 'populator' => $processor, + 'bundle' => $this->bundle->getName(), + 'populatable_id' => $id, + 'populatable_type' => $model->getMorphClass(), + ]); + } + } + + return $data; + } +} diff --git a/src/Console/MakePopulatorCommand.php b/src/Console/MakePopulatorCommand.php index c4bedfa..1d38f91 100644 --- a/src/Console/MakePopulatorCommand.php +++ b/src/Console/MakePopulatorCommand.php @@ -5,11 +5,11 @@ use Illuminate\Console\GeneratorCommand; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Support\Stringable; + use function str; class MakePopulatorCommand extends GeneratorCommand { - protected $name = 'make:populator'; protected $description = 'Creates a new populator definition class'; @@ -21,17 +21,20 @@ protected function getStub(): string return __DIR__ . '/../../stubs/populator.stub.php'; } - protected function getSampleStub(): string { + protected function getSampleStub(): string + { return __DIR__ . '/../../stubs/sample.stub.json'; } protected function qualifyClass($name): string { - return parent::qualifyClass(ucwords(str($name) - ->whenEndsWith('Populator', - fn(Stringable $str) => $str, - fn(Stringable $str) => $str->append('Populator') - ), "\t\r\n\f\v/") + return parent::qualifyClass( + ucwords(str($name) + ->whenEndsWith( + 'Populator', + fn (Stringable $str) => $str, + fn (Stringable $str) => $str->append('Populator') + ), "\t\r\n\f\v/") ); } @@ -43,7 +46,6 @@ protected function getDefaultNamespace($rootNamespace): string /** * Creates the files for the populator. * - * @return bool * @throws FileNotFoundException */ public function handle(): bool @@ -54,16 +56,18 @@ public function handle(): bool ->beforeLast('Populator') // ->append('/user/') ->append('/') - ->append(str($this->getSampleStub()) - ->afterLast('/') - ->replace('.stub', '') + ->append( + str($this->getSampleStub()) + ->afterLast('/') + ->replace('.stub', '') ) - ->lower(); + ->lower() + ; $path = database_path('populators/' . $name); $this->makeDirectory($path); -// $this->files->put($path, file_get_contents($this->getSampleStub())); + // $this->files->put($path, file_get_contents($this->getSampleStub())); return true; } diff --git a/src/Console/MakeSampleCommand.php b/src/Console/MakeSampleCommand.php index f5e2b0f..8f23457 100644 --- a/src/Console/MakeSampleCommand.php +++ b/src/Console/MakeSampleCommand.php @@ -5,11 +5,11 @@ use Illuminate\Console\GeneratorCommand; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Support\Stringable; + use function str; class MakeSampleCommand extends GeneratorCommand { - protected $name = 'make:sample'; protected $description = 'Creates a new sample definition class'; @@ -21,17 +21,20 @@ protected function getStub(): string return __DIR__ . '/../../stubs/sample.stub.php'; } - protected function getSampleStub(): string { + protected function getSampleStub(): string + { return __DIR__ . '/../../stubs/sample.stub.json'; } protected function qualifyClass($name): string { - return parent::qualifyClass(ucwords(str($name) - ->whenEndsWith('Sample', - fn(Stringable $str) => $str, - fn(Stringable $str) => $str->append('Sample') - ), "\t\r\n\f\v/") + return parent::qualifyClass( + ucwords(str($name) + ->whenEndsWith( + 'Sample', + fn (Stringable $str) => $str, + fn (Stringable $str) => $str->append('Sample') + ), "\t\r\n\f\v/") ); } @@ -43,27 +46,26 @@ protected function getDefaultNamespace($rootNamespace): string /** * Creates the files for the populator. * - * @return bool * @throws FileNotFoundException */ public function handle(): bool { parent::handle(); -// $name = str($this->getNameInput()) -// ->beforeLast('Sample') -//// ->append('/user/') -// ->append('/') -// ->append(str($this->getSampleStub()) -// ->afterLast('/') -// ->replace('.stub', '') -// ) -// ->lower(); -// $path = database_path('populators/' . $name); -// -// $this->makeDirectory($path); + // $name = str($this->getNameInput()) + // ->beforeLast('Sample') + //// ->append('/user/') + // ->append('/') + // ->append(str($this->getSampleStub()) + // ->afterLast('/') + // ->replace('.stub', '') + // ) + // ->lower(); + // $path = database_path('populators/' . $name); + // + // $this->makeDirectory($path); -// $this->files->put($path, file_get_contents($this->getSampleStub())); + // $this->files->put($path, file_get_contents($this->getSampleStub())); return true; } diff --git a/src/Contracts/InteractsWithBundleInsert.php b/src/Contracts/InteractsWithBundleInsert.php new file mode 100644 index 0000000..34bd63e --- /dev/null +++ b/src/Contracts/InteractsWithBundleInsert.php @@ -0,0 +1,15 @@ + $data + */ + public function insertDataFromBundle(array $data, Bundle $bundle): int | string; +} diff --git a/src/Contracts/InteractsWithPipeline.php b/src/Contracts/InteractsWithPipeline.php index 2b7b027..0a48c90 100644 --- a/src/Contracts/InteractsWithPipeline.php +++ b/src/Contracts/InteractsWithPipeline.php @@ -2,11 +2,15 @@ namespace Guava\LaravelPopulator\Contracts; -use Closure; use Guava\LaravelPopulator\Processor; use Illuminate\Support\Collection; interface InteractsWithPipeline { + /** + * Invokes the pipeline by piping the data through it + * + * @param Collection $data + */ public function processPipeline(Processor $processor, Collection $data): void; -} \ No newline at end of file +} diff --git a/src/Contracts/TracksPopulatedEntries.php b/src/Contracts/TracksPopulatedEntries.php new file mode 100644 index 0000000..3993944 --- /dev/null +++ b/src/Contracts/TracksPopulatedEntries.php @@ -0,0 +1,10 @@ + + */ + protected array $enabled = [ + 'tracking' => null, + 'population_model' => null, + ]; + + /** + * Check if a feature is currently enabled + */ + public function enabled(string $feature): bool + { + return boolval(data_get($this->enabled, $feature) ?? data_get(config('populator', []), $feature, false)); + } + + /** + * Identity for the tracking feature + */ + public function tracking(): string + { + return 'tracking'; + } + + /** + * Identity for the tracking feature + */ + public function populationModel(): string + { + return 'population_model'; + } + + /** + * Enabled state for the populated model tracking feature + */ + public function hasTrackingFeature(): bool + { + return $this->enabled($this->tracking()); + } + + /** + * Disable the populated model tracking feature + */ + public function disableTrackingFeature(): void + { + $this->enabled['tracking'] = false; + } + + /** + * Enable the populated model tracking feature + */ + public function enableTrackingFeature(): void + { + $this->enabled['tracking'] = true; + } + + /** + * Enabled state for the populated model tracking feature + */ + public function hasCustomPopulationModel(): bool + { + return $this->populationModelClass() !== Population::class; + } + + /** + * Set the model used for Population + * + * @param class-string $model + */ + public function customPopulationModel(string $model): void + { + $this->enabled[$this->populationModel()] = $model; + } + + /** + * @return class-string + */ + public function populationModelClass(): string + { + return $this->enabled[$this->populationModel()] ?? Population::class; + } + + /** + * Instantiate Population + */ + public function makePopulationModel(): Population + { + $class = $this->populationModelClass(); + + return new $class; + } +} diff --git a/src/Models/Population.php b/src/Models/Population.php new file mode 100644 index 0000000..12b0b64 --- /dev/null +++ b/src/Models/Population.php @@ -0,0 +1,39 @@ + + */ + public function populatable(): MorphTo + { + return $this->morphTo(); + } + + public function getMorphClass(): string + { + return 'population'; + } + + protected static function newFactory(): PopulationFactory + { + return new PopulationFactory(); + } +} diff --git a/src/Populator.php b/src/Populator.php index 24b86f0..0577aa0 100644 --- a/src/Populator.php +++ b/src/Populator.php @@ -5,27 +5,32 @@ use Guava\LaravelPopulator\Concerns\HasEnvironments; use Guava\LaravelPopulator\Concerns\HasName; use Guava\LaravelPopulator\Concerns\HasPipeline; +use Guava\LaravelPopulator\Contracts\TracksPopulatedEntries; +use Guava\LaravelPopulator\Exceptions\FeatureNotEnabledException; +use Guava\LaravelPopulator\Facades\Feature; +use Guava\LaravelPopulator\Models\Population; use Guava\LaravelPopulator\Storage\Memory; /** * The populator is used to populate your database with the defined bundles of model records. - * - * @package Guava\LaravelPopulator */ class Populator { - use HasName; use HasEnvironments; + use HasName; use HasPipeline; public Memory $memory; + /** + * @var Bundle[] + */ public array $bundles = []; /** * Defines all bundles of the populator. * - * @param array $bundles + * @param Bundle[] $bundles * @return $this */ public function bundles(array $bundles): static @@ -46,13 +51,53 @@ public function call(): void } /** - * Calls the defined samples to populate the database. + * Deletes any inserted records that were tracked by Population. * - * @return void + * In order to be eligible for tracking @return void + * + * @throws FeatureNotEnabledException + * + * @see TracksPopulatedEntries + * and tracking must not be disabled (either by config or service provider) + */ + public function rollback(): void + { + throw_unless(Feature::hasTrackingFeature(), FeatureNotEnabledException::class, 'Rollback is not allowed when tracking is disabled'); + + $bundles = collect($this->bundles) + ->map(function (Bundle $bundle) { + return $bundle->getName(); + }) + ; + + $classes = collect($this->bundles) + ->map(function (Bundle $bundle) { + return $bundle->model->getMorphClass(); + }) + ; + + Population::where('populator', '=', $this->getName()) + ->where(function ($query) use ($bundles, $classes) { + return $query + ->when($classes->isNotEmpty(), fn ($query) => $query->whereIn('populatable_type', $classes)) + ->when($bundles->isNotEmpty(), fn ($query) => $query->whereIn('bundle', $bundles)) + ; + }) + ->orderBy('id', 'desc') + ->lazy() + ->each(function (Population $record) { + $record->populatable()->delete(); + $record->delete(); + }) + ; + } + + /** + * Calls the defined samples to populate the database. */ private function handle(): void { - if (!$this->checkEnvironment()) { + if (! $this->checkEnvironment()) { return; } @@ -64,20 +109,17 @@ private function handle(): void /** * Creates an instance of the class. */ - private function __construct(string $name) { + final private function __construct(string $name) + { $this->name = $name; $this->memory = new Memory(); } /** * Static factory to create an instance of the class. - * - * @param string $name - * @return static */ public static function make(string $name): static { return new static($name); } - } diff --git a/src/PopulatorServiceProvider.php b/src/PopulatorServiceProvider.php index ab59496..6a3953d 100644 --- a/src/PopulatorServiceProvider.php +++ b/src/PopulatorServiceProvider.php @@ -9,11 +9,11 @@ class PopulatorServiceProvider extends ServiceProvider { - public function register(): void { $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'populator'); $this->app->bind(InteractsWithPipeline::class, InsertPipelineInvoker::class); + $this->app->scoped(Features::class); } public function boot(): void @@ -23,10 +23,17 @@ public function boot(): void __DIR__.'/../config/config.php' => config_path('populator.php'), ], 'config'); + $this->publishes([ + __DIR__.'/../database/migrations/' => database_path('migrations'), + ], 'migrations'); + + $this->loadMigrationsFrom([ + __DIR__.'/../database/migrations' => database_path('migrations'), + ]); + $this->commands([ MakePopulatorCommand::class, ]); } } - } diff --git a/src/Processor.php b/src/Processor.php index 1c5f82a..10cd3eb 100644 --- a/src/Processor.php +++ b/src/Processor.php @@ -10,7 +10,9 @@ use Guava\LaravelPopulator\Concerns\Pipe\MutatorsPipe; use Guava\LaravelPopulator\Concerns\Pipe\RelatedPipe; use Guava\LaravelPopulator\Concerns\Pipe\RelationsPipe; +use Guava\LaravelPopulator\Concerns\Pipe\TracksPopulationPipe; use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; +use Guava\LaravelPopulator\Facades\Feature; use Guava\LaravelPopulator\Storage\Memory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -21,18 +23,20 @@ */ class Processor { - use RelationsPipe; use DefaultsPipe; - use MutatorsPipe; use GeneratorsPipe; - use InsertPipe; - use RelatedPipe; use HasData; use HasPipeline; + use InsertPipe; + use MutatorsPipe; + use RelatedPipe; + use RelationsPipe; + use TracksPopulationPipe; protected Bundle $bundle; protected \SplFileInfo $file; + protected string $name; protected Memory $memory; @@ -40,26 +44,20 @@ class Processor /** * Processes the passed data through a set of pipelines. * - * @param array|Collection $data The data to process. - * @param string $name Name of the current 'process'. - * @return void + * @param array|Collection $data The data to process. + * @param string $name Name of the current 'process'. */ - public function process(array|Collection $data, string $name): void + public function process(array | Collection $data, string $name): void { $this->data = is_array($data) ? collect($data) : $data; $this->name = $name; $this->pipeable->processPipeline($this, $this->data); - } /** * Attempts to find the primary ID of the specified model's record with the given identifier. - * - * @param Model $model - * @param string $identifier - * @return int|string|null */ - protected function getPrimaryId(Model $model, string $identifier): int|string|null + protected function getPrimaryId(Model $model, string $identifier): int | string | null { $id = $this->bundle->populator->memory->get($model::class, $identifier); @@ -87,7 +85,7 @@ protected function getPrimaryId(Model $model, string $identifier): int|string|nu /** * Creates an instance of the class. */ - public function __construct(Bundle $bundle, ?InteractsWithPipeline $invoker = null) + final public function __construct(Bundle $bundle, ?InteractsWithPipeline $invoker = null) { $this->bundle = $bundle; $this->pipeable = $invoker ?? app(InteractsWithPipeline::class); @@ -96,13 +94,66 @@ public function __construct(Bundle $bundle, ?InteractsWithPipeline $invoker = nu /** * Static factory to create an instance of the class. - * - * @param Bundle $bundle - * @return static */ public static function make(Bundle $bundle): static { return new static($bundle); } + /** + * Enable tracking model populations + */ + public static function enableTracking(): void + { + Feature::enableTrackingFeature(); + } + + /** + * Disable tracking model populations + */ + public static function disableTracking(): void + { + Feature::disableTrackingFeature(); + } + + /** + * Runs a closure with tracking temporarily disabled + */ + public static function disabledTracking(\Closure $callable): void + { + $enabled = static::hasTrackingFeature(); + try { + if ($enabled) { + static::disableTracking(); + } + $callable(); + } finally { + if ($enabled) { + static::enableTracking(); + } + } + } + + /** + * Runs a closure with tracking temporarily enabled + */ + public static function enabledTracking(\Closure $callable): void + { + $enabled = static::hasTrackingFeature(); + try { + if (! $enabled) { + static::enableTracking(); + } + $callable(); + } finally { + if (! $enabled) { + static::disableTracking(); + } + } + } + + public static function hasTrackingFeature(): bool + { + return Feature::hasTrackingFeature(); + } } diff --git a/src/Storage/Memory.php b/src/Storage/Memory.php index 2ffcdbe..939a450 100644 --- a/src/Storage/Memory.php +++ b/src/Storage/Memory.php @@ -9,20 +9,17 @@ */ class Memory { - + /** + * @var array> + */ private array $memory = []; /** * Stores the passed data in the memory. - * - * @param string $model - * @param string $key - * @param mixed $value - * @return void */ public function set(string $model, string $key, mixed $value): void { - if (!Arr::exists($this->memory, $model)) { + if (! Arr::exists($this->memory, $model)) { Arr::set($this->memory, $model, []); } @@ -32,10 +29,6 @@ public function set(string $model, string $key, mixed $value): void /** * Returns the stored data for the passed model and key. - * - * @param string $model - * @param string $key - * @return mixed */ public function get(string $model, string $key): mixed { @@ -44,10 +37,6 @@ public function get(string $model, string $key): mixed /** * Checks if the stored data for the passed model exists in memory. - * - * @param string $model - * @param string $key - * @return bool */ public function has(string $model, string $key): bool { @@ -57,11 +46,10 @@ public function has(string $model, string $key): bool /** * Returns the stored data from memory. * - * @return array + * @return array> */ public function all(): array { return $this->memory; } - } diff --git a/src/Support/Processors/InsertPipelineInvoker.php b/src/Support/Processors/InsertPipelineInvoker.php index 42dc2cb..86b4709 100644 --- a/src/Support/Processors/InsertPipelineInvoker.php +++ b/src/Support/Processors/InsertPipelineInvoker.php @@ -3,13 +3,18 @@ namespace Guava\LaravelPopulator\Support\Processors; use Closure; -use Guava\LaravelPopulator\Concerns\Pipe; use Guava\LaravelPopulator\Processor; +use Illuminate\Support\Collection; +/** + * Pipeline that handles inserting the records into the database + */ class InsertPipelineInvoker extends PipelineInvoker { - - function defaultPipes(Processor $processor): array + /** + * @return array):Collection> + */ + public function defaultPipes(Processor $processor): array { return [ $processor->relations(...), @@ -17,7 +22,8 @@ function defaultPipes(Processor $processor): array $processor->mutate(...), $processor->generators(...), $processor->insert(...), + $processor->track(...), $processor->related(...), ]; } -} \ No newline at end of file +} diff --git a/src/Support/Processors/PipelineInvoker.php b/src/Support/Processors/PipelineInvoker.php index 93d4e3e..279323e 100644 --- a/src/Support/Processors/PipelineInvoker.php +++ b/src/Support/Processors/PipelineInvoker.php @@ -3,35 +3,56 @@ namespace Guava\LaravelPopulator\Support\Processors; use Closure; -use Guava\LaravelPopulator\Concerns\HasData; use Guava\LaravelPopulator\Contracts\InteractsWithPipeline; use Guava\LaravelPopulator\Processor; use Illuminate\Support\Collection; abstract class PipelineInvoker implements InteractsWithPipeline { - protected ?Closure $usingPipes = null; + /** + * Invokes the pipeline by piping the data through it + * + * @param Collection $data + */ public function processPipeline(Processor $processor, Collection $data): void { $data->pipeThrough($this->pipes($processor)); } + /** + * Provides the list of pipes by a closure, receiving the current Processor + * as a parameter + * + * @param Closure(Processor):array):Collection> $pipes + * @return $this + */ public function usingPipes(Closure $pipes): static { $this->usingPipes = $pipes; + return $this; } + /** + * Provides a list of closures to pipe the data through + * + * @return array):Collection> + */ protected function pipes(Processor $processor): array { - if($pipe = $this->usingPipes) { + if ($pipe = $this->usingPipes) { return $pipe($processor); } + return $this->defaultPipes($processor); } - abstract function defaultPipes(Processor $processor): array; - -} \ No newline at end of file + /** + * A list of default closures to pipe the data through + * + * @return array):Collection> + */ + abstract public function defaultPipes(Processor $processor): array; +} diff --git a/stubs/populator.stub.php b/stubs/populator.stub.php index f40e275..8eab773 100644 --- a/stubs/populator.stub.php +++ b/stubs/populator.stub.php @@ -1,11 +1,11 @@ mutate('password', fn($value) => Hash::make($value)); } - } diff --git a/tests/Feature/BundleTest.php b/tests/Feature/BundleTest.php index 74f02aa..365e78b 100644 --- a/tests/Feature/BundleTest.php +++ b/tests/Feature/BundleTest.php @@ -13,7 +13,7 @@ class BundleTest extends TestCase { use RefreshDatabase; - public function test_handle_with_static_records() + public function testHandleWithStaticRecords(): void { $populator = Populator::make('manual'); $bundle = Bundle::make(TestUser::class) @@ -22,13 +22,14 @@ public function test_handle_with_static_records() 'name' => 'Foo', 'email' => 'foo@example.com', ]), - ]); + ]) + ; $bundle->handle($populator); $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); } - public function test_handle_with_filesystem_backed_records() + public function testHandleWithFilesystemBackedRecords(): void { $populator = Populator::make('initial'); (Bundle::make(TestUser::class))->handle($populator); @@ -38,7 +39,7 @@ public function test_handle_with_filesystem_backed_records() } - public function test_handle_with_filesystem_backed_records_throws_missing_directory_exception() + public function testHandleWithFilesystemBackedRecordsThrowsMissingDirectoryException(): void { $this->expectExceptionMessageMatches('/^A directory for the bundle of/'); $populator = Populator::make('initial_v2'); @@ -46,7 +47,7 @@ public function test_handle_with_filesystem_backed_records_throws_missing_direct $bundle->handle($populator); } - public function test_handle_only_runs_in_correct_environment() + public function testHandleOnlyRunsInCorrectEnvironment(): void { $this->assertEquals(0, TestUser::count()); $populator = Populator::make('test'); @@ -54,8 +55,25 @@ public function test_handle_only_runs_in_correct_environment() ->environments(['not-this-env']) ->record('user-foo', [ 'name' => 'Foo', - ]); + ]) + ; $bundle->handle($populator); $this->assertEquals(0, TestUser::count()); - } + } + + public function testHandleInsertUsingClosure(): void + { + $populator = Populator::make('initial'); + $bundle = Bundle::make(TestUser::class) + ->performInsertUsing(function (array $data, Bundle $bundle) { + $created = $bundle->model->newInstance()->forceFill($data); + $created->saveOrFail(); + + return $created->getKey(); + }) + ; + $bundle->handle($populator); + + $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); + } } diff --git a/tests/Feature/Concerns/HasEnvironmentTest.php b/tests/Feature/Concerns/HasEnvironmentTest.php index a0c7cf9..9d29f26 100644 --- a/tests/Feature/Concerns/HasEnvironmentTest.php +++ b/tests/Feature/Concerns/HasEnvironmentTest.php @@ -19,24 +19,24 @@ protected function setUp(): void }; } - public function test_environments_starts_empty() + public function testEnvironmentsStartsEmpty(): void { $this->assertEmpty($this->target->environments); } - public function test_environments_sets_environments() + public function testEnvironmentsSetsEnvironments(): void { $this->target->environments(['foo', 'bar']); $this->assertEquals(['foo', 'bar'], $this->target->environments); } - public function test_get_environments_returns_environments() + public function testGetEnvironmentsReturnsEnvironments(): void { $this->target->environments(['foo', 'bar']); $this->assertEquals($this->target->environments, $this->target->getEnvironments()); } - public function test_check_environment_checks_against_laravel_environment() + public function testCheckEnvironmentChecksAgainstLaravelEnvironment(): void { $this->target->environments(['foo', 'bar']); $this->assertFalse($this->target->checkEnvironment()); diff --git a/tests/Feature/Concerns/HasNameTest.php b/tests/Feature/Concerns/HasNameTest.php index a36e306..8bc8839 100644 --- a/tests/Feature/Concerns/HasNameTest.php +++ b/tests/Feature/Concerns/HasNameTest.php @@ -33,7 +33,8 @@ public function test_get_name_returns_name_if_set() public function test_get_name_class_with_namespace() { $this->target->name = null; - $this->assertEquals('app.-foo', //FIXME this doesn't seem to be the desired behavior + $this->assertEquals( + 'app.-foo', //FIXME this doesn't seem to be the desired behavior $this->target->getName('App\\Foo', true) ); } @@ -41,7 +42,8 @@ public function test_get_name_class_with_namespace() public function test_get_name_class_without_namespace() { $this->target->name = null; - $this->assertEquals('foo', + $this->assertEquals( + 'foo', $this->target->getName('App\\Foo', false) ); } @@ -49,7 +51,8 @@ public function test_get_name_class_without_namespace() public function test_get_name_without_class_calls_static_class_for_name() { $this->target->name = null; - $this->assertStringStartsWith('has-name-test.php', + $this->assertStringStartsWith( + 'has-name-test.php', $this->target->getName() ); } @@ -57,7 +60,8 @@ public function test_get_name_without_class_calls_static_class_for_name() public function test_get_name_removes_the_string_populator_from_class() { $this->target->name = null; - $this->assertEquals('foo', + $this->assertEquals( + 'foo', $this->target->getName('App\\FooPopulator', false) ); } diff --git a/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php b/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php index c923f22..71146ea 100644 --- a/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php +++ b/tests/Feature/Concerns/Pipe/DefaultsPipeTest.php @@ -3,21 +3,16 @@ namespace Tests\Feature\Concerns\Pipe; use Guava\LaravelPopulator\Bundle; -use Guava\LaravelPopulator\Concerns\Pipe\DefaultsPipe; use Guava\LaravelPopulator\Populator; use Guava\LaravelPopulator\Processor; use Illuminate\Support\Collection; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\UsesClass; use Tests\Fixtures\NullPipelineInvoker; use Tests\Fixtures\TestUser; use Tests\TestCase; -#[CoversClass(DefaultsPipe::class)] -#[UsesClass(Populator::class)] class DefaultsPipeTest extends TestCase { - public function test_defaults() + public function testDefaults(): void { $populator = Populator::make('initial') ->pipeableUsing((new NullPipelineInvoker())->usingPipes( @@ -31,7 +26,8 @@ function (Collection $collection) { ->bundles([ Bundle::make(TestUser::class) ->default('foo', 'bar'), - ]); + ]) + ; $populator->call(); } diff --git a/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php b/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php index 301ae81..ef11c8f 100644 --- a/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php +++ b/tests/Feature/Concerns/Pipe/GeneratorsPipeTest.php @@ -12,7 +12,7 @@ class GeneratorsPipeTest extends TestCase { - public function test_generators() + public function testGenerators(): void { $populator = Populator::make('initial') ->pipeableUsing((new NullPipelineInvoker())->usingPipes( @@ -26,7 +26,8 @@ function (Collection $collection) { ->bundles([ Bundle::make(TestUser::class) ->generate('foo', fn () => 'bar'), - ]); + ]) + ; $populator->call(); } diff --git a/tests/Feature/Concerns/Pipe/InsertPipeTest.php b/tests/Feature/Concerns/Pipe/InsertPipeTest.php index 11b14c0..2fd2206 100644 --- a/tests/Feature/Concerns/Pipe/InsertPipeTest.php +++ b/tests/Feature/Concerns/Pipe/InsertPipeTest.php @@ -3,15 +3,19 @@ namespace Tests\Feature\Concerns\Pipe; use Guava\LaravelPopulator\Bundle; +use Guava\LaravelPopulator\Contracts\InteractsWithBundleInsert; use Guava\LaravelPopulator\Populator; use Guava\LaravelPopulator\Processor; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\Fixtures\NullPipelineInvoker; use Tests\Fixtures\TestUser; use Tests\TestCase; class InsertPipeTest extends TestCase { - public function test_insert() + use RefreshDatabase; + + public function testInsert(): void { Populator::make('initial') ->pipeableUsing((new NullPipelineInvoker())->usingPipes( @@ -20,12 +24,36 @@ public function test_insert() ->bundles([ Bundle::make(TestUser::class), ]) - ->call(); + ->call() + ; + + $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); + } + + public function testInsertUsing(): void + { + Populator::make('initial') + ->pipeableUsing((new NullPipelineInvoker())->usingPipes( + fn (Processor $processor) => [$processor + ->performInsertUsing(new class implements InteractsWithBundleInsert + { + public function insertDataFromBundle(array $data, Bundle $bundle): int | string + { + return $bundle->model::unguarded(fn () => $bundle->model::create($data)->getKey()); + } + }) + ->insert(...)] + )) + ->bundles([ + Bundle::make(TestUser::class), + ]) + ->call() + ; $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); } - public function test_insert_non_incrementing_id() + public function testInsertNonIncrementingId(): void { Populator::make('initial') ->pipeableUsing((new NullPipelineInvoker())->usingPipes( @@ -34,7 +62,8 @@ public function test_insert_non_incrementing_id() ->bundles([ Bundle::make(TestUser::class), ]) - ->call(); + ->call() + ; $this->assertTrue(TestUser::whereEmail('foo@example.com')->exists()); } diff --git a/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php b/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php index 7d3f15a..13397c3 100644 --- a/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php +++ b/tests/Feature/Concerns/Pipe/MutatorsPipeTest.php @@ -12,7 +12,7 @@ class MutatorsPipeTest extends TestCase { - public function test_mutate() + public function testMutate(): void { $populator = Populator::make('initial') ->pipeableUsing((new NullPipelineInvoker())->usingPipes( @@ -26,7 +26,8 @@ function (Collection $collection) { ->bundles([ Bundle::make(TestUser::class) ->mutate('email', fn ($value) => strtoupper($value)), - ]); + ]) + ; $populator->call(); } diff --git a/tests/Feature/Concerns/Pipe/RelationsPipeTest.php b/tests/Feature/Concerns/Pipe/RelationsPipeTest.php index f975b04..8abb8a0 100644 --- a/tests/Feature/Concerns/Pipe/RelationsPipeTest.php +++ b/tests/Feature/Concerns/Pipe/RelationsPipeTest.php @@ -12,7 +12,7 @@ class RelationsPipeTest extends TestCase { - public function test_relations() + public function testRelations(): void { $populator = Populator::make('initial') @@ -31,12 +31,14 @@ function (Collection $collection) { Processor::class, [$bundle] ) - ->makePartial(); + ->makePartial() + ; return $processor ->shouldAllowMockingProtectedMethods() ->shouldReceive('getPrimaryId')->once()->andReturn(1) - ->getMock(); + ->getMock() + ; }) ->records([ 'post-one' => [ @@ -44,7 +46,8 @@ function (Collection $collection) { 'content' => 'test', ], ]), - ]); + ]) + ; $populator->call(); } diff --git a/tests/Feature/FeaturesTest.php b/tests/Feature/FeaturesTest.php new file mode 100644 index 0000000..2d1272e --- /dev/null +++ b/tests/Feature/FeaturesTest.php @@ -0,0 +1,72 @@ +features = new Features(); + } + + public function testHasTrackingFeature(): void + { + $this->features->enableTrackingFeature(); + $this->assertTrue($this->features->hasTrackingFeature()); + } + + public function testEnabled(): void + { + config(['populator.tracking' => true]); + $this->assertTrue($this->features->enabled('tracking')); + + config(['populator.tracking' => false]); + $this->assertFalse($this->features->enabled('tracking')); + + } + + public function testEnableTrackingFeature(): void + { + config(['populator.tracking' => false]); + $this->assertFalse($this->features->enabled('tracking')); + $this->features->enableTrackingFeature(); + $this->assertTrue($this->features->hasTrackingFeature()); + } + + public function testDisableTrackingFeature(): void + { + config(['populator.tracking' => true]); + $this->assertTrue($this->features->enabled('tracking')); + $this->features->disableTrackingFeature(); + $this->assertFalse($this->features->hasTrackingFeature()); + } + + public function testTracking(): void + { + $this->assertEquals('tracking', $this->features->tracking()); + } + + public function testHasCustomPopulationModel(): void + { + $this->assertFalse($this->features->hasCustomPopulationModel()); + + $this->features->customPopulationModel(TestPopulation::class); + $this->assertTrue($this->features->hasCustomPopulationModel()); + } + + public function testCustomPopulationModel(): void + { + $this->assertEquals(Population::class, $this->features->populationModelClass()); + $this->features->customPopulationModel(TestPopulation::class); + $this->assertTrue($this->features->hasCustomPopulationModel()); + $this->assertInstanceOf(TestPopulation::class, $this->features->makePopulationModel()); + } +} diff --git a/tests/Feature/Models/PopulationTest.php b/tests/Feature/Models/PopulationTest.php new file mode 100644 index 0000000..2d3982e --- /dev/null +++ b/tests/Feature/Models/PopulationTest.php @@ -0,0 +1,24 @@ +has(Population::factory(), 'population') + ->create() + ; + $this->assertInstanceOf(Population::class, $test->population); + } + + public function testGetMorphClass(): void + { + $this->assertEquals('population', (new Population)->getMorphClass()); + } +} diff --git a/tests/Feature/PipelineInvokerTest.php b/tests/Feature/PipelineInvokerTest.php index 1b9423e..73b8733 100644 --- a/tests/Feature/PipelineInvokerTest.php +++ b/tests/Feature/PipelineInvokerTest.php @@ -7,12 +7,15 @@ use Guava\LaravelPopulator\Populator; use Guava\LaravelPopulator\Processor; use Guava\LaravelPopulator\Support\Processors\InsertPipelineInvoker; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\Fixtures\TestUser; use Tests\TestCase; class PipelineInvokerTest extends TestCase { - public function test_ability_to_swap_pipeline() + use RefreshDatabase; + + public function testAbilityToSwapPipeline(): void { $this->app->bind(InteractsWithPipeline::class, fn () => (new InsertPipelineInvoker())->usingPipes( fn (Processor $processor) => [$processor->insert(...)] @@ -22,7 +25,8 @@ public function test_ability_to_swap_pipeline() ->bundles([ Bundle::make(TestUser::class), ]) - ->call(); + ->call() + ; $this->assertNotNull($user = TestUser::whereEmail('foo@example.com')->sole()); @@ -36,7 +40,8 @@ public function test_ability_to_swap_pipeline() ->bundles([ Bundle::make(TestUser::class), ]) - ->call(); + ->call() + ; $this->assertFalse(TestUser::whereEmail('foo@example.com')->exists()); } diff --git a/tests/Feature/PopulatorServiceProviderTest.php b/tests/Feature/PopulatorServiceProviderTest.php index f6287a2..93cbb06 100644 --- a/tests/Feature/PopulatorServiceProviderTest.php +++ b/tests/Feature/PopulatorServiceProviderTest.php @@ -6,22 +6,22 @@ class PopulatorServiceProviderTest extends TestCase { - public function test_publishes_config() + public function testPublishesConfig(): void { $this->artisan('vendor:publish', [ - '--provider' => 'Guava\LaravelPopulator\PopulatorServiceProvider' + '--provider' => 'Guava\LaravelPopulator\PopulatorServiceProvider', ]); $this->assertFileExists(config_path('populator.php')); $this->assertFileIsReadable(config_path('populator.php')); -// $this->assertFileEquals(config_path('larapoke.php'), __DIR__ . '/../../config/larapoke.php'); + // $this->assertFileEquals(config_path('larapoke.php'), __DIR__ . '/../../config/larapoke.php'); $this->assertTrue(unlink(config_path('populator.php'))); } - public function test_registers_commands() + public function testRegistersCommands(): void { $commands = \Artisan::all(); $this->assertArrayHasKey('make:populator', $commands); -// $this->assertArrayHasKey('make:sample', $commands); + // $this->assertArrayHasKey('make:sample', $commands); } -} \ No newline at end of file +} diff --git a/tests/Feature/PopulatorTest.php b/tests/Feature/PopulatorTest.php index cb2cf41..62ad5b7 100644 --- a/tests/Feature/PopulatorTest.php +++ b/tests/Feature/PopulatorTest.php @@ -3,13 +3,20 @@ namespace Tests\Feature; use Guava\LaravelPopulator\Bundle; +use Guava\LaravelPopulator\Exceptions\FeatureNotEnabledException; use Guava\LaravelPopulator\Populator; +use Guava\LaravelPopulator\Processor; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Str; +use Tests\Fixtures\TestPost; use Tests\Fixtures\TestUser; use Tests\TestCase; class PopulatorTest extends TestCase { - public function test_bundles_sets_bundles() + use RefreshDatabase; + + public function testBundlesSetsBundles(): void { $bundle = Bundle::make(TestUser::class); $this->assertEquals([$bundle], Populator::make('test') @@ -18,19 +25,84 @@ public function test_bundles_sets_bundles() ])->bundles); } - public function test_only_handles_in_current_environment() + public function testOnlyHandlesInCurrentEnvironment(): void { $bundle = $this->spy(Bundle::class); Populator::make('test') ->bundles([$bundle]) - ->call(); + ->call() + ; $bundle->shouldHaveReceived('handle'); $bundle = $this->spy(Bundle::class); Populator::make('test') ->environments(['local']) ->bundles([$bundle]) - ->call(); + ->call() + ; $bundle->shouldNotHaveReceived('handle'); } + + public function testRollbackWithEmptyBundles(): void + { + + Processor::enableTracking(); + $this->assertTrue(Processor::hasTrackingFeature()); + $populator = Populator::make('initial') + ->bundles([ + Bundle::make(TestUser::class), + Bundle::make(TestPost::class) + ->generate('id', fn () => Str::uuid()), + ]) + ; + $populator->call(); + $this->assertDatabaseCount(TestUser::class, 1); + $this->assertDatabaseCount(TestPost::class, 1); + Populator::make('initial')->rollback(); + $this->assertDatabaseCount(TestUser::class, 0); + $this->assertDatabaseCount(TestPost::class, 0); + } + + public function testRollbackRemovesBundleEntries(): void + { + Processor::enableTracking(); + $this->assertTrue(Processor::hasTrackingFeature()); + $populator = Populator::make('initial') + ->bundles([ + Bundle::make(TestUser::class), + Bundle::make(TestPost::class) + ->generate('id', fn () => Str::uuid()), + ]) + ; + $populator->call(); + $this->assertDatabaseCount(TestUser::class, 1); + $this->assertDatabaseCount(TestPost::class, 1); + + $populator->rollback(); + + $this->assertDatabaseCount(TestUser::class, 0); + $this->assertDatabaseCount(TestPost::class, 0); + + $populator->call(); + + $this->assertDatabaseCount(TestUser::class, 1); + $this->assertDatabaseCount(TestPost::class, 1); + + Populator::make('initial') + ->bundles([Bundle::make(TestPost::class)]) + ->rollback() + ; + + $this->assertDatabaseCount(TestUser::class, 1); + $this->assertDatabaseCount(TestPost::class, 0); + + } + + public function testRollbackThrowsIfTrackingDisabled(): void + { + Processor::disableTracking(); + $this->expectException(FeatureNotEnabledException::class); + Populator::make('initial') + ->rollback(); + } } diff --git a/tests/Feature/ProcessorTest.php b/tests/Feature/ProcessorTest.php index b86f3cb..d70cf5f 100644 --- a/tests/Feature/ProcessorTest.php +++ b/tests/Feature/ProcessorTest.php @@ -4,6 +4,7 @@ use Guava\LaravelPopulator\Bundle; use Guava\LaravelPopulator\Exceptions\InvalidBundleException; +use Guava\LaravelPopulator\Models\Population; use Guava\LaravelPopulator\Populator; use Guava\LaravelPopulator\Processor; use Illuminate\Foundation\Testing\RefreshDatabase; @@ -21,7 +22,7 @@ class ProcessorTest extends TestCase { use RefreshDatabase; - public function test_resolves_primary_ids() + public function testResolvesPrimaryIds(): void { Populator::make('test') ->bundles([ @@ -33,46 +34,48 @@ public function test_resolves_primary_ids() 'password' => 'password', 'phone' => [ 'phone' => '5555555555', - ] + ], ]), Bundle::make(TestPost::class) - ->generate('id', fn() => Str::uuid()) + ->generate('id', fn () => Str::uuid()) ->records([ - 'post-one'=> [ + 'post-one' => [ 'user' => 1, 'content' => 'test one', ], - 'post-two'=> [ + 'post-two' => [ 'user' => 'email:foo@example.com', 'content' => 'test two', ], ]), ]) - ->call(); + ->call() + ; $this->assertEquals(2, TestUser::sole()->withCount('posts')->sole()->posts_count); } - public function test_has_one_relation() + public function testHasOneRelation(): void { $this->assertEquals(0, TestPhone::count()); Populator::make('test') ->bundles([ Bundle::make(TestUser::class) - ->record('user-test', [ - 'email' => 'foo@example.com', - 'name' => 'foo', - 'password' => 'password', - 'phone' => [ - 'phone' => '5555555555', - ] - ]) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'phone' => [ + 'phone' => '5555555555', + ], + ]), ]) - ->call(); + ->call() + ; $this->assertEquals(1, TestPhone::count()); } - public function test_has_one_relation_throws_on_invalid_relationship() + public function testHasOneRelationThrowsOnInvalidRelationship(): void { $this->expectException(InvalidBundleException::class); $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); @@ -82,13 +85,14 @@ public function test_has_one_relation_throws_on_invalid_relationship() ->record('user-test', [ 'user' => 'invalid', 'phone' => '5555555555', - ]) + ]), ]) - ->call(); + ->call() + ; } - public function test_has_many_relation() + public function testHasManyRelation(): void { $this->assertEquals(0, TestPost::count()); Populator::make('test') @@ -103,22 +107,23 @@ public function test_has_many_relation() 'id' => '1a4d5b58-8ee4-4adc-9628-98dcc5691b63', 'content' => 'foobar', ], - ] - ]) + ], + ]), ]) - ->call(); + ->call() + ; $this->assertEquals(1, TestPost::count()); } - public function test_belongs_to_many_relation() + public function testBelongsToManyRelation(): void { Populator::make('test') ->bundles([ Bundle::make(TestRole::class) - ->record('role-users', [ - 'name' => 'users', - ]), + ->record('role-users', [ + 'name' => 'users', + ]), Bundle::make(TestUser::class) ->record('user-test', [ 'email' => 'foo@example.com', @@ -126,18 +131,21 @@ public function test_belongs_to_many_relation() 'password' => 'password', 'roles' => [ 'role-users', - ] - ]) + ], + ]), ]) - ->call(); + ->call() + ; - $this->assertEquals(1, + $this->assertEquals( + 1, TestUser::whereEmail('foo@example.com') ->withCount('roles')->sole()->roles_count, ); } - public function test_belongs_to_many_relation_throws_on_invalid_relationship(){ + public function testBelongsToManyRelationThrowsOnInvalidRelationship(): void + { $this->expectException(InvalidBundleException::class); $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); @@ -155,14 +163,15 @@ public function test_belongs_to_many_relation_throws_on_invalid_relationship(){ 'password' => 'password', 'roles' => [ 'role-users-invalid', - ] - ]) + ], + ]), ]) - ->call(); + ->call() + ; } - public function test_morphs_one_relation() + public function testMorphsOneRelation(): void { $this->assertEquals(0, TestImage::count()); Populator::make('test') @@ -174,15 +183,17 @@ public function test_morphs_one_relation() 'password' => 'password', 'image' => [ 'url' => 'localhost/image.png', - ] - ]) + ], + ]), ]) - ->call(); + ->call() + ; $this->assertEquals(1, TestImage::count()); } - public function test_morphs_one_relation_throws_on_invalid_relationship(){ + public function testMorphsOneRelationThrowsOnInvalidRelationship(): void + { $this->expectException(InvalidBundleException::class); $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); Populator::make('test') @@ -191,12 +202,13 @@ public function test_morphs_one_relation_throws_on_invalid_relationship(){ ->record('invalid-test', [ 'url' => 'localhost/image.png', 'imageable' => ['invalid-test', TestUser::class], - ]) + ]), ]) - ->call(); + ->call() + ; } - public function test_morphs_many_relation() + public function testMorphsManyRelation(): void { Populator::make('test') ->bundles([ @@ -207,22 +219,24 @@ public function test_morphs_many_relation() 'password' => 'password', ]), Bundle::make(TestPost::class) - ->generate('id', fn() => Str::uuid()) + ->generate('id', fn () => Str::uuid()) ->record('post-test', [ 'user' => 'user-test', 'content' => 'foobar', 'comments' => [ - ['body' => 'comment body'] - ] - ]) + ['body' => 'comment body'], + ], + ]), ]) - ->call(); + ->call() + ; $this->assertEquals(1, TestPost::withCount('comments')->sole()->comments_count); } - public function test_morphs_many_relation_throws_on_invalid_relationship() { + public function testMorphsManyRelationThrowsOnInvalidRelationship(): void + { $this->expectException(InvalidBundleException::class); $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); Populator::make('test') @@ -231,12 +245,14 @@ public function test_morphs_many_relation_throws_on_invalid_relationship() { ->record('invalid-test', [ 'body' => 'comment body', 'commentable' => ['invalid-test', TestPost::class], - ]) + ]), ]) - ->call(); + ->call() + ; } - public function test_morphs_to_many_relation_throws_on_invalid_relationship() { + public function testMorphsToManyRelationThrowsOnInvalidRelationship(): void + { $this->expectException(InvalidBundleException::class); $this->expectExceptionMessageMatches('/has an invalid .*? relation set/'); @@ -249,24 +265,25 @@ public function test_morphs_to_many_relation_throws_on_invalid_relationship() { 'password' => 'password', ]), Bundle::make(TestPost::class) - ->generate('id', fn() => Str::uuid()) + ->generate('id', fn () => Str::uuid()) ->record('post-test', [ 'user' => 'user-test', 'content' => 'foobar', 'tags' => ['invalid-tag'], - ]) + ]), ]) - ->call(); + ->call() + ; } - public function test_morphs_to_many_relation() + public function testMorphsToManyRelation(): void { Populator::make('test') ->bundles([ Bundle::make(TestTag::class) - ->record('tag-test', [ - 'name' => 'test', - ]), + ->record('tag-test', [ + 'name' => 'test', + ]), Bundle::make(TestUser::class) ->record('user-test', [ 'email' => 'foo@example.com', @@ -274,22 +291,24 @@ public function test_morphs_to_many_relation() 'password' => 'password', ]), Bundle::make(TestPost::class) - ->generate('id', fn() => Str::uuid()) + ->generate('id', fn () => Str::uuid()) ->record('post-test', [ 'user' => 'user-test', 'content' => 'foobar', 'tags' => ['tag-test'], - ]) + ]), ]) - ->call(); + ->call() + ; - $this->assertEquals(1, + $this->assertEquals( + 1, TestPost::withCount('tags')->sole()->tags_count ); } - public function test_throws_for_invalid_relationship() + public function testThrowsForInvalidRelationship(): void { $this->expectException(InvalidBundleException::class); $this->expectExceptionMessage('The relation type of faux is not supported yet'); @@ -300,6 +319,84 @@ public function test_throws_for_invalid_relationship() 'name' => 'test', 'faux' => '', ]), - ])->call(); + ])->call() + ; + } + + public function testTracksPopulation(): void + { + Processor::enableTracking(); + $this->assertEquals(0, Population::count()); + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'phone' => [ + 'phone' => '5555555555', + ], + ]), + ]) + ->call() + ; + + $this->assertEquals(1, Population::count()); + } + + public function testHasPopulationTraitCanAccessPopulationRelationship(): void + { + Processor::enableTracking(); + Populator::make('test') + ->bundles([ + Bundle::make(TestUser::class) + ->record('user-test', [ + 'email' => 'foo@example.com', + 'name' => 'foo', + 'password' => 'password', + 'phone' => [ + 'phone' => '5555555555', + ], + ]), + ]) + ->call() + ; + + $user = TestUser::with('population')->sole(); + $this->assertEquals('test', $user->population->populator); + $this->assertEquals('user-test', $user->population->key); + } + + public function testDisableTracking(): void + { + config(['populator.tracking' => true]); + $this->assertTrue(Processor::hasTrackingFeature()); + Processor::disableTracking(); + $this->assertFalse(Processor::hasTrackingFeature()); + } + + public function testDisabledTracking(): void + { + config(['populator.tracking' => true]); + $this->assertTrue(Processor::hasTrackingFeature()); + Processor::disabledTracking(fn () => $this->assertFalse(Processor::hasTrackingFeature())); + $this->assertTrue(Processor::hasTrackingFeature()); + } + + public function testEnabledTracking(): void + { + config(['populator.tracking' => false]); + $this->assertFalse(Processor::hasTrackingFeature()); + Processor::enabledTracking(fn () => $this->assertTrue(Processor::hasTrackingFeature())); + $this->assertFalse(Processor::hasTrackingFeature()); + } + + public function testEnableTracking(): void + { + config(['populator.tracking' => false]); + $this->assertFalse(Processor::hasTrackingFeature()); + Processor::enableTracking(); + $this->assertTrue(Processor::hasTrackingFeature()); } -} \ No newline at end of file +} diff --git a/tests/Fixtures/FakeBelongsTo.php b/tests/Fixtures/FakeBelongsTo.php index 54eba36..19b819f 100644 --- a/tests/Fixtures/FakeBelongsTo.php +++ b/tests/Fixtures/FakeBelongsTo.php @@ -7,7 +7,6 @@ class FakeBelongsTo extends Relation { - public function addConstraints() { // TODO: Implement addConstraints() method. @@ -32,4 +31,4 @@ public function getResults() { // TODO: Implement getResults() method. } -} \ No newline at end of file +} diff --git a/tests/Fixtures/TestComment.php b/tests/Fixtures/TestComment.php index 9dc6d3e..fe45a36 100644 --- a/tests/Fixtures/TestComment.php +++ b/tests/Fixtures/TestComment.php @@ -3,7 +3,6 @@ namespace Tests\Fixtures; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; class TestComment extends Model @@ -16,4 +15,4 @@ public function commentable(): MorphTo { return $this->morphTo(); } -} \ No newline at end of file +} diff --git a/tests/Fixtures/TestImage.php b/tests/Fixtures/TestImage.php index 97b225e..1ac39c3 100644 --- a/tests/Fixtures/TestImage.php +++ b/tests/Fixtures/TestImage.php @@ -3,7 +3,6 @@ namespace Tests\Fixtures; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; class TestImage extends Model @@ -16,4 +15,4 @@ public function imageable(): MorphTo { return $this->morphTo(); } -} \ No newline at end of file +} diff --git a/tests/Fixtures/TestPhone.php b/tests/Fixtures/TestPhone.php index 6ca3a74..0e9e119 100644 --- a/tests/Fixtures/TestPhone.php +++ b/tests/Fixtures/TestPhone.php @@ -16,6 +16,6 @@ class TestPhone extends Model */ public function user(): BelongsTo { - return $this->belongsTo(TestUser::class,'user_id'); + return $this->belongsTo(TestUser::class, 'user_id'); } -} \ No newline at end of file +} diff --git a/tests/Fixtures/TestPopulation.php b/tests/Fixtures/TestPopulation.php new file mode 100644 index 0000000..2977d79 --- /dev/null +++ b/tests/Fixtures/TestPopulation.php @@ -0,0 +1,7 @@ +uuid('id')->primary(); $table->timestamps(); - $table->foreignId('user_id') - ->constrained('users') + $table->foreignIdFor(TestUser::class, 'user_id') + ->constrained() ->cascadeOnDelete() - ->cascadeOnUpdate(); + ->cascadeOnUpdate() + ; $table->text('content'); }); } diff --git a/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php b/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php index 42359dd..44a7f2a 100644 --- a/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php +++ b/tests/Fixtures/database/2024_06_22_000003_create_comments_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('comments', function (Blueprint $table) { diff --git a/tests/Fixtures/database/2024_06_22_000003_create_images_table.php b/tests/Fixtures/database/2024_06_22_000003_create_images_table.php index f6d7882..2ffc809 100644 --- a/tests/Fixtures/database/2024_06_22_000003_create_images_table.php +++ b/tests/Fixtures/database/2024_06_22_000003_create_images_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('images', function (Blueprint $table) { diff --git a/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php b/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php index fe459a2..34ae937 100644 --- a/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php +++ b/tests/Fixtures/database/2024_06_22_000003_create_role_user_table.php @@ -4,16 +4,19 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('role_user', function (Blueprint $table) { $table->foreignId('role_id') ->constrained('roles') - ->cascadeOnDelete(); + ->cascadeOnDelete() + ; $table->foreignId('user_id') ->constrained('users') - ->cascadeOnDelete(); + ->cascadeOnDelete() + ; }); } diff --git a/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php b/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php index cef316c..1230f17 100644 --- a/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php +++ b/tests/Fixtures/database/2024_06_22_000003_create_roles_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('roles', function (Blueprint $table) { diff --git a/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php b/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php index 16e00ad..cf28a87 100644 --- a/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php +++ b/tests/Fixtures/database/2024_06_22_000003_create_tags_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('tags', function (Blueprint $table) { diff --git a/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php b/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php index a9818e7..2edfe4b 100644 --- a/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php +++ b/tests/Fixtures/database/2024_06_22_000004_create_taggables_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('taggables', function (Blueprint $table) { diff --git a/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php b/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php index 08435ac..b776481 100644 --- a/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php +++ b/tests/Fixtures/database/2024_06_22_000005_create_phones_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('phones', function (Blueprint $table) { @@ -12,7 +13,8 @@ public function up(): void $table->timestamps(); $table->foreignId('user_id') ->constrained('users') - ->cascadeOnDelete(); + ->cascadeOnDelete() + ; $table->string('phone'); }); diff --git a/database/factories/TestPostFactory.php b/tests/Fixtures/database/factories/TestPostFactory.php similarity index 83% rename from database/factories/TestPostFactory.php rename to tests/Fixtures/database/factories/TestPostFactory.php index 924c956..d019b38 100644 --- a/database/factories/TestPostFactory.php +++ b/tests/Fixtures/database/factories/TestPostFactory.php @@ -1,11 +1,14 @@ + */ class TestPostFactory extends Factory { protected $model = TestPost::class; @@ -17,4 +20,4 @@ public function definition(): array 'content' => $this->faker->paragraph(), ]; } -} \ No newline at end of file +} diff --git a/database/factories/TestUserFactory.php b/tests/Fixtures/database/factories/TestUserFactory.php similarity index 75% rename from database/factories/TestUserFactory.php rename to tests/Fixtures/database/factories/TestUserFactory.php index 4dc6690..2077abb 100644 --- a/database/factories/TestUserFactory.php +++ b/tests/Fixtures/database/factories/TestUserFactory.php @@ -1,12 +1,15 @@ + */ class TestUserFactory extends Factory { protected $model = TestUser::class; @@ -14,12 +17,12 @@ class TestUserFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name(), - 'email' => $this->faker->safeEmail(), + 'name' => fake()->name(), + 'email' => fake()->safeEmail(), 'password' => Hash::make('password'), 'email_verified_at' => now(), 'remember_token' => Str::random(10), 'is_admin' => true, ]; } -} \ No newline at end of file +} diff --git a/tests/Fixtures/database/migrations/2024_06_22_000001_create_populations.php b/tests/Fixtures/database/migrations/2024_06_22_000001_create_populations.php new file mode 100644 index 0000000..e78582e --- /dev/null +++ b/tests/Fixtures/database/migrations/2024_06_22_000001_create_populations.php @@ -0,0 +1,28 @@ +id(); + $table->timestamps(); + $table->string('populator'); + $table->string('bundle'); + $table->string('key'); + $table->morphs('populatable'); + // $table->unique(['populatable_type', 'populatable_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('populations'); + } +}; diff --git a/tests/TestCase.php b/tests/TestCase.php index 761fa3d..088357f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -21,8 +21,21 @@ protected function setUp(): void Factory::guessFactoryNamesUsing( fn ( string $modelName, - ) => 'Guava\\LaravelPopulator\\Database\\Factories\\'.class_basename($modelName).'Factory' + ) => 'Tests\\Database\\Factories\\'.class_basename($modelName).'Factory' ); + + copy(__DIR__.'/../config/config.php', config_path('populator.php')); + // copy(__DIR__.'/../database/migrations', database_path()); + + } + + #[\Override] + protected function tearDown(): void + { + parent::tearDown(); + if (file_exists($path = config_path('populator.php'))) { + unlink($path); + } } protected function getPackageProviders($app) @@ -35,6 +48,7 @@ protected function getPackageProviders($app) protected function defineDatabaseMigrations(): void { $this->loadMigrationsFrom(__DIR__.'/Fixtures/database'); + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); } public function defineEnvironment($app): void diff --git a/tests/Unit/HasDefaultsTest.php b/tests/Unit/HasDefaultsTest.php index 819f7bf..8892ed3 100644 --- a/tests/Unit/HasDefaultsTest.php +++ b/tests/Unit/HasDefaultsTest.php @@ -17,12 +17,12 @@ protected function setUp(): void }; } - public function test_defaults_starts_empty() + public function testDefaultsStartsEmpty(): void { $this->assertEmpty($this->target->defaults); } - public function test_default() + public function testDefault(): void { $this->target->default('foo', 'bar'); $this->assertArrayHasKey('foo', $this->target->defaults); diff --git a/tests/Unit/HasGeneratorsTest.php b/tests/Unit/HasGeneratorsTest.php index 5152c99..70a4825 100644 --- a/tests/Unit/HasGeneratorsTest.php +++ b/tests/Unit/HasGeneratorsTest.php @@ -17,12 +17,12 @@ protected function setUp(): void }; } - public function test_generators_starts_empty() + public function testGeneratorsStartsEmpty(): void { $this->assertEmpty($this->target->generators); } - public function test_generate() + public function testGenerate(): void { $this->target->generate('foo', fn () => 'bar'); $this->assertIsCallable($this->target->generators['foo']); diff --git a/tests/Unit/HasMutatorsTest.php b/tests/Unit/HasMutatorsTest.php index 28edfc9..821bb56 100644 --- a/tests/Unit/HasMutatorsTest.php +++ b/tests/Unit/HasMutatorsTest.php @@ -17,12 +17,12 @@ protected function setUp(): void }; } - public function test_mutate_starts_empty() + public function testMutateStartsEmpty(): void { $this->assertEmpty($this->target->mutators); } - public function test_mutate() + public function testMutate(): void { $this->target->mutate('foo', fn () => 'bar'); $this->assertArrayHasKey('foo', $this->target->mutators); diff --git a/tests/Unit/HasRecordsTest.php b/tests/Unit/HasRecordsTest.php index 8ca35af..e3af322 100644 --- a/tests/Unit/HasRecordsTest.php +++ b/tests/Unit/HasRecordsTest.php @@ -17,12 +17,12 @@ protected function setUp(): void }; } - public function test_records_starts_empty() + public function testRecordsStartsEmpty(): void { $this->assertEmpty($this->target->records); } - public function test_record() + public function testRecord(): void { $this->target->record('foo', fn () => [ 'baz' => 'bee', @@ -33,7 +33,7 @@ public function test_record() $this->assertEquals(['foo' => ['baz' => 'bee'], 'bar' => ['baz' => 'bee']], $this->target->records); } - public function test_records_callable() + public function testRecordsCallable(): void { $this->target->records(fn () => [ 'foo' => ['baz' => 'bee'], @@ -42,7 +42,7 @@ public function test_records_callable() $this->assertEquals(['foo' => ['baz' => 'bee'], 'bar' => ['baz' => 'bee']], $this->target->records); } - public function test_records_array() + public function testRecordsArray(): void { $this->target->records([ 'foo' => ['baz' => 'bee'], diff --git a/tests/Unit/MemoryTest.php b/tests/Unit/MemoryTest.php index 544c651..ed20841 100644 --- a/tests/Unit/MemoryTest.php +++ b/tests/Unit/MemoryTest.php @@ -14,19 +14,19 @@ protected function setUp(): void $this->storage = new Memory(); } - public function test_all_starts_empty() + public function testAllStartsEmpty(): void { $this->assertEmpty($this->storage->all()); } - public function test_get_value() + public function testGetValue(): void { $this->assertNull($this->storage->get('foo', 'bar')); $this->storage->set('foo', 'bar', 'baz'); $this->assertEquals('baz', $this->storage->get('foo', 'bar')); } - public function test_has_value() + public function testHasValue(): void { $this->assertFalse($this->storage->has('foo', 'bar')); $this->storage->set('foo', 'bar', 'baz'); From 16b90b2dfed2b332ccc55dde4833236fd3083dc6 Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Thu, 27 Jun 2024 11:26:33 -0400 Subject: [PATCH 09/10] remove pest files --- tests/Pest.php | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 tests/Pest.php diff --git a/tests/Pest.php b/tests/Pest.php deleted file mode 100644 index 015be07..0000000 --- a/tests/Pest.php +++ /dev/null @@ -1,39 +0,0 @@ -in('Feature'); - -/* -|-------------------------------------------------------------------------- -| Expectations -|-------------------------------------------------------------------------- -| -| When you're writing tests, you often need to check that values meet certain conditions. The -| "expect()" function gives you access to a set of "expectations" methods that you can use -| to assert different things. Of course, you may extend the Expectation API at any time. -| -*/ - -/* -|-------------------------------------------------------------------------- -| Functions -|-------------------------------------------------------------------------- -| -| While Pest is very powerful out-of-the-box, you may have some testing code specific to your -| project that you don't want to repeat in every file. Here you can also expose helpers as -| global functions to help you to reduce the number of lines of code in your test files. -| -*/ From 207b301d93a58f870b07a1eafd15b515893e3cd6 Mon Sep 17 00:00:00 2001 From: Travis Sheldon Date: Tue, 2 Jul 2024 16:23:41 -0400 Subject: [PATCH 10/10] removed php 8.3 only feature for readonly anonymous class --- src/Concerns/Pipe/InsertPipe.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Concerns/Pipe/InsertPipe.php b/src/Concerns/Pipe/InsertPipe.php index 2890ef3..7838cc7 100644 --- a/src/Concerns/Pipe/InsertPipe.php +++ b/src/Concerns/Pipe/InsertPipe.php @@ -16,7 +16,7 @@ trait InsertPipe /** * Inserts the model into the database. * - * @param Collection $data + * @param Collection $data * @return Collection * * @throws InvalidBundleException @@ -31,19 +31,18 @@ public function insert(Collection $data): Collection } /** - * @param array $data + * @param array $data */ - public function insertBundle(array $data, Bundle $bundle): int | string + public function insertBundle(array $data, Bundle $bundle): int|string { if ($this->performInsertUsing) { return $this->performInsertUsing->insertDataFromBundle($data, $bundle); } $id = DB::table($bundle->table) - ->insertGetId($data) - ; + ->insertGetId($data); // Get the ID if it's not auto incrementing - if (! $bundle->model->getIncrementing()) { + if (!$bundle->model->getIncrementing()) { return data_get($data, $bundle->model->getKeyName()); } @@ -51,24 +50,25 @@ public function insertBundle(array $data, Bundle $bundle): int | string } /** - * @param Closure(array,Bundle):(int|string)|InteractsWithBundleInsert|null $withBundleInsert + * @param Closure(array,Bundle):(int|string)|InteractsWithBundleInsert|null $withBundleInsert * @return $this */ - public function performInsertUsing(null | Closure | InteractsWithBundleInsert $withBundleInsert): static + public function performInsertUsing(null|Closure|InteractsWithBundleInsert $withBundleInsert): static { if ($withBundleInsert) { $this->performInsertUsing = $withBundleInsert instanceof InteractsWithBundleInsert ? $withBundleInsert : - new readonly class($withBundleInsert) implements InteractsWithBundleInsert - { + new class($withBundleInsert) implements InteractsWithBundleInsert { public function __construct( - protected Closure $insert - ) {} + readonly protected Closure $insert + ) + { + } /** - * @param array $data + * @param array $data */ - public function insertDataFromBundle(array $data, Bundle $bundle): int | string + public function insertDataFromBundle(array $data, Bundle $bundle): int|string { return forward_static_call($this->insert, $data, $bundle); }