cakephp-3.5 - CakePHP 通过 Rector 升级,具有输入类型数组声明的函数
问题描述
我第一次尝试使用rector ( https://github.com/rectorphp/rector ) 来升级我的CakePHP 应用程序。我首先在本地开发环境中工作。
我有点头疼。例如,我创建了以下简单的 php 类:
<?php
class test {
public function init( array $data) {
return $data;
}
}
我运行以下命令:
vendor/bin/rector process src/Model/Table/test.php --level cakephp35 --dry-run
我收到以下错误:
Class array was not found while trying to analyse it - autoloading is probably
not configured properly.
问题在于函数中输入变量的“数组”类型声明。我删除它,代码通过了校长测试。
我用谷歌搜索,找不到任何东西,这让我觉得我错过了一些非常简单的东西。有什么帮助吗?
解决方案
推荐阅读
- c# - 保护 DocuSign Connect SOAP 端点
- database - Liquibase 回滚将列大小更改为旧版本
- java - 使用 session.saveOrUpdate(Object) 时如何防止 Hibernate 抛出 ConstraintViolationException?
- xaml - 为什么 XYFocusKeyboardNavigation 不起作用?
- django - Jinja/Django 我如何从 jinja 过滤?
- json - Go:在 for 循环中使用 JSON Unmarshal
- c++ - 使用 Mac Clang 运行相同的代码,但使用 Unix GCC 崩溃
- arrays - 如何从第 10 行开始的列中剪切和粘贴找到的非空白单元格范围?
- excel - 对于非常大的数组,循环遍历数组会减慢速度。我该怎么做才能加快速度?
- java - java错误:catch类型的非法开始(异常e)