0

为 CakePHP3 应用程序运行 PHPStan时,使用CakePHP3 动态查找器Call to an undefined method的行中总是出现错误

如何删除动态方法等错误?

/**
 * @property \App\Model\Table\ArticlesTable $Articles
 */
class ArticlesController extends AppController
{
    public function view($slug = null)
    {
        $article = $this->Articles->findBySlug($slug)->firstOrFail();
        $this->set(compact('article'));
    }
------ ---------------------------------------------------------------------------- 
  Line   Controller/ArticlesController.php                                           
 ------ ---------------------------------------------------------------------------- 
  58     Call to an undefined method App\Model\Table\ArticlesTable::findBySlug().    
 ...
4

1 回答 1

1

PHPStan 借助所谓的类反射扩展来理解魔术属性和方法的概念。有关更多详细信息,请参阅文档

于 2020-01-05T13:32:17.310 回答