Skip to content

Commit 58b8a7e

Browse files
committed
Reformat
1 parent 8182c29 commit 58b8a7e

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/LanguageData.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
class LanguageData extends LanguageSubset
1818
{
19+
private static array $fileContents = [];
1920
/** @var array<string, array<int, int>> $ngrams */
2021
protected array $ngrams;
2122
/** @var array<int, string> $langCodes */
@@ -29,8 +30,6 @@ class LanguageData extends LanguageSubset
2930
/** @var bool $isSubset */
3031
protected $isSubset;
3132

32-
private static array $fileContents = [];
33-
3433
public function __construct(?string $ngramsFile = null)
3534
{
3635
// Opcache needs to be active, so the load of the database array does not add overhead.
@@ -59,13 +58,7 @@ public function __construct(?string $ngramsFile = null)
5958
*/
6059
private function loadFileContents(string $file): array
6160
{
62-
if (isset(self::$fileContents[$file])) {
63-
return self::$fileContents[$file];
64-
}
65-
66-
$data = require_once $file;
67-
68-
return self::$fileContents[$file] = $data;
61+
return self::$fileContents[$file] ?? (self::$fileContents[$file] = require $file);
6962
}
7063

7164
/*

0 commit comments

Comments
 (0)