From 32e37dbd8aec9286d01a752b34af25ef1b4db4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Miko=C5=82ajczuk?= Date: Mon, 3 Feb 2014 16:57:46 +0100 Subject: [PATCH] Don't try to call class with custom handlers. With JMS Serializer you can set up own type and use it later with custom handler for this property - Parser allways try to call that custom property type like a class. This fix that. --- Parser/JmsMetadataParser.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Parser/JmsMetadataParser.php b/Parser/JmsMetadataParser.php index b2c3bac..8af8432 100644 --- a/Parser/JmsMetadataParser.php +++ b/Parser/JmsMetadataParser.php @@ -184,6 +184,14 @@ class JmsMetadataParser implements ParserInterface ); } + // we can use type property also for custom handlers, then we don't have here real class name + if (!class_exists($type)) { + return array( + 'normalized' => sprintf("custom handler result for (%s)", $type), + 'class' => null + ); + } + // if we got this far, it's a general class name $exp = explode("\\", $type);