I'm trying to use rector (https://github.com/rectorphp/rector) for the first time to upgrade my CakePHP application. I'm working in a local development environment first.
I've hit a bit of a headache. For example purposes I created the following simple php class:
<?php
class test {
public function init( array $data) {
return $data;
}
}
I run the following command:
vendor/bin/rector process src/Model/Table/test.php --level cakephp35 --dry-run
I receive the following error:
Class array was not found while trying to analyse it - autoloading is probably
not configured properly.
The issue is with the "array" type declaration for the input variable in the function. I remove it, the code passes the rector test.
I've googled around and can't find anything, which makes me think I missed something incredibly simple. Any help?