From 5541412e6901615f97907fa8e6613efb9d7e3e01 Mon Sep 17 00:00:00 2001 From: Ener-Getick Date: Mon, 30 Nov 2015 19:35:49 +0100 Subject: [PATCH] Fix FOSRestBundle compatibility --- Extractor/Handler/FosRestHandler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Extractor/Handler/FosRestHandler.php b/Extractor/Handler/FosRestHandler.php index 1fe3659..7c22694 100644 --- a/Extractor/Handler/FosRestHandler.php +++ b/Extractor/Handler/FosRestHandler.php @@ -33,7 +33,7 @@ class FosRestHandler implements HandlerInterface $requirements = $this->handleRequirements($annot->requirements); $data = array( 'required' => $annot->strict && $annot->nullable === false && $annot->default === null, - 'dataType' => $requirements.($annot->array ? '[]' : ''), + 'dataType' => $requirements.((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''), 'actualType' => $this->inferType($requirements), 'subType' => null, 'description' => $annot->description, @@ -46,19 +46,19 @@ class FosRestHandler implements HandlerInterface } elseif ($annot instanceof QueryParam) { if ($annot->strict && $annot->nullable === false && $annot->default === null) { $annotation->addRequirement($annot->name, array( - 'requirement' => $this->handleRequirements($annot->requirements).($annot->array ? '[]' : ''), + 'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''), 'dataType' => '', 'description' => $annot->description, )); } elseif ($annot->default !== null) { $annotation->addFilter($annot->name, array( - 'requirement' => $this->handleRequirements($annot->requirements).($annot->array ? '[]' : ''), + 'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''), 'description' => $annot->description, 'default' => $annot->default, )); } else { $annotation->addFilter($annot->name, array( - 'requirement' => $this->handleRequirements($annot->requirements).($annot->array ? '[]' : ''), + 'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''), 'description' => $annot->description, )); }