You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got this error with such code (originally from Twig library):
if (function_exists('mb_convert_encoding')) {
functiontwig_convert_encoding($string, $to, $from)
{
return mb_convert_encoding($string, $to, $from);
}
} elseif (function_exists('iconv')) {
functiontwig_convert_encoding($string, $to, $from)
{
return iconv($from, $to, $string);
}
} else {
functiontwig_convert_encoding($string, $to, $from)
{
thrownewException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
}
}
With such code I get this error (I'm using AspectMock library, but as I understand, this exception is thrown from Go! library):
RuntimeException : AspectMock couldn't parse some of files.
Try to exclude them from parsing list.
There were following reasons for this exception:
Thrown when working with file "{root}\src\ProxyBundle\ProxyBundle.php" token stream.
The cause of the exception was the } token (line 29) in following part of \ProxyBundle source code:
24:
25: } elseif (function_exists('iconv')) {
26: function twig_convert_encoding($string, $to, $from)
27: {
28: return iconv($from, $to, $string);
*29: }
30: } else {
31: function twig_convert_encoding($string, $to, $from)
32: {
33: throw new Exception('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
34: }
#0 \vendor\lisachenko\go-aop-php\src\Go\Instrument\Transformer\CachingTransformer.php(115): AspectMock\Intercept\BeforeMockTransformer->transform(Object(Go\Instrument\Transformer\StreamMetaData))
#1 \vendor\lisachenko\go-aop-php\src\Go\Instrument\Transformer\CachingTransformer.php(83): Go\Instrument\Transformer\CachingTransformer->processTransformers(Object(Go\Instrument\Transformer\StreamMetaData))
#2 \vendor\lisachenko\go-aop-php\src\Go\Instrument\ClassLoading\SourceTransformingLoader.php(156): Go\Instrument\Transformer\CachingTransformer->transform(Object(Go\Instrument\Transformer\StreamMetaData))
#3 \vendor\lisachenko\go-aop-php\src\Go\Instrument\ClassLoading\SourceTransformingLoader.php(111): Go\Instrument\ClassLoading\SourceTransformingLoader->transformCode(Object(Go\Instrument\Transformer\StreamMetaData))
#4 \vendor\lisachenko\go-aop-php\src\Go\Instrument\ClassLoading\AopComposerLoader.php(97): Go\Instrument\ClassLoading\SourceTransformingLoader->filter(Resource id #807, Resource id #808, 1004, true)
#5 \vendor\lisachenko\go-aop-php\src\Go\Instrument\ClassLoading\AopComposerLoader.php(97): Go\Instrument\ClassLoading\AopComposerLoader::loadClass()
#6 [internal function]: Go\Instrument\ClassLoading\AopComposerLoader->loadClass('ProxyBundle')
...
The text was updated successfully, but these errors were encountered:
Hello, thank you for the issue report, however this is not a bug for go-aop-php :) I'm using php-token-reflection to perform static analysis of source code and it can not handle dynamic definition of functions like this one. This is a known issue, my suggestion is to add this file to the blacklist in the kernel.
I've got this error with such code (originally from Twig library):
With such code I get this error (I'm using AspectMock library, but as I understand, this exception is thrown from Go! library):
The text was updated successfully, but these errors were encountered: