Skip to content

Commit 1fbe30c

Browse files
authored
Merge pull request #7 from vossik/update
Update
2 parents dfaa823 + e8267fd commit 1fbe30c

File tree

9 files changed

+325
-38
lines changed

9 files changed

+325
-38
lines changed

.github/workflows/php.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '7.4'
19+
php-version: '8.0'
2020
env:
2121
update: true
2222

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/*
2+
vendor/*

InfinityloopCodingStandard/Sniffs/Classes/FinalClassVisibilitySniff.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $variablePointer
7272
$phpcsFile->fixer->endChangeset();
7373
}
7474

75-
/**
76-
* @return int|bool|null
77-
*/
78-
private function findVisibilityPointer(\PHP_CodeSniffer\Files\File $phpcsFile, $variablePointer)
75+
private function findVisibilityPointer(\PHP_CodeSniffer\Files\File $phpcsFile, $variablePointer) : int|bool|null
7976
{
8077
$visibilityPointer = $phpcsFile->findPrevious([\T_PUBLIC, \T_PROTECTED, \T_PRIVATE], $variablePointer);
8178

InfinityloopCodingStandard/Sniffs/ControlStructures/SwitchCommentSpacingSniff.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,7 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr) : voi
127127
}
128128
}
129129

130-
/**
131-
* @param \PHP_CodeSniffer\Files\File $phpcsFile
132-
* @param int|bool|null $stackPtr
133-
* @param int|null $end
134-
* @return bool|int
135-
*/
136-
private function findNextCase(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr, ?int $end = null)
130+
private function findNextCase(\PHP_CodeSniffer\Files\File $phpcsFile, int|bool|null $stackPtr, ?int $end = null) : bool|int
137131
{
138132
$tokens = $phpcsFile->getTokens();
139133

InfinityloopCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ public function process(\PHP_CodeSniffer\Files\File $phpcsFile, $usePointer) : v
3131
$tokens = $phpcsFile->getTokens();
3232
$nextTokenPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1);
3333
\assert(\is_int($nextTokenPointer));
34-
34+
3535
if ($tokens[$nextTokenPointer]['code'] === \T_STRING
3636
&& ($tokens[$nextTokenPointer]['content'] === 'function' || $tokens[$nextTokenPointer]['content'] === 'const')
3737
) {
3838
$nextTokenPointer = TokenHelper::findNextEffective($phpcsFile, $nextTokenPointer + 1);
3939
\assert(\is_int($nextTokenPointer));
4040
}
41-
41+
4242
if ($tokens[$nextTokenPointer]['code'] === \T_NS_SEPARATOR) {
4343
return;
4444
}
45-
45+
4646
$fix = $phpcsFile->addFixableError(
4747
'Use statement must start with a backslash.',
4848
$nextTokenPointer,
4949
self::CODE_DOES_NOT_START_WITH_BACKSLASH,
5050
);
51-
51+
5252
if (!$fix) {
5353
return;
5454
}
55-
55+
5656
$phpcsFile->fixer->beginChangeset();
5757
$phpcsFile->fixer->addContentBefore($nextTokenPointer, '\\');
5858
$phpcsFile->fixer->endChangeset();

InfinityloopCodingStandard/Sniffs/WhiteSpace/MemberVarSpacingSniff.php

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class MemberVarSpacingSniff extends \PHP_CodeSniffer\Sniffs\AbstractVariableSnif
1414
* @return int|void
1515
*/
1616
//@phpcs:ignore Squiz.Commenting.FunctionComment.ScalarTypeHintMissing
17+
//@phpcs:ignore SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
1718
protected function processMemberVar(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr)
1819
{
1920
$tokens = $phpcsFile->getTokens();

InfinityloopCodingStandard/ruleset.xml

+1-17
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
<arg value="s"/> <!-- Display name of sniff used to detect/fix issue -->
99
<arg value="p"/> <!-- Display progress -->
1010
<config name="installed_paths" value="./../../slevomat/coding-standard,./../../infinityloop-dev/coding-standard"/>
11-
<file>./../../../../../../app</file> <!-- Files to check - relative from ruleset location -->
12-
<file>./../../../../../../bin</file>
13-
<file>./../../../../../../tests</file>
14-
<file>./../../../../../../www</file>
1511
<exclude-pattern>*/tests/*/data/*</exclude-pattern>
1612
<exclude-pattern>*/vendor/*</exclude-pattern>
1713
<exclude-pattern>*/vendor-bin/*</exclude-pattern>
@@ -255,7 +251,6 @@
255251
<property name="linesCountBeforeClosingBrace" value="0"/>
256252
</properties>
257253
</rule>
258-
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>
259254
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
260255
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
261256
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming">
@@ -423,17 +418,6 @@
423418
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
424419
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
425420
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
426-
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword">
427-
<properties>
428-
<property name="keywordsToCheck" type="array">
429-
<element value="T_EXTENDS"/>
430-
<element value="T_IMPLEMENTS"/>
431-
<element value="T_USE"/>
432-
<element value="T_NEW"/>
433-
<element value="T_THROW"/>
434-
</property>
435-
</properties>
436-
</rule>
437421
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
438422
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
439423
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
@@ -484,7 +468,7 @@
484468
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
485469
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
486470
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
487-
<rule ref="SlevomatCodingStandard.Functions.TrailingCommaInCall"/>
471+
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
488472
<rule ref="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator"/>
489473
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
490474
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"minimum-stability": "dev",
77
"prefer-stable": true,
88
"require": {
9-
"php": ">=7.4",
10-
"squizlabs/php_codesniffer": "~3.5.3",
11-
"slevomat/coding-standard": "~6.3.8"
9+
"php": "^8.0",
10+
"squizlabs/php_codesniffer": "~3.6.0",
11+
"slevomat/coding-standard": "~7.0.8"
1212
},
1313
"require-dev": {
1414
"bamarni/composer-bin-plugin": "^1.2"
1515
},
1616
"scripts": {
17-
"codestyle": "phpcs --standard=vendor-bin/phpcs/vendor/infinityloop-dev/coding-standard/InfinityloopCodingStandard/ruleset.xml --extensions=php InfinityloopCodingStandard"
17+
"codestyle": "phpcs --standard=InfinityloopCodingStandard --extensions=php InfinityloopCodingStandard"
1818
},
1919
"autoload": {
2020
"psr-4": {

0 commit comments

Comments
 (0)