Codeception/AspectMock

return void - php7.1 feature broken

rommeras opened this issue · 1 comments

This issue has something to do with #123.
I'm using the last version of this project, which is 2.1.1 and I have the same issue with 'void' type (php 7.1.7)
Thing is, AspectMock depends on GoAop, and GoAop depends on nikic/php-parser.
At this point https://github.com/Codeception/AspectMock/blob/master/src/AspectMock/Intercept/BeforeMockTransformer.php#L56 $method->getReturnType() returns ReflectionType (not php class but GoAop), which is while casting to string returns something like 'AppBundle\SomeClass\void', which doesn't equal 'void', so I'm getting same fatal error "A void function must not return a value in …"

Could you please fix this, or suggest any possible workaround?

sorry, the problem was in nikic/php-parser package. Updated it to appropriate version, which supports php7