php - 任何工匠命令上的 TypeError
问题描述
- Laravel 版本:7.23.0
- PHP版本:7.4.8
- 数据库驱动和版本:MySQL v8.0.21
由于当前存在漏洞(https://blog.laravel.com/laravel-cookie-security-releases),今天早上我将 Laravel 升级到了 7.23.0 版本。但是现在我收到每个 Artisan Command 的以下错误消息:
php artisan package:discover --ansi
TypeError
Illuminate\Container\Container::bind(): Argument #2 ($concrete) must be of type Closure|string|null
at vendor/laravel/framework/src/Illuminate/Container/Container.php:238
234| // bound into this container to the abstract type and we will just wrap it
235| // up inside its own Closure to give us more convenience when extending.
236| if (! $concrete instanceof Closure) {
237| if (! is_string($concrete)) {
> 238| throw new \TypeError(self::class.'::bind(): Argument #2 ($concrete) must be of type Closure|string|null');
239| }
240|
241| $concrete = $this->getClosure($abstract, $concrete);
242| }
+11 vendor frames
12 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Facade\Ignition\IgnitionServiceProvider))
+5 vendor frames
18 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
由于我认为这将是一个更明显的错误,并且我在 GitHub 上没有发现问题,所以我没有打开一个新问题并在这里寻求帮助 :)
但是,我真的不知道究竟是什么导致了这个问题。
解决方案
感谢 Abdel-aziz hassan 的链接(https://github.com/laravel/framework/pull/33539)。
我发现门面/点火器是旧版本的。我更新了它,现在它可以工作了。
多谢你们!
推荐阅读
- apache-spark - Flink 和 Spark 中的 batch 能分别有多大?
- systemc - 位向量输出分配延迟
- image - 将 Blogspot RSS 提要缩略图大小(现在为 72 像素)更改为最大分辨率
- sql - 与 H2 和 Oracle DB 兼容的日期比较
- json - 使用 Postgresql 进行 HQL 注入
- reactjs - 在 onClick 之后如何使用 Enzyme 检查 React Hooks 组件的更改?
- android - 如何在 android 中获取 UTM 属性?
- php - 限制后如何获取数据库中的剩余数据
- autocad - 如何打开 DWG 并直接向 AutoCADLT 发送命令?
- php - 如何在php中将徽标(徽标是.png格式的图像)嵌入到另一个图像(.svg格式的图像)中