10000 fix inconsistencies found with phpstan (#157) · djoos/Symfony-coding-standard@3c94e92 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c94e92

Browse files
mmolldjoos
authored andcommitted
fix inconsistencies found with phpstan (#157)
1 parent 47f8f07 commit 3c94e92

32 files changed

+60
-24
lines changed

Symfony/Sniffs/Commenting/AnnotationsSniff.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
class AnnotationsSniff implements Sniff
3030
{
3131

32+
/**
33+
* Pattern
34+
*
35+
* @var string
36+
*/
3237
private static $_pattern = '/^@([^\\\(]+).*$/i';
3338

3439
/**

Symfony/Sniffs/Commenting/ClassCommentSniff.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
namespace Symfony\Sniffs\Commenting;
1616

17+
use PHP_CodeSniffer\Files\File;
1718
use PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\ClassCommentSniff as Sniff;
1819

1920
/**
@@ -93,6 +94,11 @@ class ClassCommentSniff extends Sniff
9394
),
9495
);
9596

97+
/**
98+
* Blacklisted tags
99+
*
100+
* @var array<string>
101+
*/
96102
protected $blacklist = array(
97103
'@package',
98104
'@subpackage',< F438 /div>

Symfony/Sniffs/Commenting/TypeHintingSniff.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,23 @@
2828
*/
2929
class TypeHintingSniff implements Sniff
3030
{
31+
/**
32+
* Blacklisted types
33+
*
34+
* @var array<string, string>
35+
*/
3136
private static $_blacklist = [
3237
'boolean' => 'bool',
3338
'integer' => 'int',
3439
'double' => 'float',
3540
'real' => 'float',
3641
];
3742

43+
/**
44+
* Cast tokens
45+
*
46+
* @var array
47+
*/
3848
private static $_casts = [
3949
T_BOOL_CAST,
4050
T_INT_CAST,

Symfony/Sniffs/ControlStructure/YodaConditionsSniff.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
*/
2929
class YodaConditionsSniff implements Sniff
3030
{
31+
/**
32+
* Tokens to require Yoda style for
33+
*
34+
* @var array
35+
*/
3136
private $_yodas = array(
3237
T_IS_EQUAL,
3338
T_IS_IDENTICAL,

Symfony/Sniffs/Formatting/BlankLineBeforeReturnSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function process(File $phpcsFile, $stackPtr)
108108
$i++;
109109
}
110110

111-
$phpcsFile->fixer->addNewLine($stackPtr-$i);
111+
$phpcsFile->fixer->addNewline($stackPtr-$i);
112112
$phpcsFile->fixer->endChangeset();
113113
}
114114
}

Symfony/Sniffs/Formatting/ReturnOrThrowSniff.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,21 @@
2828
*/
2929
class ReturnOrThrowSniff implements Sniff
3030
{
31+
/**
32+
* Opener tokens
33+
*
34+
* @var array
35+
*/
3136
private $_openers = [
3237
T_IF,
3338
T_CASE,
3439
];
3540

41+
/**
42+
* Condition tokens
43+
*
44+
* @var array
45+
*/
3646
private $_conditions = [
3747
T_ELSEIF,
3848
T_ELSE,

0 commit comments

Comments
 (0)
0