Skip to content

Commit 37ab1c6

Browse files
committed
simplify cache
1 parent 1081704 commit 37ab1c6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Services/SearchCode/PhpParserService.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public static function scanCode(string $code): array
180180
public function translationsByFiles(): array
181181
{
182182
return collect($this->finder())
183-
->mapWithKeys(function (SplFileInfo $file, string $path) {
183+
->map(function (SplFileInfo $file, string $path) {
184184

185185
$lastModified = $file->getMTime();
186186
$cachedResult = $this->cache?->get($path);
@@ -207,13 +207,7 @@ public function translationsByFiles(): array
207207
$this->cache?->put($path, $translations);
208208
}
209209

210-
$relativePath = str($path)
211-
->after(base_path())
212-
->value();
213-
214-
return [
215-
$relativePath => $translations,
216-
];
210+
return $translations;
217211
})
218212
->filter()
219213
->sortKeys(SORT_NATURAL)

0 commit comments

Comments
 (0)