1 | <?php |
||
15 | class Locale implements LocaleContract |
||
16 | { |
||
17 | /* ----------------------------------------------------------------- |
||
18 | | Properties |
||
19 | | ----------------------------------------------------------------- |
||
20 | */ |
||
21 | |||
22 | /** @var string */ |
||
23 | private $key = ''; |
||
24 | |||
25 | /** @var string */ |
||
26 | private $path = ''; |
||
27 | |||
28 | /** @var array */ |
||
29 | private $files = []; |
||
30 | |||
31 | /* ----------------------------------------------------------------- |
||
32 | | Constructor |
||
33 | | ----------------------------------------------------------------- |
||
34 | */ |
||
35 | |||
36 | /** |
||
37 | * Locale constructor. |
||
38 | * |
||
39 | * @param string $key |
||
40 | * @param string $path |
||
41 | * @param array $files |
||
42 | */ |
||
43 | 132 | public function __construct(string $key, string $path, array $files = []) |
|
49 | |||
50 | /* ----------------------------------------------------------------- |
||
51 | | Getters & Setters |
||
52 | | ----------------------------------------------------------------- |
||
53 | */ |
||
54 | |||
55 | /** |
||
56 | * Get the locale key. |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | 132 | public function getKey(): string |
|
64 | |||
65 | /** |
||
66 | * Get the locale translations path. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 54 | public function getPath(): string |
|
74 | |||
75 | /** |
||
76 | * Get locale translations. |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | 12 | public function getTranslations(): array |
|
88 | |||
89 | /* ----------------------------------------------------------------- |
||
90 | | Main Methods |
||
91 | | ----------------------------------------------------------------- |
||
92 | */ |
||
93 | |||
94 | /** |
||
95 | * Merge translations. |
||
96 | * |
||
97 | * @param \Arcanedev\LaravelLang\Contracts\Entities\Locale|null $locale |
||
98 | * @param array $ignored |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | 6 | public function mergeTranslations(LocaleContract $locale = null, array $ignored = []): array |
|
118 | } |
||
119 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: