Commit 98358fd2 authored by Klaus Purer's avatar Klaus Purer
Browse files

fix(FunctionComment): Also report return tag format errors for methods with...

fix(FunctionComment): Also report return tag format errors for methods with the same name as the class (#3013953)
parent c3ffa574
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ class FunctionCommentSniff implements Sniff
        }//end foreach

        $type = null;
        if ($isSpecialMethod === false && $methodName !== $className) {
        if ($isSpecialMethod === false) {
            if ($return !== null) {
                $type = trim($tokens[($return + 2)]['content']);
                if (empty($type) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) {
+1 −0
Original line number Diff line number Diff line
@@ -481,6 +481,7 @@ class Small {
   * Return tag should be allowed here.
   *
   * @return string
   *   Something small.
   */
  public function small() {
    return 'string';
+1 −0
Original line number Diff line number Diff line
@@ -507,6 +507,7 @@ class Small {
   * Return tag should be allowed here.
   *
   * @return string
   *   Something small.
   */
  public function small() {
    return 'string';