PHP-Token-Reflection icon indicating copy to clipboard operation
PHP-Token-Reflection copied to clipboard

PHP 7: Return type declarations

Open findli opened this issue 8 years ago • 5 comments

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": "*".

findli avatar Apr 16 '16 10:04 findli

I'm also having this error, and trying to use AspectMock.

jmauerhan avatar Apr 24 '16 17:04 jmauerhan

@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',

    ],

]);

findli avatar Apr 24 '16 18:04 findli

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

jmauerhan avatar Apr 26 '16 21:04 jmauerhan

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.

natechicago avatar May 04 '16 23:05 natechicago

As far as I know, this repo is abandoned. There won't be any PHP 7 compatibility in the future.

jankal avatar Mar 12 '17 16:03 jankal