Closed mauryaratan closed 3 years ago
Just did a quick check and can reproduce the error. Happens when for example running:
ray(new DateTime);
Appears to be caused by the missing namespace prefixes on the $defaultCasters
array within AbstractCloner.php
from line 25.
@freekmurze I guess the imposter-plugin package does not pickup on namespaces within arrays etc.
The following might not be an ideal solution, but a quick fix could be running a find replace on the file after the composer install script.
"post-install-cmd": [
"sed -i '' 's/'\\''Symfony/'\\''Spatie\\\\WordPressRay\\\\Symfony/g' ./vendor/symfony/var-dumper/Cloner/AbstractCloner.php"
]
@jeffreyvr thanks for checking. I think that PR might be the way to go for now. Could you PR that?
Will be fixed by #25
I'm still experiencing this error even after upgrading to the latest wordpress version
@freekmurze Unfortunately, with https://github.com/spatie/wordpress-ray/commit/30cce28559f3ea724f5e35966e6ddf5d1cfeae30#diff-b690787d29e71943d4eb6bf3c04594ce8cfa7cc5bf56b5016c89854fdfe5f54e the fix was overwritten.
Possibly the composer post install script was not executed.
I'll retry by tagging a new version later tonight!
I've tagged a new version. The modified classnames are now written correctly: https://github.com/spatie/wordpress-ray/blob/855a811487751a3e96c30ab1f2c57a7ef4f3d6f0/vendor/symfony/var-dumper/Cloner/AbstractCloner.php#L24
Hey there! Loving the Ray so far 😍
Was trying to print an object and came across this error.
Fatal error: Uncaught Error: Class 'Symfony\Component\VarDumper\Caster\DateCaster' not found in /public_html/content/plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/AbstractCloner.php on line 348
Using the WordPress plugin btw.