diff --git a/src/Reflection/EntityRelationshipPropertyReflectionExtension.php b/src/Reflection/EntityRelationshipPropertyReflectionExtension.php index 58a3c8d..117cc3e 100644 --- a/src/Reflection/EntityRelationshipPropertyReflectionExtension.php +++ b/src/Reflection/EntityRelationshipPropertyReflectionExtension.php @@ -34,7 +34,8 @@ public function hasProperty(ClassReflection $classReflection, string $propertyNa return false; } - $hasRelationship = preg_match('#\$' . $propertyName . '\s(?:[^\n]*)\{[1m]:1.+\}.*$#m', $phpDoc) === 1; + $regexp = '#\$' . preg_quote($propertyName, '#') . '[^\n]+\{[1m]:1.+}.*$#m'; + $hasRelationship = preg_match($regexp, $phpDoc) === 1; return $hasRelationship; }