Skip to content

Commit baade2f

Browse files
committed
Fix CS
1 parent a442f06 commit baade2f

File tree

2 files changed

+44
-45
lines changed

2 files changed

+44
-45
lines changed

PSR2R/Tools/SniffsAndTests.php

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,48 @@
1212
use RecursiveRegexIterator;
1313
use RegexIterator;
1414

15-
class SniffsAndTests
16-
{
17-
/**
18-
* @var array<string>
19-
*/
20-
protected static $orgs = [
21-
'PSR2R',
22-
];
23-
24-
/**
25-
* @param string $path Path
26-
*
27-
* @return array<string, array<string, mixed>>
28-
*/
29-
public function untested(string $path): array
30-
{
31-
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
32-
33-
$sniffs = [];
34-
35-
foreach (static::$orgs as $org) {
36-
$directoryIterator = new RecursiveDirectoryIterator($path . $org);
37-
$recursiveIterator = new RecursiveIteratorIterator($directoryIterator);
38-
$regexIterator = new RegexIterator($recursiveIterator, '#^.+/(\w+)/Sniffs/(\w+)/(\w+)Sniff\.php$#', RecursiveRegexIterator::GET_MATCH);
39-
40-
foreach ($regexIterator as $match) {
41-
$org = $match[1];
42-
$type = $match[2];
43-
$name = $match[3];
44-
$testFile = $path . 'tests' . DIRECTORY_SEPARATOR . $org . 'Sniffs' . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $name . 'SniffTest.php';
45-
$hasTest = file_exists($testFile);
46-
if ($hasTest) {
47-
continue;
48-
}
49-
50-
$key = $org . '.' . $type . '.' . $name;
51-
$sniffs[$key] = [
52-
'hasTest' => $hasTest,
53-
];
54-
}
55-
}
56-
57-
return $sniffs;
58-
}
15+
class SniffsAndTests {
16+
17+
/**
18+
* @var array<string>
19+
*/
20+
protected static $orgs = [
21+
'PSR2R',
22+
];
23+
24+
/**
25+
* @param string $path Path
26+
*
27+
* @return array<string, array<string, mixed>>
28+
*/
29+
public function untested(string $path): array {
30+
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
31+
32+
$sniffs = [];
33+
34+
foreach (static::$orgs as $org) {
35+
$directoryIterator = new RecursiveDirectoryIterator($path . $org);
36+
$recursiveIterator = new RecursiveIteratorIterator($directoryIterator);
37+
$regexIterator = new RegexIterator($recursiveIterator, '#^.+/(\w+)/Sniffs/(\w+)/(\w+)Sniff\.php$#', RecursiveRegexIterator::GET_MATCH);
38+
39+
foreach ($regexIterator as $match) {
40+
$org = $match[1];
41+
$type = $match[2];
42+
$name = $match[3];
43+
$testFile = $path . 'tests' . DIRECTORY_SEPARATOR . $org . 'Sniffs' . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $name . 'SniffTest.php';
44+
$hasTest = file_exists($testFile);
45+
if ($hasTest) {
46+
continue;
47+
}
48+
49+
$key = $org . '.' . $type . '.' . $name;
50+
$sniffs[$key] = [
51+
'hasTest' => $hasTest,
52+
];
53+
}
54+
}
55+
56+
return $sniffs;
57+
}
58+
5959
}

phpcs.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<file>PSR2R/</file>
88
<file>docs/</file>
99
<file>bin/</file>
10-
<file>tests/Sniffs/</file>
1110

1211
<rule ref="PSR2R"/>
1312

0 commit comments

Comments
 (0)