| @@ 19-30 (lines=12) @@ | ||
| 16 | * |
|
| 17 | * @return Translations |
|
| 18 | */ |
|
| 19 | public static function fromFile($file, Translations $translations = null) |
|
| 20 | { |
|
| 21 | if ($translations === null) { |
|
| 22 | $translations = new Translations(); |
|
| 23 | } |
|
| 24 | ||
| 25 | foreach (self::getFiles($file) as $file) { |
|
| 26 | static::fromString(self::readFile($file), $translations, $file); |
|
| 27 | } |
|
| 28 | ||
| 29 | return $translations; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Checks and returns all files. |
|
| @@ 21-32 (lines=12) @@ | ||
| 18 | * |
|
| 19 | * @return Translations |
|
| 20 | */ |
|
| 21 | public static function fromFile($file, Translations $translations = null) |
|
| 22 | { |
|
| 23 | if ($translations === null) { |
|
| 24 | $translations = new Translations(); |
|
| 25 | } |
|
| 26 | ||
| 27 | foreach (static::getFiles($file) as $file) { |
|
| 28 | static::extract(include($file), $translations); |
|
| 29 | } |
|
| 30 | ||
| 31 | return $translations; |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * {@inheritdoc} |
|