PHP-Token-Reflection
PHP-Token-Reflection copied to clipboard
PHP 7: Return type declarations
When use PHP 7: Return type declarations it's cause [TokenReflection\Exception\ParseException] Unexpected token found.
Description for the new feature in PHP 7: http://php.net/manual/en/functions.returning-values.php
I'm using "codeception/aspect-mock": "*".
I'm also having this error, and trying to use AspectMock.
@jmauerhan Hi. For me temporary solution is not to use new features from 7 version only in those files that will be mocked:
$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'includePaths' => [
__DIR__ . '/../../../src/Lib/Event/Manager/EventManager.php',
__DIR__ . '/../../../src/App/Helper/InputParamHelper.php',
],
]);
Not really an option for me :) I switched to PHP-Mock because I was only using AspectMock for functions. https://github.com/php-mock/php-mock
For others who come across this thread, it looks like AspectMock's core dependency GoAOP will be abandoning its reliance on the outdated Andrewsville/PHP-Token-Reflection
library when GoAOP 2.0 is released. See https://github.com/Codeception/AspectMock/issues/92.
As far as I know, this repo is abandoned. There won't be any PHP 7 compatibility in the future.