1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do we determine if a class is static and cannot be extended?

Discussion in 'XenForo Development Discussions' started by AndyB, Sep 25, 2013.

  1. AndyB

    AndyB Well-Known Member

    How can we determine if a class is static and cannot be extended?

    Is the only way to determine if a class is static is to create an add-on just to find out it doesn't work?
     
  2. Jeremy

    Jeremy Well-Known Member

    Look in the class and see how the functions are defined. They'll have the keyword static in them.
     
    AndyB likes this.
  3. AndyB

    AndyB Well-Known Member

    Thank you kindly for the information, Jeremy.

    So if I find any functions within a class that are static, the class is considered static and cannot be extended?
     
  4. Jeremy

    Jeremy Well-Known Member

    No, that function is static. If the full class is static (ie, all functions) you have a pretty good bet of not extending it.
     
    tyteen4a03 and AndyB like this.
  5. Marcus

    Marcus Well-Known Member

    Are all classes which are in files directly in library/XenForo not extendable?
     

Share This Page