/** Parse the reflection doc comment @throws Exception object @param Reflection $reflection @static @return array */ public static function parser($reflection) { try { $rawAnnotation = $reflection->getDocComment(); unset($reflection); $newArrAnnotation = []; $rawAnnotation = str_replace("/**", "", $rawAnnotation); $rawAnnotation = str_replace("*/", "", $rawAnnotation); $parsedAnnotation = explode("\r", $rawAnnotation); if (count($parsedAnnotation) > 0) { foreach ($parsedAnnotation as $anno) { $trimAnno = trim($anno); if (!empty($trimAnno) && strpos($trimAnno, "!@") !== false) { $expodedNewArr = explode("=", str_replace("!@", "", $trimAnno)); if (isset($expodedNewArr[0]) && isset($expodedNewArr[1])) { $newArrAnnotation[trim($expodedNewArr[0])] = trim($expodedNewArr[1]); } } } } return $newArrAnnotation; } catch (Exception $e) { throw $e; } }