From 3c1c702215c48eb7ef2b4401cad9ed7db0250228 Mon Sep 17 00:00:00 2001 From: Jan Skrasek Date: Sat, 23 Mar 2024 16:59:29 +0100 Subject: [PATCH] fix relationship detection when the datetime property immediatelly ends with newline --- .../EntityRelationshipPropertyReflectionExtension.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }