Skip to content

Commit 5ed99a7

Browse files
committed
Changed filter class to keep keys and changed path of phpcs command
1 parent f907e70 commit 5ed99a7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Filter/Filter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public function __construct(array $rules, array $unfilteredData)
5353
*/
5454
public function filter()
5555
{
56-
foreach ($this->unfilteredData as $item) {
56+
foreach ($this->unfilteredData as $key => $item) {
5757
foreach ($this->rules as $rule) {
5858
try {
5959
$rule($item);
6060
} catch (RuleException $exception) {
61-
$this->contaminatedData[] = $item;
61+
$this->contaminatedData[$key] = $item;
6262
}
63-
$this->filteredData[] = $item;
63+
$this->filteredData[$key] = $item;
6464
}
6565
}
6666

src/PhpcsDiff.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ public function run()
164164

165165
$changedLinesPerFile = $this->getChangedLinesPerFile($files);
166166

167-
168167
if ($this->isVerbose) {
169168
$this->climate->comment('Comparing phpcs output with changes lines from git diff.');
170169
}
@@ -198,7 +197,7 @@ public function run()
198197
protected function runPhpcs(array $files = [], $ruleset = 'ruleset.xml')
199198
{
200199
return json_decode(
201-
shell_exec('./vendor/bin/phpcs --report=json --standard=' . $ruleset . ' ' . implode(' ', $files)),
200+
shell_exec('vendor/bin/phpcs --report=json --standard=' . $ruleset . ' ' . implode(' ', $files)),
202201
true
203202
);
204203
}

0 commit comments

Comments
 (0)