File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,6 +331,14 @@ impl Declaration {
331331 }
332332 }
333333
334+ #[ must_use]
335+ pub fn as_singleton_class ( & self ) -> Option < & Namespace > {
336+ match self {
337+ Declaration :: Namespace ( ns @ Namespace :: SingletonClass ( _) ) => Some ( ns) ,
338+ _ => None ,
339+ }
340+ }
341+
334342 #[ must_use]
335343 pub fn as_namespace_mut ( & mut self ) -> Option < & mut Namespace > {
336344 match self {
Original file line number Diff line number Diff line change @@ -179,6 +179,18 @@ impl Definition {
179179 }
180180 }
181181
182+ #[ must_use]
183+ pub fn has_extend_mixin ( & self ) -> bool {
184+ let mixins = match self {
185+ Definition :: Class ( definition) => definition. mixins ( ) ,
186+ Definition :: SingletonClass ( definition) => definition. mixins ( ) ,
187+ Definition :: Module ( definition) => definition. mixins ( ) ,
188+ _ => return false ,
189+ } ;
190+
191+ mixins. iter ( ) . any ( |mixin| matches ! ( mixin, Mixin :: Extend ( _) ) )
192+ }
193+
182194 #[ must_use]
183195 pub fn is_deprecated ( & self ) -> bool {
184196 all_definitions ! ( self , it => it. flags( ) . is_deprecated( ) )
You can’t perform that action at this time.
0 commit comments