From 035d7f2ae2ca9ea1d21a67a48a68fcc9094fd783 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 15 Aug 2023 22:11:57 +0800 Subject: [PATCH 1/3] [2.x] Remove unused `orchestra/testbench` deps This opens up the opportunity to require and run `tinker` directly from a package using `orchestra/testbench`. ```bash php vendor/bin/testbench package:discover php vendor/bin/testbench tinker ``` --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 424c073..4d8363b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,6 @@ }, "require-dev": { "mockery/mockery": "~1.3.3|^1.4.2", - "orchestra/testbench": "^4.0|^5.0|^6.0|^6.0|^7.0|^8.0", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^8.5.8|^9.3.3" }, From 06b2996198e848dc83a5f42ab053e9da6d3368ce Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 15 Aug 2023 22:20:04 +0800 Subject: [PATCH 2/3] wip --- phpstan.neon.dist | 1 + src/TinkerServiceProvider.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a52223c..d0484d8 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,4 +7,5 @@ parameters: ignoreErrors: - "#Unsafe usage of new static\\(\\)#" + - "#Class Illuminate\\\\Foundation\\\\Application not found.#" - "#Class Laravel\\\\Lumen\\\\Application not found.#" diff --git a/src/TinkerServiceProvider.php b/src/TinkerServiceProvider.php index 3f1cd56..b145e11 100644 --- a/src/TinkerServiceProvider.php +++ b/src/TinkerServiceProvider.php @@ -18,9 +18,9 @@ class TinkerServiceProvider extends ServiceProvider implements DeferrableProvide public function boot() { $source = realpath($raw = __DIR__.'/../config/tinker.php') ?: $raw; - + if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { - $this->publishes([$source => config_path('tinker.php')]); + $this->publishes([$source => $this->app->configPath('tinker.php')]); } elseif ($this->app instanceof LumenApplication) { $this->app->configure('tinker'); } From 169d65bd70a13f4ba6068c8d5e57ba0db0bc62a0 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 15 Aug 2023 14:20:23 +0000 Subject: [PATCH 3/3] Apply fixes from StyleCI --- src/TinkerServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TinkerServiceProvider.php b/src/TinkerServiceProvider.php index b145e11..0da82b8 100644 --- a/src/TinkerServiceProvider.php +++ b/src/TinkerServiceProvider.php @@ -18,7 +18,7 @@ class TinkerServiceProvider extends ServiceProvider implements DeferrableProvide public function boot() { $source = realpath($raw = __DIR__.'/../config/tinker.php') ?: $raw; - + if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { $this->publishes([$source => $this->app->configPath('tinker.php')]); } elseif ($this->app instanceof LumenApplication) {