Skip to content

Commit d4dc874

Browse files
committed
Fix FQCN topic.
1 parent 76b3bc9 commit d4dc874

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

PhpCollective/Sniffs/Classes/Psr4/AutoloadabilityInspector.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
namespace PhpCollective\Sniffs\Classes\Psr4;
1111

12+
use const PATHINFO_DIRNAME;
13+
use const PATHINFO_FILENAME;
14+
1215
class AutoloadabilityInspector
1316
{
1417
/**
@@ -110,10 +113,10 @@ protected function guessRelativeFileName(
110113
protected function guessRelativeClassName(string $relativeFileName): string
111114
{
112115
$basename = basename($relativeFileName);
113-
$filename = pathinfo($relativeFileName, \PATHINFO_FILENAME);
116+
$filename = pathinfo($relativeFileName, PATHINFO_FILENAME);
114117
$dirname = $basename === $relativeFileName ?
115118
'' :
116-
pathinfo($relativeFileName, \PATHINFO_DIRNAME) . '/';
119+
pathinfo($relativeFileName, PATHINFO_DIRNAME) . '/';
117120

118121
return str_replace('/', '\\', $dirname) . $filename;
119122
}

PhpCollective/Sniffs/Classes/Psr4Sniff.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
use RuntimeException;
2020
use SlevomatCodingStandard\Helpers\ClassHelper;
2121
use SlevomatCodingStandard\Helpers\TokenHelper;
22+
use const T_CLASS;
23+
use const T_INTERFACE;
24+
use const T_STRING;
25+
use const T_TRAIT;
2226

2327
class Psr4Sniff implements Sniff
2428
{
@@ -63,7 +67,7 @@ class Psr4Sniff implements Sniff
6367
*/
6468
public function register(): array
6569
{
66-
return [\T_CLASS, \T_INTERFACE, \T_TRAIT];
70+
return [T_CLASS, T_INTERFACE, T_TRAIT];
6771
}
6872

6973
/**
@@ -162,6 +166,6 @@ protected function getClassNameDeclarationPosition(
162166
File $phpcsFile,
163167
int $typePointer,
164168
): ?int {
165-
return TokenHelper::findNext($phpcsFile, \T_STRING, $typePointer + 1);
169+
return TokenHelper::findNext($phpcsFile, T_STRING, $typePointer + 1);
166170
}
167171
}

PhpCollective/ruleset.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
<property name="allowFallbackGlobalConstants" value="true"/>
3131
</properties>
3232
</rule>
33-
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName">
34-
<severity>0</severity>
35-
</rule>
3633

3734
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
3835
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>

0 commit comments

Comments
 (0)