Using Tinkerwell (latest version, Version 2.11.0) while Ray is active, results in the following error (when executing code in Tinkerwell):
Fatal error: Cannot declare class Spatie\WordPressRay\Symfony\Component\Console\Output\Output, because the name is already in use in /Users/jeffreyvanrossum/Documents/Sites/wordpress/wp-content/plugins/wordpress-ray/vendor/symfony/console/Output/Output.php on line 30
So far I noticed when I uncomment the following bits from autoload_static.php
, the error goes away and Ray appears to be working.
'Symfony\\Component\\Console\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/console',
),
Then the following error is introduced:
Fatal error: Cannot declare class Spatie\WordPressRay\Symfony\Component\VarDumper\Dumper\AbstractDumper, because the name is already in use in /Users/jeffreyvanrossum/Documents/Sites/wordpress/wp-content/plugins/wordpress-ray/vendor/symfony/var-dumper/Dumper/AbstractDumper.php on line 22
So when I uncomment this out as well, it is "resolved".
'Symfony\\Component\\VarDumper\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/var-dumper',
),
So I wonder if these classes are loaded twice somehow?
I'm not sure why this happens. I did notice this issue on the imposter-plugin repo:
typisttech/imposter-plugin#170
I tested this with the (at this time) current master branch of this repo, with no other active plugins.
Edit:
When I remove the imposter-plugin package, and then install the dependencies with composer, the issue is resolved. Not really a solution since all the namespace prefixes are lost, but it does indicate the issue is caused by the imposter-plugin.
Edit 2:
We can determine if Tinkerwell is used, but I would understand that is not desirable.
$_SERVER['SCRIPT_NAME']; // would return tinkerwell