/** * Get an array of application files containing the old key. * * @return array */ private function getFilesContainingOldKey() { $affectedFiles = []; foreach ($this->manager->getAllViewFilesWithTranslations() as $file => $keys) { foreach ($keys as $key) { if ($key == $this->argument('oldKey')) { $affectedFiles[$file][] = $key; } } } return $affectedFiles; }