18
18
*/
19
19
final class LanguagesTest extends TestCase
20
20
{
21
- protected string $ langDir = __DIR__ . '/../src/Languages/ ' ;
21
+ protected static string $ langDir = __DIR__ . '/../src/Languages/ ' ;
22
22
23
23
/**
24
24
* @return array<int,string>
25
25
*/
26
26
protected function getCodes () : array
27
27
{
28
28
// @phpstan-ignore-next-line
29
- $ codes = \array_filter ((array ) \glob ($ this -> langDir . '* ' ), 'is_dir ' );
30
- $ length = \strlen ($ this -> langDir );
29
+ $ codes = \array_filter ((array ) \glob (self :: $ langDir . '* ' ), 'is_dir ' );
30
+ $ length = \strlen (self :: $ langDir );
31
31
$ result = [];
32
32
foreach ($ codes as &$ dir ) {
33
33
if ($ dir === false ) {
@@ -47,7 +47,7 @@ protected function getCodes() : array
47
47
public function testKeys (array $ rules , string $ file ) : void
48
48
{
49
49
foreach ($ this ->getCodes () as $ code ) {
50
- $ lines = require $ this -> langDir . $ code . '/ ' . $ file . '.php ' ;
50
+ $ lines = require self :: $ langDir . $ code . '/ ' . $ file . '.php ' ;
51
51
$ lines = \array_keys ($ lines );
52
52
\sort ($ lines );
53
53
self ::assertSame ($ rules , $ lines , 'File: ' . $ file . '. Language: ' . $ code );
@@ -57,15 +57,15 @@ public function testKeys(array $rules, string $file) : void
57
57
/**
58
58
* @return array<string,array<mixed>>
59
59
*/
60
- public function languageProvider () : array
60
+ public static function languageProvider () : array
61
61
{
62
62
$ files = [
63
63
'validation ' ,
64
64
];
65
65
$ data = [];
66
66
foreach ($ files as $ file ) {
67
67
$ data [$ file ] = [
68
- \array_keys (require $ this -> langDir . 'en/ ' . $ file . '.php ' ),
68
+ \array_keys (require self :: $ langDir . 'en/ ' . $ file . '.php ' ),
69
69
$ file ,
70
70
];
71
71
}
0 commit comments