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

FP on S1185 when a method defines default values for parameters

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4
    • Component/s: Rules
    • Labels:
      None

      Description

      The implementation of RSPEC-1185 ("Overriding methods should do more than simply call the same method in the super class") should not raise an issue when a method defines default values for its parameters, e.g.:

      class A {
        public function __construct($param) {
        }
      }
      
      class A1 extends A {
        public function __construct($param = 0) {
          parent::__construct($param);
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nils.werner Nils Werner
                Reporter:
                pierre-yves.nicolas Pierre-Yves Nicolas
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: