public function __construct(string $lang, array $records = [])
17
{
18
30
$this->lang = $lang;
19
30
$this->records = Arr::flatten($records);
20
30
}
21
22
27
public function getLang(): string
23
{
24
27
return $this->lang;
25
}
26
27
24
public function getRecords(): array
28
{
29
24
return $this->records;
30
}
31
32
21
public function extend(Dictionary $dictionary): void
33
{
34
21
if ($this->lang !== $dictionary->getLang()) {
35
3
throw new InvalidArgumentException(sprintf('Current dictionary lang (%s) does not match to extend dictionary lang (%s)', $this->lang, $dictionary->getLang()));