Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony\Component\VarDumper\Caster\DateCaster not found #24

Closed
mauryaratan opened this issue Jan 16, 2021 · 8 comments
Closed

Symfony\Component\VarDumper\Caster\DateCaster not found #24

mauryaratan opened this issue Jan 16, 2021 · 8 comments

Comments

@mauryaratan
Copy link

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.

@jeffreyvr
Copy link
Sponsor Contributor

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.

@jeffreyvr
Copy link
Sponsor Contributor

jeffreyvr commented Jan 16, 2021

@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"
]

@freekmurze
Copy link
Member

@jeffreyvr thanks for checking. I think that PR might be the way to go for now. Could you PR that?

@freekmurze
Copy link
Member

Will be fixed by #25

@stanwarri
Copy link

I'm still experiencing this error even after upgrading to the latest wordpress version

@jeffreyvr
Copy link
Sponsor Contributor

jeffreyvr commented Jan 19, 2021

@freekmurze Unfortunately, with 30cce28#diff-b690787d29e71943d4eb6bf3c04594ce8cfa7cc5bf56b5016c89854fdfe5f54e the fix was overwritten.

Possibly the composer post install script was not executed.

@freekmurze
Copy link
Member

I'll retry by tagging a new version later tonight!

@freekmurze
Copy link
Member

I've tagged a new version. The modified classnames are now written correctly:

public static $defaultCasters = [

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants