File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Inpsyde/Sniffs/CodeQuality Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -107,8 +107,10 @@ private function checkPsr4(
107
107
108
108
list (, $ namespace ) = PhpcsHelpers::findNamespace ($ file , $ position );
109
109
$ namespace = is_string ($ namespace ) ? "{$ namespace }\\" : '' ;
110
+ $ namespace = rtrim ($ namespace , '\\' );
111
+
112
+ $ fullyQualifiedName = $ namespace . "\\{$ className }" ;
110
113
111
- $ fullyQualifiedName = $ namespace . $ className ;
112
114
foreach ($ this ->exclude as $ excluded ) {
113
115
if (strpos ($ fullyQualifiedName , $ excluded ) === 0 ) {
114
116
return ;
@@ -130,6 +132,7 @@ private function checkPsr4(
130
132
}
131
133
132
134
$ relativePath = array_pop ($ folderSplit );
135
+
133
136
if (basename ($ relativePath ) !== "{$ className }.php " ) {
134
137
continue ;
135
138
}
Original file line number Diff line number Diff line change @@ -23,6 +23,15 @@ class ThisIsWrong
23
23
}
24
24
}
25
25
26
+ namespace Inpsyde \CodingStandard \Tests \fixtures \Foo {
27
+
28
+ // @phpcsErrorCodeOnNextLine InvalidPSR4
29
+ class Psr4Fixture
30
+ {
31
+
32
+ }
33
+ }
34
+
26
35
namespace Inpsyde \CodingStandard \Foo \Bar {
27
36
28
37
// @phpcsErrorCodeOnNextLine InvalidPSR4
@@ -47,4 +56,4 @@ interface Psr4Fixture
47
56
{
48
57
49
58
}
50
- }
59
+ }
You can’t perform that action at this time.
0 commit comments