Symfony yaml parser not working


I have problems with spyc in my CMS which uses its own autoloader.
That’s why I wanted to switch to the Symfony Yaml Parser.

I installed device detector via composer and deleted the mustangostang/spyc folder in /vendor.
I then tried to switch to Symfony like this:

use DeviceDetector\ClientHints;
use DeviceDetector\DeviceDetector;
use DeviceDetector\Yaml\Symfony as DeviceDetectorSymfonyYamlParser;


$this->DeviceDetector = new DeviceDetector($this->userAgent, $clientHints);
$this->DeviceDetector->setYamlParser(new DeviceDetectorSymfonyYamlParser());
echo $this->DeviceDetector->getYamlParser()) # prints DeviceDetector\Yaml\Symfony
echo 'A'; # is printed
echo 'B'; # is NOT printed

Instead a Class 'Spyc' not found error is thrown.
Any ideas what might be wrong with this approach?

Thanks and kind regards

Hi @andileni
I don’t know this, but:

  1. there is a closing parenthesis in excess in: echo $this->DeviceDetector->getYamlParser())
  2. I would have done:
echo 'A';
echo 'B';

Thanks for your reply. There was a bug in the source which was fixed in 6.1.1.
Thanks nonetheless!