1818 */
1919final class LanguagesTest extends TestCase
2020{
21- protected string $ langDir = __DIR__ . '/../src/Languages/ ' ;
21+ protected static string $ langDir = __DIR__ . '/../src/Languages/ ' ;
2222
2323 /**
2424 * @return array<int,string>
2525 */
2626 protected function getCodes () : array
2727 {
2828 // @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 );
3131 $ result = [];
3232 foreach ($ codes as &$ dir ) {
3333 if ($ dir === false ) {
@@ -47,7 +47,7 @@ protected function getCodes() : array
4747 public function testKeys (array $ rules , string $ file ) : void
4848 {
4949 foreach ($ this ->getCodes () as $ code ) {
50- $ lines = require $ this -> langDir . $ code . '/ ' . $ file . '.php ' ;
50+ $ lines = require self :: $ langDir . $ code . '/ ' . $ file . '.php ' ;
5151 $ lines = \array_keys ($ lines );
5252 \sort ($ lines );
5353 self ::assertSame ($ rules , $ lines , 'File: ' . $ file . '. Language: ' . $ code );
@@ -57,15 +57,15 @@ public function testKeys(array $rules, string $file) : void
5757 /**
5858 * @return array<string,array<mixed>>
5959 */
60- public function languageProvider () : array
60+ public static function languageProvider () : array
6161 {
6262 $ files = [
6363 'validation ' ,
6464 ];
6565 $ data = [];
6666 foreach ($ files as $ file ) {
6767 $ data [$ file ] = [
68- \array_keys (require $ this -> langDir . 'en/ ' . $ file . '.php ' ),
68+ \array_keys (require self :: $ langDir . 'en/ ' . $ file . '.php ' ),
6969 $ file ,
7070 ];
7171 }
0 commit comments