Composer PSR-4自动加载接口弃用声明

问题描述 投票:0回答:1

我无法理解这个简单界面的问题所在。

<?php

namespace App\Interfaces;

use Illuminate\View\View;

interface renderData
{
        public function renderAsHtml(): View;
}

[我composer dump-autoload收到以下通知

弃用通知:./app/Interfaces/RenderData.php中的App \ Interfaces \ renderData类不符合psr-4自动加载标准。在Composer v2.0中,它将不再自动加载。

我该如何解决?谢谢。

php laravel composer-php phar
1个回答
0
投票

可能是“ app”文件夹的首字母在app / Interfaces / RenderData中是小写字母,但在命名空间中在“ App \ Interfaces”中是大写字母。

确保文件夹结构和命名与名称空间匹配。

© www.soinside.com 2019 - 2024. All rights reserved.