From 64a9bfef892fc4e9b37d28c87050d6dd91c88825 Mon Sep 17 00:00:00 2001 From: lotyp Date: Sat, 24 Feb 2024 23:49:27 +0200 Subject: [PATCH 1/5] deps: update composer --- composer.json | 35 +++--- composer.lock | 339 +++++++++++++++++++++++++------------------------- 2 files changed, 188 insertions(+), 186 deletions(-) diff --git a/composer.json b/composer.json index 958f4ac9..24eb49f1 100644 --- a/composer.json +++ b/composer.json @@ -17,29 +17,29 @@ "require": { "php": "^8.2", "ext-pdo": "*", - "cycle/annotated": "^3.4", - "cycle/database": "^2.4", - "cycle/entity-behavior": "^1.2", - "cycle/migrations": "^4.0", - "cycle/orm": "^2.3", - "cycle/schema-migrations-generator": "^2.1", + "cycle/annotated": "^3.5", + "cycle/database": "^2.8", + "cycle/entity-behavior": "^1.3", + "cycle/migrations": "^4.2", + "cycle/orm": "^2.7", + "cycle/schema-migrations-generator": "^2.2", "cycle/schema-renderer": "^1.2", - "illuminate/console": "^10.39", - "illuminate/contracts": "^10.39", - "illuminate/support": "^10.39", - "laminas/laminas-hydrator": "^4.14", + "illuminate/console": "^10.45", + "illuminate/contracts": "^10.45", + "illuminate/support": "^10.45", + "laminas/laminas-hydrator": "^4.15", "spiral/attributes": "^3.1", "symfony/console": "^6.4" }, "require-dev": { - "ergebnis/composer-normalize": "^2.30", - "fakerphp/faker": "^1.21", + "ergebnis/composer-normalize": "^2.42", + "fakerphp/faker": "^1.23", "jetbrains/phpstorm-attributes": "^1.0", "nunomaduro/collision": "^7.10", - "nunomaduro/larastan": "^2.5", - "orchestra/testbench": "^8.5", - "pestphp/pest": "^2.5", - "pestphp/pest-plugin-laravel": "^2.0", + "larastan/larastan": "^2.9", + "orchestra/testbench": "^8.21", + "pestphp/pest": "^2.34", + "pestphp/pest-plugin-laravel": "^2.3", "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10", "phpstan/phpstan-deprecation-rules": "^1.1", @@ -47,8 +47,7 @@ "phpstan/phpstan-strict-rules": "^1.5", "phpunit/phpunit": "^10.5", "roave/security-advisories": "dev-latest", - "spatie/laravel-ray": "^1.32", - "wayofdev/cs-fixer-config": "^1.1", + "wayofdev/cs-fixer-config": "^1.2", "beberlei/assert": "^3.3" }, "autoload": { diff --git a/composer.lock b/composer.lock index aca5ea01..c42ed96b 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": "8a9245569ffd22b35ee1eba7caf3a2ed", + "content-hash": "71d5e3144c338493a349c14942e02c29", "packages": [ { "name": "brick/math", @@ -1464,16 +1464,16 @@ }, { "name": "laravel/framework", - "version": "v10.44.0", + "version": "v10.45.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "1199dbe361787bbe9648131a79f53921b4148cf6" + "reference": "dcf5d1d722b84ad38a5e053289130b6962f830bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/1199dbe361787bbe9648131a79f53921b4148cf6", - "reference": "1199dbe361787bbe9648131a79f53921b4148cf6", + "url": "https://api.github.com/repos/laravel/framework/zipball/dcf5d1d722b84ad38a5e053289130b6962f830bd", + "reference": "dcf5d1d722b84ad38a5e053289130b6962f830bd", "shasum": "" }, "require": { @@ -1666,7 +1666,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-02-13T16:01:16+00:00" + "time": "2024-02-21T14:07:36+00:00" }, { "name": "laravel/prompts", @@ -6423,16 +6423,16 @@ }, { "name": "brianium/paratest", - "version": "v7.4.1", + "version": "v7.4.3", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "b2830e330011d59a799c0002e118f5b4bbdb9604" + "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/b2830e330011d59a799c0002e118f5b4bbdb9604", - "reference": "b2830e330011d59a799c0002e118f5b4bbdb9604", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", + "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", "shasum": "" }, "require": { @@ -6440,13 +6440,13 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^1.0.0", + "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.2", + "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" @@ -6455,11 +6455,11 @@ "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^1.10.57", + "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.8.1", + "squizlabs/php_codesniffer": "^3.9.0", "symfony/filesystem": "^6.4.3 || ^7.0.3" }, "bin": [ @@ -6501,7 +6501,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.4.1" + "source": "https://github.com/paratestphp/paratest/tree/v7.4.3" }, "funding": [ { @@ -6513,7 +6513,7 @@ "type": "paypal" } ], - "time": "2024-02-06T13:50:28+00:00" + "time": "2024-02-20T07:24:02+00:00" }, { "name": "composer/pcre", @@ -7386,16 +7386,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.49.0", + "version": "v3.50.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "8742f7aa6f72a399688b65e4f58992c2d4681fc2" + "reference": "dbea11dcb6d9a1f6c8d51c0e580ab4a8876f524c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8742f7aa6f72a399688b65e4f58992c2d4681fc2", - "reference": "8742f7aa6f72a399688b65e4f58992c2d4681fc2", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/dbea11dcb6d9a1f6c8d51c0e580ab4a8876f524c", + "reference": "dbea11dcb6d9a1f6c8d51c0e580ab4a8876f524c", "shasum": "" }, "require": { @@ -7405,7 +7405,7 @@ "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", @@ -7426,7 +7426,8 @@ "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { @@ -7465,7 +7466,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.49.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.50.0" }, "funding": [ { @@ -7473,7 +7474,7 @@ "type": "github" } ], - "time": "2024-02-02T00:41:40+00:00" + "time": "2024-02-23T23:17:45+00:00" }, { "name": "guzzlehttp/psr7", @@ -7813,6 +7814,107 @@ }, "time": "2023-09-26T02:20:38+00:00" }, + { + "name": "larastan/larastan", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/larastan/larastan.git", + "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/larastan/larastan/zipball/35fa9cbe1895e76215bbe74571a344f2705fbe01", + "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01", + "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.8.2", + "phpstan/phpstan": "^1.10.50" + }, + "require-dev": { + "nikic/php-parser": "^4.17.1", + "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.0", + "orchestra/testbench": "^7.33.0 || ^8.13.0 || ^9.0.0", + "phpunit/phpunit": "^9.6.13 || ^10.5" + }, + "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.0" + }, + "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-02-13T11:49:22+00:00" + }, { "name": "laravel/tinker", "version": "v2.9.0", @@ -8083,16 +8185,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2218c2252c874a4624ab2f613d86ac32d227bc69", + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69", "shasum": "" }, "require": { @@ -8135,9 +8237,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.1" }, - "time": "2024-01-07T17:17:35+00:00" + "time": "2024-02-21T19:24:10+00:00" }, { "name": "nunomaduro/collision", @@ -8235,108 +8337,6 @@ ], "time": "2023-10-11T15:45:01+00:00" }, - { - "name": "nunomaduro/larastan", - "version": "v2.9.0", - "source": { - "type": "git", - "url": "https://github.com/larastan/larastan.git", - "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/35fa9cbe1895e76215bbe74571a344f2705fbe01", - "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01", - "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.8.2", - "phpstan/phpstan": "^1.10.50" - }, - "require-dev": { - "nikic/php-parser": "^4.17.1", - "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.0", - "orchestra/testbench": "^7.33.0 || ^8.13.0 || ^9.0.0", - "phpunit/phpunit": "^9.6.13 || ^10.5" - }, - "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.0" - }, - "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" - } - ], - "abandoned": "larastan/larastan", - "time": "2024-02-13T11:49:22+00:00" - }, { "name": "orchestra/canvas", "version": "v8.11.7", @@ -8541,16 +8541,16 @@ }, { "name": "orchestra/testbench-core", - "version": "v8.21.1", + "version": "v8.22.1", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "c6bf49a1b7ef4afe58e5bda676158c4de41f9a81" + "reference": "b0006c092694828f4b0fa409a369b798e5e26f8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/c6bf49a1b7ef4afe58e5bda676158c4de41f9a81", - "reference": "c6bf49a1b7ef4afe58e5bda676158c4de41f9a81", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/b0006c092694828f4b0fa409a369b798e5e26f8d", + "reference": "b0006c092694828f4b0fa409a369b798e5e26f8d", "shasum": "" }, "require": { @@ -8629,7 +8629,7 @@ "issues": "https://github.com/orchestral/testbench/issues", "source": "https://github.com/orchestral/testbench-core" }, - "time": "2024-01-22T01:45:47+00:00" + "time": "2024-02-21T23:33:22+00:00" }, { "name": "orchestra/workbench", @@ -9247,21 +9247,21 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.0", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc" + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fad452781b3d774e3337b0c0b245dd8e5a4455fc", - "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", - "php": "^7.4 || ^8.0", + "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", "phpstan/phpdoc-parser": "^1.13" }, @@ -9299,9 +9299,9 @@ "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.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" }, - "time": "2024-01-11T11:49:22+00:00" + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpmyadmin/sql-parser", @@ -9437,16 +9437,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.25.0", + "version": "1.26.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240" + "reference": "231e3186624c03d7e7c890ec662b81e6b0405227" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240", - "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/231e3186624c03d7e7c890ec662b81e6b0405227", + "reference": "231e3186624c03d7e7c890ec662b81e6b0405227", "shasum": "" }, "require": { @@ -9478,9 +9478,9 @@ "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.25.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.26.0" }, - "time": "2024-01-04T17:06:16+00:00" + "time": "2024-02-23T16:05:55+00:00" }, { "name": "phpstan/phpstan", @@ -9594,16 +9594,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.15", + "version": "1.3.16", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a" + "reference": "d5242a59d035e46774f2e634b374bc39ff62cb95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", - "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d5242a59d035e46774f2e634b374bc39ff62cb95", + "reference": "d5242a59d035e46774f2e634b374bc39ff62cb95", "shasum": "" }, "require": { @@ -9640,9 +9640,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.15" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.16" }, - "time": "2023-10-09T18:58:39+00:00" + "time": "2024-02-23T09:51:20+00:00" }, { "name": "phpstan/phpstan-strict-rules", @@ -10461,12 +10461,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "3e513f303c13a625befa037a23b5d1ac9bde2a52" + "reference": "aafb7236bf0c11b93b24e951544bd83470b85bec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3e513f303c13a625befa037a23b5d1ac9bde2a52", - "reference": "3e513f303c13a625befa037a23b5d1ac9bde2a52", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/aafb7236bf0c11b93b24e951544bd83470b85bec", + "reference": "aafb7236bf0c11b93b24e951544bd83470b85bec", "shasum": "" }, "conflict": { @@ -10511,7 +10511,7 @@ "barrelstrength/sprout-forms": "<3.9", "barryvdh/laravel-translation-manager": "<0.6.2", "barzahlen/barzahlen-php": "<2.0.1", - "baserproject/basercms": "<4.8", + "baserproject/basercms": "<5.0.9", "bassjobsen/bootstrap-3-typeahead": ">4.0.2", "bigfork/silverstripe-form-capture": ">=3,<3.1.1", "billz/raspap-webgui": "<2.9.5", @@ -10541,7 +10541,7 @@ "cesnet/simplesamlphp-module-proxystatistics": "<3.1", "chriskacerguis/codeigniter-restserver": "<=2.7.1", "civicrm/civicrm-core": ">=4.2,<4.2.9|>=4.3,<4.3.3", - "ckeditor/ckeditor": "<4.17", + "ckeditor/ckeditor": "<4.24", "cockpit-hq/cockpit": "<=2.6.3", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<3.1.9", @@ -10597,6 +10597,7 @@ "elijaa/phpmemcacheadmin": "<=1.3", "encore/laravel-admin": "<=1.8.19", "endroid/qr-code-bundle": "<3.4.2", + "enhavo/enhavo-app": "<=0.13.1", "enshrined/svg-sanitize": "<0.15", "erusev/parsedown": "<1.7.2", "ether/logs": "<3.0.4", @@ -10714,7 +10715,7 @@ "joomla/archive": "<1.1.12|>=2,<2.0.1", "joomla/filesystem": "<1.6.2|>=2,<2.0.1", "joomla/filter": "<1.4.4|>=2,<2.0.1", - "joomla/framework": "<1.5.4|>=2.5.4,<=3.8.12", + "joomla/framework": "<1.5.7|>=2.5.4,<=3.8.12", "joomla/input": ">=2,<2.0.2", "joomla/joomla-cms": ">=2.5,<3.9.12", "joomla/session": "<1.3.1", @@ -10763,7 +10764,7 @@ "magneto/core": "<1.9.4.4-dev", "maikuolan/phpmussel": ">=1,<1.6", "mainwp/mainwp": "<=4.4.3.3", - "mantisbt/mantisbt": "<=2.25.7", + "mantisbt/mantisbt": "<2.26.1", "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", "mautic/core": "<4.3", @@ -10786,7 +10787,7 @@ "mojo42/jirafeau": "<4.4", "mongodb/mongodb": ">=1,<1.9.2", "monolog/monolog": ">=1.8,<1.12", - "moodle/moodle": "<4.3.0.0-RC2-dev", + "moodle/moodle": "<4.3.3", "mos/cimage": "<0.7.19", "movim/moxl": ">=0.8,<=0.10", "mpdf/mpdf": "<=7.1.7", @@ -10848,7 +10849,7 @@ "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1", "personnummer/personnummer": "<3.0.2", "phanan/koel": "<5.1.4", - "phenx/php-svg-lib": "<0.5.1", + "phenx/php-svg-lib": "<0.5.2", "php-mod/curl": "<2.3.2", "phpbb/phpbb": "<3.2.10|>=3.3,<3.3.1", "phpems/phpems": ">=6,<=6.1.3", @@ -10867,7 +10868,7 @@ "phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/phpxmlrpc": "<4.9.2", "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<1.3.3", + "pimcore/admin-ui-classic-bundle": "<1.3.4", "pimcore/customer-management-framework-bundle": "<4.0.6", "pimcore/data-hub": "<1.2.4", "pimcore/demo": "<10.3", @@ -10885,7 +10886,7 @@ "prestashop/blockwishlist": ">=2,<2.1.1", "prestashop/contactform": ">=1.0.1,<4.3", "prestashop/gamification": "<2.3.2", - "prestashop/prestashop": "<8.1.3", + "prestashop/prestashop": "<8.1.4", "prestashop/productcomments": "<5.0.2", "prestashop/ps_emailsubscription": "<2.6.1", "prestashop/ps_facetedsearch": "<3.4.1", @@ -10908,6 +10909,7 @@ "rap2hpoutre/laravel-log-viewer": "<0.13", "react/http": ">=0.7,<1.9", "really-simple-plugins/complianz-gdpr": "<6.4.2", + "redaxo/source": "<=5.15.1", "remdex/livehelperchat": "<3.99", "reportico-web/reportico": "<=7.1.21", "rhukster/dom-sanitizer": "<1.0.7", @@ -11045,6 +11047,7 @@ "topthink/framework": "<6.0.14", "topthink/think": "<=6.1.1", "topthink/thinkphp": "<=3.2.3", + "torrentpier/torrentpier": "<=2.4.1", "tpwd/ke_search": "<4.0.3|>=4.1,<4.6.6|>=5,<5.0.2", "tribalsystems/zenario": "<=9.4.59197", "truckersmp/phpwhois": "<=4.3.1", @@ -11190,7 +11193,7 @@ "type": "tidelift" } ], - "time": "2024-02-16T21:04:04+00:00" + "time": "2024-02-23T16:04:25+00:00" }, { "name": "sebastian/cli-parser", From f7ba12dd041166b71c6b7a9f0eb4e2274e8409ba Mon Sep 17 00:00:00 2001 From: lotyp Date: Sun, 25 Feb 2024 01:06:43 +0200 Subject: [PATCH 2/5] feat: add support for cycle/schema-builder https://github.com/spiral/cycle-bridge/compare/v2.4.2...v2.5.0 https://github.com/cycle/schema-builder --- composer.json | 1 + composer.lock | 2 +- config/cycle.php | 4 +- .../Providers/Registrators/RegisterSchema.php | 13 +++++ src/Schema/Config/SchemaConfig.php | 5 ++ .../Migrations/MigrateCommandTest.php | 3 +- .../Commands/Migrations/ReplayCommandTest.php | 5 +- .../Migrations/RollbackCommandTest.php | 3 +- .../Commands/Migrations/StatusCommandTest.php | 2 +- .../Registrators/RegisterSchemaTest.php | 50 ++++++++++++++++++- 10 files changed, 77 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 24eb49f1..10ba209a 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "cycle/schema-migrations-generator": "^2.2", "cycle/schema-renderer": "^1.2", "illuminate/console": "^10.45", + "cycle/schema-builder": "^2.8.0", "illuminate/contracts": "^10.45", "illuminate/support": "^10.45", "laminas/laminas-hydrator": "^4.15", diff --git a/composer.lock b/composer.lock index c42ed96b..6b2cca2c 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": "71d5e3144c338493a349c14942e02c29", + "content-hash": "ecfa28c2a99a5e661d30f61cc9b7ea07", "packages": [ { "name": "brick/math", diff --git a/config/cycle.php b/config/cycle.php index 028873c6..428c03a2 100644 --- a/config/cycle.php +++ b/config/cycle.php @@ -159,9 +159,7 @@ SchemaInterface::MAPPER => Cycle\ORM\Mapper\Mapper::class, SchemaInterface::REPOSITORY => Cycle\ORM\Select\Repository::class, SchemaInterface::SCOPE => null, - SchemaInterface::TYPECAST_HANDLER => [ - // \Cycle\ORM\Parser\Typecast::class, \App\Infrastructure\CycleORM\Typecaster\UuidTypecast::class, - ], + SchemaInterface::TYPECAST_HANDLER => null, ], 'collections' => [ diff --git a/src/Bridge/Laravel/Providers/Registrators/RegisterSchema.php b/src/Bridge/Laravel/Providers/Registrators/RegisterSchema.php index 5a4570a6..67ff9f6d 100644 --- a/src/Bridge/Laravel/Providers/Registrators/RegisterSchema.php +++ b/src/Bridge/Laravel/Providers/Registrators/RegisterSchema.php @@ -4,7 +4,9 @@ namespace WayOfDev\Cycle\Bridge\Laravel\Providers\Registrators; +use Cycle\Database\DatabaseProviderInterface; use Cycle\ORM\SchemaInterface; +use Cycle\Schema\Defaults; use Cycle\Schema\Registry; use Illuminate\Container\Container; use Illuminate\Contracts\Cache\Factory as CacheFactory; @@ -37,6 +39,17 @@ public function __invoke(Application $app): void ); }); + $app->bind(Registry::class, static function (Application $app): Registry { + $defaults = new Defaults(); + + /** @var SchemaConfig $config */ + $config = $app->get(SchemaConfig::class); + + $defaults->merge($config->defaults()); + + return new Registry($app->get(DatabaseProviderInterface::class), $defaults); + }); + $app->bind(SchemaInterface::class, static function (Application $app): SchemaInterface { /** @var SchemaConfig $config */ $config = $app->get(SchemaConfig::class); diff --git a/src/Schema/Config/SchemaConfig.php b/src/Schema/Config/SchemaConfig.php index d29c184e..73ef2818 100644 --- a/src/Schema/Config/SchemaConfig.php +++ b/src/Schema/Config/SchemaConfig.php @@ -45,4 +45,9 @@ public function cacheSchema(): bool { return $this->config['cache']['enabled']; } + + public function defaults() + { + return $this->config['defaults']; + } } diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php index 41bf6141..a76164ed 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php @@ -23,9 +23,10 @@ public function it_runs_handle(): void $this->artisanCall('cycle:migrate:init'); $this->artisanCall('cycle:orm:migrate', ['--force' => true]); + // @phpstan-ignore-next-line $this::assertCount(1, $database->getTables()); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(4, $database->getTables()); + $this::assertCount(5, $database->getTables()); } } diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php index b281d52b..1fef7753 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php @@ -23,12 +23,13 @@ public function it_runs_handle(): void $this->assertConsoleCommandOutputContainsStrings('cycle:migrate:replay', ['--force' => true], 'No'); $this->artisanCall('cycle:orm:migrate', ['--force' => true]); + // @phpstan-ignore-next-line $this::assertCount(1, $database->getTables()); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(4, $database->getTables()); + $this::assertCount(5, $database->getTables()); $this->artisanCall('cycle:migrate:replay', ['--force' => true]); - $this::assertCount(4, $database->getTables()); + $this::assertCount(5, $database->getTables()); } } diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php index c93594ab..2ba13a74 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php @@ -24,10 +24,11 @@ public function it_runs_handle(): void $this::assertConsoleCommandOutputContainsStrings('cycle:migrate:rollback', ['--force' => true], 'No'); $this->artisanCall('cycle:orm:migrate', ['--force' => true]); + // @phpstan-ignore-next-line $this::assertCount(1, $database->getTables()); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(4, $database->getTables()); + $this::assertCount(5, $database->getTables()); $this->artisanCall('cycle:migrate:rollback', ['--force' => true]); $this::assertCount(1, $database->getTables()); diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php index 36678556..20ef296b 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php @@ -36,7 +36,7 @@ public function it_runs_handle(): void $this::assertStringContainsString('not executed yet', $output); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(4, $database->getTables()); + $this::assertCount(5, $database->getTables()); $this->artisanCall('cycle:migrate:status'); $output2 = Artisan::output(); diff --git a/tests/src/Bridge/Laravel/Providers/Registrators/RegisterSchemaTest.php b/tests/src/Bridge/Laravel/Providers/Registrators/RegisterSchemaTest.php index b87e357f..c4940080 100644 --- a/tests/src/Bridge/Laravel/Providers/Registrators/RegisterSchemaTest.php +++ b/tests/src/Bridge/Laravel/Providers/Registrators/RegisterSchemaTest.php @@ -4,8 +4,12 @@ namespace WayOfDev\Tests\Bridge\Laravel\Providers\Registrators; +use Cycle\ORM\Mapper\Mapper; use Cycle\ORM\Schema; use Cycle\ORM\SchemaInterface; +use Cycle\ORM\Select\Repository; +use Cycle\ORM\Select\Source; +use Cycle\Schema\Registry; use Illuminate\Contracts\Container\BindingResolutionException; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; @@ -49,6 +53,8 @@ public function it_registers_generator_loader_as_singleton(): void $this::fail($e->getMessage()); } + $this::assertSame($class1, $class2); + $this::assertInstanceOf(GeneratorLoader::class, $class1); $this::assertInstanceOf(GeneratorQueue::class, $class1); @@ -62,7 +68,7 @@ public function it_registers_schema_interface(): void { try { $class1 = $this->app->get(SchemaInterface::class); - // $class2 = $this->app->get(SchemaInterface::class); + $class2 = $this->app->get(SchemaInterface::class); } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { $this::fail($e->getMessage()); } @@ -70,11 +76,51 @@ public function it_registers_schema_interface(): void $this::assertInstanceOf(SchemaInterface::class, $class1); $this::assertInstanceOf(Schema::class, $class1); - // $this::assertSame($class1, $class2); + $this::assertNotSame($class1, $class2); $schema = $class1->toArray(); $this::assertArrayHasKey('user', $schema); $this::assertArrayHasKey('role', $schema); } + + /** + * @test + */ + public function it_registers_schema_registry_with_default_config(): void + { + try { + $defaults = $this->app->get(Registry::class)->getDefaults(); + + $this::assertSame(Mapper::class, $defaults[SchemaInterface::MAPPER]); + $this::assertSame(Repository::class, $defaults[SchemaInterface::REPOSITORY]); + $this::assertSame(Source::class, $defaults[SchemaInterface::SOURCE]); + $this::assertNull($defaults[SchemaInterface::SCOPE]); + $this::assertNull($defaults[SchemaInterface::TYPECAST_HANDLER]); + } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { + $this::fail($e->getMessage()); + } + } + + /** + * @test + */ + public function it_registers_schema_registry_with_custom_config(): void + { + try { + config()->set('cycle.schema.defaults', [ + SchemaInterface::TYPECAST_HANDLER => ['foo', 'bar'], + ]); + + $defaults = $this->app->get(Registry::class)->getDefaults(); + + $this::assertSame(Mapper::class, $defaults[SchemaInterface::MAPPER]); + $this::assertSame(Repository::class, $defaults[SchemaInterface::REPOSITORY]); + $this::assertSame(Source::class, $defaults[SchemaInterface::SOURCE]); + $this::assertNull($defaults[SchemaInterface::SCOPE]); + $this::assertSame(['foo', 'bar'], $defaults[SchemaInterface::TYPECAST_HANDLER]); + } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { + $this::fail($e->getMessage()); + } + } } From 7b1a1f6fbc793e0288f0d8ef05db9fda0d71f4b3 Mon Sep 17 00:00:00 2001 From: lotyp Date: Sun, 25 Feb 2024 01:11:34 +0200 Subject: [PATCH 3/5] chore: revert tests --- .../Console/Commands/Migrations/MigrateCommandTest.php | 2 +- .../Laravel/Console/Commands/Migrations/ReplayCommandTest.php | 4 ++-- .../Console/Commands/Migrations/RollbackCommandTest.php | 2 +- .../Laravel/Console/Commands/Migrations/StatusCommandTest.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php index a76164ed..376e50d1 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php @@ -27,6 +27,6 @@ public function it_runs_handle(): void $this::assertCount(1, $database->getTables()); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(5, $database->getTables()); + $this::assertCount(4, $database->getTables()); } } diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php index 1fef7753..e543b82b 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php @@ -27,9 +27,9 @@ public function it_runs_handle(): void $this::assertCount(1, $database->getTables()); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(5, $database->getTables()); + $this::assertCount(4, $database->getTables()); $this->artisanCall('cycle:migrate:replay', ['--force' => true]); - $this::assertCount(5, $database->getTables()); + $this::assertCount(4, $database->getTables()); } } diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php index 2ba13a74..f7a779ae 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php @@ -28,7 +28,7 @@ public function it_runs_handle(): void $this::assertCount(1, $database->getTables()); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(5, $database->getTables()); + $this::assertCount(4, $database->getTables()); $this->artisanCall('cycle:migrate:rollback', ['--force' => true]); $this::assertCount(1, $database->getTables()); diff --git a/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php b/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php index 20ef296b..36678556 100644 --- a/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php +++ b/tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php @@ -36,7 +36,7 @@ public function it_runs_handle(): void $this::assertStringContainsString('not executed yet', $output); $this->artisanCall('cycle:migrate', ['--force' => true]); - $this::assertCount(5, $database->getTables()); + $this::assertCount(4, $database->getTables()); $this->artisanCall('cycle:migrate:status'); $output2 = Artisan::output(); From 0b6e4c1f13fdf9cdb8ab1ba369fbac444711765e Mon Sep 17 00:00:00 2001 From: lotyp Date: Wed, 28 Feb 2024 00:22:55 +0200 Subject: [PATCH 4/5] feat: add configurable, optional logger / profiler --- Makefile | 7 +- config/cycle.php | 15 +++ src/Bridge/Laravel/LoggerFactory.php | 30 +++++- .../Registrators/RegisterDatabase.php | 5 +- .../src/Bridge/Laravel/LoggerFactoryTest.php | 102 ++++++++++++++++++ 5 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 tests/src/Bridge/Laravel/LoggerFactoryTest.php diff --git a/Makefile b/Makefile index 84c115e6..9fe1fd23 100644 --- a/Makefile +++ b/Makefile @@ -172,9 +172,12 @@ lint-stan-ci: $(APP_COMPOSER) stan:ci .PHONY: lint-stan-ci +#test: ## Run project php-unit and pest tests +# $(APP_COMPOSER) test +#.PHONY: test + test: ## Run project php-unit and pest tests - $(APP_COMPOSER) test -.PHONY: test + $(APP_RUNNER) vendor/bin/pest tests/src/Bridge/Laravel/LoggerFactoryTest.php test-cc: ## Run project php-unit and pest tests in coverage mode and build report $(APP_COMPOSER) test:cc diff --git a/config/cycle.php b/config/cycle.php index 428c03a2..fb585601 100644 --- a/config/cycle.php +++ b/config/cycle.php @@ -136,6 +136,21 @@ queryCache: true, ), ], + + /* + * Default logger configuration + * + * Use any of channels configured in your logging.php file + */ + 'logger' => [ + 'default' => env('DB_DEFAULT_LOGGER_CHANNEL', null), + 'drivers' => [ + 'sqlite' => env('DB_DEFAULT_LOGGER_CHANNEL', null), + 'pgsql' => env('DB_DEFAULT_LOGGER_CHANNEL', null), + 'mysql' => env('DB_DEFAULT_LOGGER_CHANNEL', null), + 'sqlserver' => env('DB_DEFAULT_LOGGER_CHANNEL', null), + ], + ], ], 'schema' => [ diff --git a/src/Bridge/Laravel/LoggerFactory.php b/src/Bridge/Laravel/LoggerFactory.php index 7f6e2c59..8d8aca26 100644 --- a/src/Bridge/Laravel/LoggerFactory.php +++ b/src/Bridge/Laravel/LoggerFactory.php @@ -4,19 +4,41 @@ namespace WayOfDev\Cycle\Bridge\Laravel; +use Cycle\Database\Config\DatabaseConfig; use Cycle\Database\Driver\DriverInterface; use Cycle\Database\LoggerFactoryInterface; -use Illuminate\Log\Logger; +use Cycle\Database\NamedInterface; +use Illuminate\Log\LogManager; use Psr\Log\LoggerInterface; +use Psr\Log\NullLogger; final class LoggerFactory implements LoggerFactoryInterface { - public function __construct(private readonly Logger $logger) - { + private array $config; + + public function __construct( + private readonly LogManager $manager, + DatabaseConfig $databaseConfig + ) { + $this->config = $databaseConfig->toArray()['logger'] ?? []; } public function getLogger(?DriverInterface $driver = null): LoggerInterface { - return $this->logger->getLogger(); + if (! isset($this->config['default'])) { + return new NullLogger(); + } + + $channel = $this->config['default']; + + if ($driver instanceof NamedInterface) { + $driverName = $driver->getName(); + + if (isset($this->config['drivers'][$driverName])) { + $channel = $this->config['drivers'][$driverName]; + } + } + + return $this->manager->channel($channel); } } diff --git a/src/Bridge/Laravel/Providers/Registrators/RegisterDatabase.php b/src/Bridge/Laravel/Providers/Registrators/RegisterDatabase.php index cc782791..72349985 100644 --- a/src/Bridge/Laravel/Providers/Registrators/RegisterDatabase.php +++ b/src/Bridge/Laravel/Providers/Registrators/RegisterDatabase.php @@ -10,7 +10,7 @@ use Cycle\Database\DatabaseProviderInterface; use Cycle\Database\LoggerFactoryInterface; use Illuminate\Contracts\Foundation\Application; -use Illuminate\Log\Logger; +use Illuminate\Log\LogManager; use WayOfDev\Cycle\Bridge\Laravel\LoggerFactory; /** @@ -22,7 +22,8 @@ public function __invoke(Application $app): void { $app->singleton(LoggerFactoryInterface::class, static function (Application $app): LoggerFactoryInterface { return new LoggerFactory( - logger: $app->get(Logger::class) + manager: $app->get(LogManager::class), + databaseConfig: $app->get(DatabaseConfig::class), ); }); diff --git a/tests/src/Bridge/Laravel/LoggerFactoryTest.php b/tests/src/Bridge/Laravel/LoggerFactoryTest.php new file mode 100644 index 00000000..19bfacef --- /dev/null +++ b/tests/src/Bridge/Laravel/LoggerFactoryTest.php @@ -0,0 +1,102 @@ +shouldReceive('getName')->andReturn('custom'); + + $loggerFactory = new LoggerFactory( + $this->app->get(LogManager::class), + new DatabaseConfig(config('cycle.database')) + ); + + // @phpstan-ignore-next-line + $logger = $loggerFactory->getLogger($mockDriver); + $logger->info('Test log entry'); + + $logContent = file_get_contents(storage_path('logs/logger-factory-test.log')); + $this::assertStringContainsString('Test log entry', $logContent); + } + + /** + * @test + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function it_should_return_null_logger_from_factory(): void + { + config()->set('cycle.database.logger', [ + 'default' => null, + 'drivers' => [ + 'sqlite' => null, + 'pgsql' => null, + 'mysql' => null, + 'sqlserver' => null, + ], + ]); + + $loggerFactory = new LoggerFactory( + $this->app->get(LogManager::class), + new DatabaseConfig(config('database')) + ); + $logger = $loggerFactory->getLogger(); + + $this::assertInstanceOf(NullLogger::class, $logger); + } + + protected function getEnvironmentSetUp($app): void + { + parent::getEnvironmentSetUp($app); + + // Add custom logging channel configuration + $app['config']->set('logging.channels.custom_channel', [ + 'driver' => 'single', + 'path' => storage_path('logs/logger-factory-test.log'), + 'level' => 'debug', + ]); + + // Set the database logger configuration + $app['config']->set('cycle.database.logger', [ + 'default' => 'stack', + 'drivers' => [ + 'sqlite' => 'stack', + 'pgsql' => 'stack', + 'mysql' => 'stack', + 'sqlserver' => 'stack', + 'custom' => 'custom_channel', + ], + ]); + } +} From 16602a61735f2a4700c1d05d28e09cfed4830520 Mon Sep 17 00:00:00 2001 From: lotyp Date: Wed, 28 Feb 2024 00:30:09 +0200 Subject: [PATCH 5/5] feat: add development files to export-ignore via git attributes --- .gitattributes | 18 ++++++++++++++++++ Makefile | 7 ++----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..d295bab2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +/.build export-ignore +/.github export-ignore +/tests export-ignore +.editorconfig export-ignore +.env export-ignore +.env.example export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.php-cs-fixer.dist.php +.pre-commit-config.yaml +.yamllint.yaml +docker-compose.yaml +Makefile +package.json +phpstan.neon.dist +phpstan-baseline.neon +phpunit.xml.dist export-ignore +renovate.json export-ignore diff --git a/Makefile b/Makefile index 9fe1fd23..84c115e6 100644 --- a/Makefile +++ b/Makefile @@ -172,12 +172,9 @@ lint-stan-ci: $(APP_COMPOSER) stan:ci .PHONY: lint-stan-ci -#test: ## Run project php-unit and pest tests -# $(APP_COMPOSER) test -#.PHONY: test - test: ## Run project php-unit and pest tests - $(APP_RUNNER) vendor/bin/pest tests/src/Bridge/Laravel/LoggerFactoryTest.php + $(APP_COMPOSER) test +.PHONY: test test-cc: ## Run project php-unit and pest tests in coverage mode and build report $(APP_COMPOSER) test:cc