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

RSPEC-1603 should not raise issues on namespaced classes

    XMLWordPrintable

    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

      In the following code, the implementation of RSPEC-1603 should not raise an issue because the class has a namespace and PHP therefore does not consider that the foo method can be a constructor:

      <?php
      namespace Bar;
      class Foo {
          function foo() {
          }
      }
      

      PHP would issue a warning on that code if there was no namespace declaration.
      See PHP documentation for constructors.

        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: