Uploaded image for project: 'SonarPHP'
  1. SonarPHP
  2. SONARPHP-598

False Positive SelfKeywordUsage (S2037): methods which cannot be overridden

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.8
    • Component/s: Rules
    • Labels:
      None

      Description

      The implementation of RSPEC-2037 "Static members should be referenced with "static::"" should not report issues on calls to methods which cannot be overridden, in particular when the class or the method is declared as final, for example:

      final class A {
        public static function foo() {
          self::bar();
        }
        public static function bar() {
          echo "bar";
        }
      }
      

        Attachments

          Activity

            People

            Assignee:
            elena.vilchik Elena Vilchik
            Reporter:
            pierre-yves.nicolas Pierre-Yves Nicolas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: