/** * @param string $annotation * @param string $annotationName * @return MagicPropertyReflectionInterface[] */ private function processMagicPropertyAnnotation($annotation, $annotationName) { if (!preg_match(self::PATTERN_PROPERTY, $annotation, $matches)) { return []; } list(, $typeHint, $name, $shortDescription) = $matches; $startLine = $this->getStartLine($annotation); $properties = []; $properties[$name] = $this->reflectionFactory->createPropertyMagic(['name' => $name, 'typeHint' => $typeHint, 'shortDescription' => str_replace("\n", ' ', $shortDescription), 'startLine' => $startLine, 'endLine' => $startLine + substr_count($annotation, "\n"), 'readOnly' => $annotationName === 'property-read', 'writeOnly' => $annotationName === 'property-write', 'declaringClass' => $this->classReflection]); return $properties; }