-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Skip ArrayKeysAndInArrayToArrayKeyExistsRector on keys …
…variable used (#57)
- Loading branch information
1 parent
367879e
commit 2bc6ba8
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
.../Rector/FuncCall/ArrayKeysAndInArrayToArrayKeyExistsRector/Fixture/skip_keys_used.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector\Fixture; | ||
|
||
class SkipKeysUsed | ||
{ | ||
public function run($packageName, $values) | ||
{ | ||
$keys = array_keys($values); | ||
|
||
foreach($keys as $field) { | ||
if ($field === 'foo') { | ||
return false; | ||
} | ||
} | ||
|
||
return in_array($packageName, $keys, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters