Skip to content

Commit cd53c0f

Browse files
committed
4.0 | Filters: add parameter types
1 parent fe82153 commit cd53c0f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Filters/Filter.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PHP_CodeSniffer\Util\Common;
1616
use RecursiveDirectoryIterator;
1717
use RecursiveFilterIterator;
18+
use RecursiveIterator;
1819
use ReturnTypeWillChange;
1920

2021
class Filter extends RecursiveFilterIterator
@@ -84,7 +85,7 @@ class Filter extends RecursiveFilterIterator
8485
*
8586
* @return void
8687
*/
87-
public function __construct($iterator, $basedir, Config $config, Ruleset $ruleset)
88+
public function __construct(RecursiveIterator $iterator, string $basedir, Config $config, Ruleset $ruleset)
8889
{
8990
parent::__construct($iterator);
9091
$this->basedir = $basedir;
@@ -177,7 +178,7 @@ public function getChildren()
177178
*
178179
* @return bool
179180
*/
180-
protected function shouldProcessFile($path)
181+
protected function shouldProcessFile(string $path)
181182
{
182183
// Check that the file's extension is one we are checking.
183184
// We are strict about checking the extension and we don't
@@ -224,7 +225,7 @@ protected function shouldProcessFile($path)
224225
*
225226
* @return bool
226227
*/
227-
protected function shouldIgnorePath($path)
228+
protected function shouldIgnorePath(string $path)
228229
{
229230
if ($this->ignoreFilePatterns === null) {
230231
$this->ignoreDirPatterns = [];

src/Filters/GitModified.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function getAllowedFiles()
7676
*
7777
* @return array
7878
*/
79-
protected function exec($cmd)
79+
protected function exec(string $cmd)
8080
{
8181
$output = [];
8282
$lastLine = exec($cmd, $output);

src/Filters/GitStaged.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function getAllowedFiles()
7878
*
7979
* @return array
8080
*/
81-
protected function exec($cmd)
81+
protected function exec(string $cmd)
8282
{
8383
$output = [];
8484
$lastLine = exec($cmd, $output);

0 commit comments

Comments
 (0)