Skip to content

Commit 75b4c87

Browse files
committed
lol
1 parent 4f4d47e commit 75b4c87

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public function process(File $phpcsFile, $stackPtr): void
110110
);
111111

112112
if (\in_array($tokens[$nsSep]['code'], [T_NAME_FULLY_QUALIFIED, T_NAME_QUALIFIED, T_NAME_RELATIVE], true)) {
113-
114113
$className = $phpcsFile->getTokensAsString(
115114
$nsSep,
116115
($classNameEnd - $nsSep)
@@ -267,9 +266,9 @@ protected function getUseStatements(File $phpcsFile, int $start, int $end): arra
267266
$className = $this->getFullyQualifiedClassName($className);
268267
$tokenContent = $tokens[$aliasNamePtr]['content'];
269268

270-
if(str_contains($tokenContent, '\\')) {
271-
$path = explode('\\', $tokenContent);
272-
$tokenContent = $path[array_key_last($path)];
269+
if (\str_contains($tokenContent, '\\')) {
270+
$path = \explode('\\', $tokenContent);
271+
$tokenContent = $path[\array_key_last($path)];
273272
}
274273

275274
$useStatements[$className] = $tokenContent;
@@ -371,7 +370,7 @@ private function checkShorthandPossible(File $phpcsFile, array $useStatements, s
371370
} elseif ('' !== $namespace && \str_starts_with($fullClassName, $namespace)) {
372371
$replacement = \substr($fullClassName, \strlen($namespace));
373372

374-
$data = [
373+
$data = [
375374
$className,
376375
$replacement,
377376
];

MO4/ruleset.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
<rule ref="Generic.Formatting.SpaceAfterCast"/>
4848
<!-- Align corresponding assignment statement tokens -->
4949
<rule ref="Generic.Formatting.MultipleStatementAlignment">
50-
<properties>
51-
<property name="error" value="true"/>
52-
</properties>
50+
<type>error</type>
5351
</rule>
5452
<!-- Forbid useless inline string concatenation -->
5553
<rule ref="Generic.Strings.UnnecessaryStringConcat">

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
require_once __DIR__.'/../vendor/squizlabs/php_codesniffer/tests/bootstrap.php';
2323

2424
// Add this Standard.
25-
(new PHP_CodeSniffer\Config)->setConfigData(
25+
(new Config())->setConfigData(
2626
'installed_paths',
2727
__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$myStandardName,
2828
true

0 commit comments

Comments
 (0)