Skip to content

Commit 35256b6

Browse files
committed
Fixed bug #2663 : Generic.NamingConventions.ConstructorName complains about old constructor in interfaces
1 parent e7b0cce commit 35256b6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
3737
- Fixed bug #2654 : Incorrect indentation for arguments of multiline function calls
3838
- Fixed bug #2656 : Squiz.WhiteSpace.MemberVarSpacing removes comments before first member var during auto fixing
3939
-- Thanks to Juliette Reinders Folmer for the patch
40+
- Fixed bug #2663 : Generic.NamingConventions.ConstructorName complains about old constructor in interfaces
4041
- Fixed bug #2664 : PSR12.Files.OpenTag incorrectly identifies PHP file with only an opening tag
4142
</notes>
4243
<contents>

src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ConstructorNameSniff extends AbstractScopeSniff
3939
*/
4040
public function __construct()
4141
{
42-
parent::__construct([T_CLASS, T_ANON_CLASS, T_INTERFACE], [T_FUNCTION], true);
42+
parent::__construct([T_CLASS, T_ANON_CLASS], [T_FUNCTION], true);
4343

4444
}//end __construct()
4545

src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,14 @@ class Nested extends Another {
8484

8585
public function __construct() {
8686
parent::Another(); // OK.
87-
}
87+
}
8888
};
8989
}
9090

9191
abstract public function nested();
9292
}
93+
94+
interface CustomChildCreator
95+
{
96+
public function customChildCreator($elementName, Project $project);
97+
}

0 commit comments

Comments
 (0)