File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -969,6 +969,24 @@ private function getReadVisiblityForMethod(\ReflectionMethod $reflectionMethod):
969
969
970
970
private function getWriteVisiblityForProperty (\ReflectionProperty $ reflectionProperty ): string
971
971
{
972
+ // PHP 8.4: Property hooks
973
+ if (method_exists ($ reflectionProperty , 'isVirtual ' ) && method_exists ($ reflectionProperty , 'hasHook ' )) {
974
+ if ($ reflectionProperty ->isVirtual () && !$ reflectionProperty ->hasHook (\PropertyHookType::Set)) {
975
+ return PropertyWriteInfo::VISIBILITY_PRIVATE ;
976
+ }
977
+ }
978
+
979
+ // PHP 8.4: Asymmetric visibility
980
+ if (method_exists ($ reflectionProperty , 'isPrivateSet ' ) && method_exists ($ reflectionProperty , 'isProtectedSet ' )) {
981
+ if ($ reflectionProperty ->isPrivateSet ()) {
982
+ return PropertyWriteInfo::VISIBILITY_PRIVATE ;
983
+ }
984
+
985
+ if ($ reflectionProperty ->isProtectedSet ()) {
986
+ return PropertyWriteInfo::VISIBILITY_PROTECTED ;
987
+ }
988
+ }
989
+
972
990
if ($ reflectionProperty ->isPrivate ()) {
973
991
return PropertyWriteInfo::VISIBILITY_PRIVATE ;
974
992
}
You can’t perform that action at this time.
0 commit comments