From 42054039eb8b9d8e67d22a3c406a54ebf43cf39d Mon Sep 17 00:00:00 2001 From: Riccardo Tempesta Date: Thu, 14 Jun 2018 16:55:51 +0200 Subject: [PATCH] FIX for apparently random API failures while using array types If the webapi Interface class was using CR+LF end-of-line, TypeProcessor class was not able to determine the class name when an array was used. --- lib/internal/Magento/Framework/Reflection/TypeProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Reflection/TypeProcessor.php b/lib/internal/Magento/Framework/Reflection/TypeProcessor.php index 80285853b43c6..cf2f8bf3369ec 100644 --- a/lib/internal/Magento/Framework/Reflection/TypeProcessor.php +++ b/lib/internal/Magento/Framework/Reflection/TypeProcessor.php @@ -523,7 +523,7 @@ public function getParamType(ParameterReflection $param) if ($type == 'array') { // try to determine class, if it's array of objects $docBlock = $param->getDeclaringFunction()->getDocBlock(); - $pattern = "/\@param\s+([\w\\\_]+\[\])\s+\\\${$param->getName()}\n/"; + $pattern = "/\@param\s+([\w\\\_]+\[\])\s+\\\${$param->getName()}[\n\r]/"; $matches = []; if (preg_match($pattern, $docBlock->getContents(), $matches)) { return $matches[1];