Skip to content

Commit ad420e3

Browse files
authored
Update phpcs.xml (#8)
* Update phpcs.xml * Fix up CS as per new rules.
1 parent b424347 commit ad420e3

28 files changed

+51
-51
lines changed

PhpCollective/Sniffs/AbstractSniffs/AbstractSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class AbstractSniff implements Sniff
2424
/**
2525
* @var array<string> These markers must remain as inline comments
2626
*/
27-
protected static $phpStormMarkers = [
27+
protected static array $phpStormMarkers = [
2828
'@noinspection',
2929
];
3030

@@ -156,7 +156,7 @@ protected function getClassName(File $phpCsFile): string
156156
*
157157
* @return bool
158158
*/
159-
protected function contains(File $phpcsFile, $search, int $start, int $end, bool $skipNested = true): bool
159+
protected function contains(File $phpcsFile, array|string|int $search, int $start, int $end, bool $skipNested = true): bool
160160
{
161161
$tokens = $phpcsFile->getTokens();
162162

PhpCollective/Sniffs/Commenting/DisallowArrayTypeHintSyntaxSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class DisallowArrayTypeHintSyntaxSniff implements Sniff
4646
/**
4747
* @var array<string>
4848
*/
49-
public $traversableTypeHints = [];
49+
public array $traversableTypeHints = [];
5050

5151
/**
5252
* @var array<string, int>|null
5353
*/
54-
protected $normalizedTraversableTypeHints;
54+
protected ?array $normalizedTraversableTypeHints = null;
5555

5656
/**
5757
* @inheritDoc
@@ -204,14 +204,14 @@ public function getArrayTypeNodes(Node $node): array
204204
/**
205205
* @var list<\PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode>
206206
*/
207-
private $nodes = [];
207+
private array $nodes = [];
208208

209209
/**
210210
* @param \PHPStan\PhpDocParser\Ast\Node $node
211211
*
212212
* @return \PHPStan\PhpDocParser\Ast\Node|list<\PHPStan\PhpDocParser\Ast\Node>|\PHPStan\PhpDocParser\Ast\NodeTraverser|int|null
213213
*/
214-
public function enterNode(Node $node)
214+
public function enterNode(Node $node): Node|array|\PHPStan\PhpDocParser\Ast\NodeTraverser|int|null
215215
{
216216
if ($node instanceof ArrayTypeNode) {
217217
$this->nodes[] = $node;

PhpCollective/Sniffs/Commenting/DocBlockReturnVoidSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DocBlockReturnVoidSniff extends AbstractSniff
2323
/**
2424
* @var array<string>
2525
*/
26-
protected $ignored = [
26+
protected array $ignored = [
2727
'__construct',
2828
'__destruct',
2929
];

PhpCollective/Sniffs/Commenting/DocBlockTagOrderSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class DocBlockTagOrderSniff extends AbstractSniff
2727
*
2828
* @var array<int, string>
2929
*/
30-
protected $order = [
30+
protected array $order = [
3131
'@deprecated',
3232
'@see',
3333
'@param',

PhpCollective/Sniffs/Commenting/DocBlockTypeOrderSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DocBlockTypeOrderSniff extends AbstractSniff
2828
*
2929
* @var array<string>
3030
*/
31-
protected $sortMap = [
31+
protected array $sortMap = [
3232
'void',
3333
'null',
3434
'false',

PhpCollective/Sniffs/Commenting/DocCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DocCommentSniff extends AbstractSniff
2424
/**
2525
* @var array<string>
2626
*/
27-
public $supportedTokenizers = [
27+
public array $supportedTokenizers = [
2828
'PHP',
2929
'JS',
3030
];

PhpCollective/Sniffs/Commenting/FileDocBlockSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FileDocBlockSniff extends AbstractSniff
2121
*
2222
* @var array<string>
2323
*/
24-
protected $licenseMap = [];
24+
protected array $licenseMap = [];
2525

2626
/**
2727
* @inheritDoc

PhpCollective/Sniffs/Commenting/FullyQualifiedClassNameInDocBlockSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class FullyQualifiedClassNameInDocBlockSniff implements Sniff
2626
/**
2727
* @var array<string>
2828
*/
29-
public static $whitelistedTypes = [
29+
public static array $whitelistedTypes = [
3030
'string', 'int', 'integer', 'float', 'bool', 'boolean', 'resource', 'null', 'void', 'callable',
3131
'array', 'iterable', 'mixed', 'object', 'false', 'true', 'self', 'static', '$this',
3232
];
3333

3434
/**
3535
* @var array<string>
3636
*/
37-
public static $whitelistedStartsWithTypes = ['array<', 'iterable<', 'array{'];
37+
public static array $whitelistedStartsWithTypes = ['array<', 'iterable<', 'array{'];
3838

3939
/**
4040
* @inheritDoc

PhpCollective/Sniffs/Commenting/TypeHintSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TypeHintSniff extends AbstractSniff
4343
/**
4444
* @var array<string>
4545
*/
46-
protected static $typeHintTags = [
46+
protected static array $typeHintTags = [
4747
'@var',
4848
'@psalm-var',
4949
'@phpstan-var',
@@ -62,7 +62,7 @@ class TypeHintSniff extends AbstractSniff
6262
*
6363
* @var array<string>
6464
*/
65-
protected static $sortMap = [
65+
protected static array $sortMap = [
6666
'mixed',
6767
'callable',
6868
'resource',

PhpCollective/Sniffs/ControlStructures/DisallowCloakingCheckSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DisallowCloakingCheckSniff extends AbstractSniff
2222
*
2323
* @var bool
2424
*/
25-
public $strict = false;
25+
public bool $strict = false;
2626

2727
/**
2828
* @inheritDoc
@@ -35,7 +35,7 @@ public function register(): array
3535
/**
3636
* @var array<string>
3737
*/
38-
protected $validTokens = [
38+
protected array $validTokens = [
3939
T_CLOSE_SQUARE_BRACKET,
4040
T_CLOSE_CURLY_BRACKET,
4141
];

0 commit comments

Comments
 (0)