Skip to content

Commit 027879f

Browse files
authored
Merge pull request #31 from exussum12/typeErrors
Fix some type errors
2 parents a179061 + 2b010cb commit 027879f

11 files changed

+28
-23
lines changed

src/ArgParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function splitArg($arg)
5555
}
5656

5757
/**
58-
* @param $name
58+
* @param string $name
5959
* @return string
6060
*/
6161
protected function getAdjustedArg($name)

src/CheckstyleLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public static function getDescription()
7676
}
7777

7878
/**
79-
* @param $reader
80-
* @param $currentFile
79+
* @param XMLReader $reader
80+
* @param string $currentFile
8181
*/
8282
protected function handleErrors($reader, $currentFile)
8383
{
@@ -90,8 +90,8 @@ protected function handleErrors($reader, $currentFile)
9090
}
9191

9292
/**
93-
* @param $reader
94-
* @param $currentFile
93+
* @param XMLReader $reader
94+
* @param string $currentFile
9595
* @return string
9696
*/
9797
protected function handleFile($reader, $currentFile)

src/CloverLoader.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ protected function checkForNewFiles($reader, $currentFile)
8989
}
9090

9191
/**
92-
* @param $reader
93-
* @param $currentFile
92+
* @param XMLReader $reader
93+
* @param string $currentFile
9494
*/
9595
protected function addLine($reader, $currentFile)
9696
{
@@ -102,6 +102,10 @@ protected function addLine($reader, $currentFile)
102102
= $covered ?: "No test coverage";
103103
}
104104

105+
/**
106+
* @param XMLReader $reader
107+
* @param string $currentFile
108+
*/
105109
protected function handleStatement($reader, $currentFile)
106110
{
107111
if ((

src/CodeClimateLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class CodeClimateLoader implements FileChecker
1010
{
1111
/**
12-
* @var string
12+
* @var array
1313
*/
1414
protected $file;
1515

src/DiffLineHandle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abstract class DiffLineHandle
55
{
66
protected $diffFileState;
77

8-
public function __construct(diffFileState $diff)
8+
public function __construct(DiffFileState $diff)
99
{
1010
$this->diffFileState = $diff;
1111
}

src/FileChecker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function parseLines();
1616
* Method to determine if the line is valid in the context
1717
* returning null does not include the line in the stats
1818
* Returns an array containing errors on a certain line - empty array means no errors
19-
* @param $file
20-
* @param $lineNumber
19+
* @param string $file
20+
* @param int $lineNumber
2121
* @return array|null
2222
*/
2323
public function getErrorsOnLine($file, $lineNumber);

src/FileMatchers/EndsWith.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function match($needle, array $haystack)
2727

2828
/**
2929
* Find if two strings end in the same way
30-
* @param $haystack
31-
* @param $needle
30+
* @param string $haystack
31+
* @param string $needle
3232
* @return bool
3333
*/
3434
protected function fileEndsWith($haystack, $needle)

src/JacocoReport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static function getDescription()
3838
}
3939

4040
/**
41-
* @param $reader
42-
* @param $currentFile
41+
* @param XMLReader $reader
42+
* @param string $currentFile
4343
*/
4444
protected function addLine($reader, $currentFile)
4545
{

src/PhpCsLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class PhpCsLoader implements FileChecker
1313
{
1414
/**
15-
* @var string
15+
* @var stdClass
1616
*/
1717
protected $json;
1818
/**

src/PhpStanLoader.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace exussum12\CoverageChecker;
33

44
use ReflectionFunction;
5+
use ReflectionFunctionAbstract;
56
use ReflectionMethod;
67
use Reflector;
78

@@ -38,7 +39,7 @@ public function parseLines()
3839
$filename = '';
3940
$lineNumber = 0;
4041
while (($line = fgets($this->file)) !== false) {
41-
$filename = $this->checkForFileName($line, $filename);
42+
$filename = $this->checkForFilename($line, $filename);
4243
if ($lineNumber = $this->getLineNumber($line, $lineNumber)) {
4344
$error = $this->getMessage($line);
4445
if ($this->isExtendedMessage($line)) {
@@ -154,9 +155,9 @@ protected function handleRelatedError($filename, $line, $error)
154155
}
155156

156157
/**
157-
* @param $filename
158-
* @param $lineNumber
159-
* @param $error
158+
* @param string $filename
159+
* @param int $lineNumber
160+
* @param string $error
160161
*/
161162
protected function addError($filename, $lineNumber, $error)
162163
{
@@ -167,8 +168,8 @@ protected function addError($filename, $lineNumber, $error)
167168
}
168169

169170
/**
170-
* @param $matches
171-
* @return Reflector
171+
* @param array $matches
172+
* @return ReflectionFunctionAbstract
172173
*/
173174
protected function getReflector($matches)
174175
{

0 commit comments

Comments
 (0)