Skip to content

Commit

Permalink
Destructure array in foreach loops (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and theofidry committed May 12, 2018
1 parent a095ee2 commit be22eb9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Console/Command/AddPrefixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ private function scopeFiles(
$vendorDirs = [];
$commonPath = get_common_path(array_keys($filesWithContents));

foreach ($filesWithContents as $fileWithContents) {
[$inputFilePath, $inputContents] = $fileWithContents;

foreach ($filesWithContents as [$inputFilePath, $inputContents]) {
$outputFilePath = $output.str_replace($commonPath, '', $inputFilePath);

if (preg_match('~((?:.*)\/vendor)\/.*~', $outputFilePath, $matches)) {
Expand Down

0 comments on commit be22eb9

Please sign in to comment.