Skip to content

Commit bff45d9

Browse files
committed
Fixes based on PHPStan output (ref #2201)
1 parent 6ff6b5e commit bff45d9

File tree

11 files changed

+15
-33
lines changed

11 files changed

+15
-33
lines changed

src/Files/DummyFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct($content, Ruleset $ruleset, Config $config)
5454
$path = $config->stdinPath;
5555
}
5656

57-
return parent::__construct($path, $ruleset, $config);
57+
parent::__construct($path, $ruleset, $config);
5858

5959
}//end __construct()
6060

src/Files/File.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,18 +1120,6 @@ public function getWarningCount()
11201120
}//end getWarningCount()
11211121

11221122

1123-
/**
1124-
* Returns the number of successes recorded.
1125-
*
1126-
* @return int
1127-
*/
1128-
public function getSuccessCount()
1129-
{
1130-
return $this->successCount;
1131-
1132-
}//end getSuccessCount()
1133-
1134-
11351123
/**
11361124
* Returns the number of fixable errors/warnings raised.
11371125
*

src/Files/LocalFile.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($path, Ruleset $ruleset, Config $config)
5959

6060
$this->reloadContent();
6161

62-
return parent::__construct($this->path, $ruleset, $config);
62+
parent::__construct($this->path, $ruleset, $config);
6363

6464
}//end __construct()
6565

@@ -88,7 +88,8 @@ public function process()
8888
}
8989

9090
if ($this->configCache['cache'] === false) {
91-
return parent::process();
91+
parent::process();
92+
return;
9293
}
9394

9495
$hash = md5_file($this->path);

src/Ruleset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Ruleset
6767
* The key is the fully qualified name of the sniff class
6868
* and the value is the sniff object.
6969
*
70-
* @var array<string, \PHP_CodeSniffer\Sniff>
70+
* @var array<string, \PHP_CodeSniffer\Sniffs\Sniff>
7171
*/
7272
public $sniffs = [];
7373

@@ -87,7 +87,7 @@ class Ruleset
8787
* The key is the token name being listened for and the value
8888
* is the sniff object.
8989
*
90-
* @var array<int, \PHP_CodeSniffer\Sniff>
90+
* @var array<int, \PHP_CodeSniffer\Sniffs\Sniff>
9191
*/
9292
public $tokenListeners = [];
9393

src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ public function process(File $phpcsFile, $stackPtr)
13721372
* @param int $change The difference in length between
13731373
* the old and new indent.
13741374
*
1375-
* @return void
1375+
* @return bool
13761376
*/
13771377
protected function adjustIndent(File $phpcsFile, $stackPtr, $length, $change)
13781378
{

src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function process(File $phpcsFile, $stackPtr)
176176
* @param array $tokens The stack of tokens that make up
177177
* the file.
178178
*
179-
* @return void
179+
* @return bool
180180
*/
181181
public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens)
182182
{

src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function process(File $phpcsFile, $stackPtr)
214214
* @param array $tokens The stack of tokens that make up
215215
* the file.
216216
*
217-
* @return void
217+
* @return bool
218218
*/
219219
public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens)
220220
{

src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
6565
if (empty($propertyInfo) === true) {
6666
return;
6767
}
68-
} catch (Exception $e) {
68+
} catch (\Exception $e) {
6969
// Turns out not to be a property after all.
7070
return;
7171
}

src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function process(File $phpcsFile, $stackPtr)
274274
* @param int $stackPtr The position of the current token in
275275
* the stack passed in $tokens.
276276
*
277-
* @return void
277+
* @return bool
278278
*/
279279
private function shouldIgnoreUse($phpcsFile, $stackPtr)
280280
{

src/Tokenizers/CSS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct($content, Config $config, $eolChar='\n')
3535
throw new TokenizerException('File appears to be minified and cannot be processed');
3636
}
3737

38-
return parent::__construct($content, $config, $eolChar);
38+
parent::__construct($content, $config, $eolChar);
3939

4040
}//end __construct()
4141

0 commit comments

Comments
 (0)