@@ -1354,6 +1354,10 @@ public function getDeclarationName($stackPtr)
13541354     *         'readonly_token'      => integer,       // The stack pointer to the readonly modifier token. 
13551355     *                                                 // This index will only be set if the property is readonly. 
13561356     * 
1357+      * ... and if the promoted property uses asymmetric visibility, these additional array indexes will also be available: 
1358+      *         'set_visibility'       => string,       // The property set-visibility as declared. 
1359+      *         'set_visibility_token' => integer,      // The stack pointer to the set-visibility modifier token. 
1360+      * 
13571361     * @param int $stackPtr The position in the stack of the function token 
13581362     *                      to acquire the parameters for. 
13591363     * 
@@ -1406,10 +1410,11 @@ public function getMethodParameters($stackPtr)
14061410        $ variadicTokenfalse ;
14071411        $ typeHint'' ;
14081412        $ typeHintTokenfalse ;
1409-         $ typeHintEndTokenfalse ;
1410-         $ nullableTypefalse ;
1411-         $ visibilityTokennull ;
1412-         $ readonlyTokennull ;
1413+         $ typeHintEndTokenfalse ;
1414+         $ nullableTypefalse ;
1415+         $ visibilityTokennull ;
1416+         $ setVisibilityTokennull ;
1417+         $ readonlyTokennull ;
14131418
14141419        for  ($ i$ paramStart$ i$ closer$ i
14151420            // Check to see if this token has a parenthesis or bracket opener. If it does 
@@ -1541,6 +1546,13 @@ public function getMethodParameters($stackPtr)
15411546                    $ visibilityToken$ i
15421547                }
15431548                break ;
1549+             case  T_PUBLIC_SET :
1550+             case  T_PROTECTED_SET :
1551+             case  T_PRIVATE_SET :
1552+                 if  ($ defaultStartnull ) {
1553+                     $ setVisibilityToken$ i
1554+                 }
1555+                 break ;
15441556            case  T_READONLY :
15451557                if  ($ defaultStartnull ) {
15461558                    $ readonlyToken$ i
@@ -1575,16 +1587,21 @@ public function getMethodParameters($stackPtr)
15751587                $ vars$ paramCount'type_hint_end_token ' ] = $ typeHintEndToken
15761588                $ vars$ paramCount'nullable_type ' ]       = $ nullableType
15771589
1578-                 if  ($ visibilityTokennull  || $ readonlyTokennull ) {
1590+                 if  ($ visibilityTokennull  || $ setVisibilityToken  !==  null  ||  $ readonlyTokennull ) {
15791591                    $ vars$ paramCount'property_visibility ' ] = 'public ' ;
15801592                    $ vars$ paramCount'visibility_token ' ]    = false ;
1581-                     $ vars$ paramCount'property_readonly ' ]   = false ;
15821593
15831594                    if  ($ visibilityTokennull ) {
15841595                        $ vars$ paramCount'property_visibility ' ] = $ this tokens [$ visibilityToken'content ' ];
15851596                        $ vars$ paramCount'visibility_token ' ]    = $ visibilityToken
15861597                    }
15871598
1599+                     if  ($ setVisibilityTokennull ) {
1600+                         $ vars$ paramCount'set_visibility ' ]       = $ this tokens [$ setVisibilityToken'content ' ];
1601+                         $ vars$ paramCount'set_visibility_token ' ] = $ setVisibilityToken
1602+                     }
1603+ 
1604+                     $ vars$ paramCount'property_readonly ' ] = false ;
15881605                    if  ($ readonlyTokennull ) {
15891606                        $ vars$ paramCount'property_readonly ' ] = true ;
15901607                        $ vars$ paramCount'readonly_token ' ]    = $ readonlyToken
@@ -1598,21 +1615,22 @@ public function getMethodParameters($stackPtr)
15981615                }
15991616
16001617                // Reset the vars, as we are about to process the next parameter. 
1601-                 $ currVarnull ;
1602-                 $ paramStart$ i1 );
1603-                 $ defaultStartnull ;
1604-                 $ equalTokennull ;
1605-                 $ hasAttributesfalse ;
1606-                 $ passByReferencefalse ;
1607-                 $ referenceTokenfalse ;
1608-                 $ variableLengthfalse ;
1609-                 $ variadicTokenfalse ;
1610-                 $ typeHint'' ;
1611-                 $ typeHintTokenfalse ;
1612-                 $ typeHintEndTokenfalse ;
1613-                 $ nullableTypefalse ;
1614-                 $ visibilityTokennull ;
1615-                 $ readonlyTokennull ;
1618+                 $ currVarnull ;
1619+                 $ paramStart$ i1 );
1620+                 $ defaultStartnull ;
1621+                 $ equalTokennull ;
1622+                 $ hasAttributesfalse ;
1623+                 $ passByReferencefalse ;
1624+                 $ referenceTokenfalse ;
1625+                 $ variableLengthfalse ;
1626+                 $ variadicTokenfalse ;
1627+                 $ typeHint'' ;
1628+                 $ typeHintTokenfalse ;
1629+                 $ typeHintEndTokenfalse ;
1630+                 $ nullableTypefalse ;
1631+                 $ visibilityTokennull ;
1632+                 $ setVisibilityTokennull ;
1633+                 $ readonlyTokennull ;
16161634
16171635                $ paramCount
16181636                break ;
@@ -1827,6 +1845,9 @@ public function getMethodProperties($stackPtr)
18271845     *   array( 
18281846     *    'scope'           => string,        // Public, private, or protected. 
18291847     *    'scope_specified' => boolean,       // TRUE if the scope was explicitly specified. 
1848+      *    'set_scope'       => string|false,  // Scope for asymmetric visibility. 
1849+      *                                        // Either public, private, or protected or 
1850+      *                                        // FALSE if no set scope is specified. 
18301851     *    'is_static'       => boolean,       // TRUE if the static keyword was found. 
18311852     *    'is_readonly'     => boolean,       // TRUE if the readonly keyword was found. 
18321853     *    'is_final'        => boolean,       // TRUE if the final keyword was found. 
@@ -1896,19 +1917,18 @@ public function getMemberProperties($stackPtr)
18961917        }
18971918
18981919        $ valid
1899-             T_PUBLIC     => T_PUBLIC ,
1900-             T_PRIVATE    => T_PRIVATE ,
1901-             T_PROTECTED  => T_PROTECTED ,
1902-             T_STATIC     => T_STATIC ,
1903-             T_VAR        => T_VAR ,
1904-             T_READONLY   => T_READONLY ,
1905-             T_FINAL      => T_FINAL ,
1920+             T_STATIC    => T_STATIC ,
1921+             T_VAR       => T_VAR ,
1922+             T_READONLY  => T_READONLY ,
1923+             T_FINAL     => T_FINAL ,
19061924        ];
19071925
1926+         $ valid$ scopeModifiers
19081927        $ valid$ emptyTokens
19091928
19101929        $ scope'public ' ;
19111930        $ scopeSpecifiedfalse ;
1931+         $ setScopefalse ;
19121932        $ isStaticfalse ;
19131933        $ isReadonlyfalse ;
19141934        $ isFinalfalse ;
@@ -1941,6 +1961,15 @@ public function getMemberProperties($stackPtr)
19411961                $ scope'protected ' ;
19421962                $ scopeSpecifiedtrue ;
19431963                break ;
1964+             case  T_PUBLIC_SET :
1965+                 $ setScope'public ' ;
1966+                 break ;
1967+             case  T_PROTECTED_SET :
1968+                 $ setScope'protected ' ;
1969+                 break ;
1970+             case  T_PRIVATE_SET :
1971+                 $ setScope'private ' ;
1972+                 break ;
19441973            case  T_STATIC :
19451974                $ isStatictrue ;
19461975                break ;
@@ -2004,6 +2033,7 @@ public function getMemberProperties($stackPtr)
20042033        return  [
20052034            'scope '            => $ scope
20062035            'scope_specified '  => $ scopeSpecified
2036+             'set_scope '        => $ setScope
20072037            'is_static '        => $ isStatic
20082038            'is_readonly '      => $ isReadonly
20092039            'is_final '         => $ isFinal
0 commit comments