From be22eb9f8b603f75ddae84662c6b190f58068864 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sat, 12 May 2018 18:40:34 -0300 Subject: [PATCH] Destructure array in foreach loops (#204) --- src/Console/Command/AddPrefixCommand.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Console/Command/AddPrefixCommand.php b/src/Console/Command/AddPrefixCommand.php index f230c365..e9556b89 100644 --- a/src/Console/Command/AddPrefixCommand.php +++ b/src/Console/Command/AddPrefixCommand.php @@ -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)) {