From b936d415b252b499e8c3b1f795cd4fc20f57e1f3 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 15 Aug 2023 22:27:00 +0800 Subject: [PATCH] [2.x] Remove unused `orchestra/testbench` deps (#166) * [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 ``` * wip * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot --- composer.json | 1 - phpstan.neon.dist | 1 + src/TinkerServiceProvider.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) 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" }, 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..0da82b8 100644 --- a/src/TinkerServiceProvider.php +++ b/src/TinkerServiceProvider.php @@ -20,7 +20,7 @@ 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'); }