diff --git a/src/LanguageLoader.php b/src/LanguageLoader.php index 245132a..fc97e02 100644 --- a/src/LanguageLoader.php +++ b/src/LanguageLoader.php @@ -147,7 +147,7 @@ protected static function operatorForWhere($key, $operator, $value) * * @return array */ - protected static function filter($items, callable $callback = null) + protected static function filter($items, ?callable $callback = null) { if ($callback) { return array_filter($items, $callback, ARRAY_FILTER_USE_BOTH); diff --git a/tests/Unit/LanguageLoaderTest.php b/tests/Unit/LanguageLoaderTest.php index d7b1b6d..a7c8059 100644 --- a/tests/Unit/LanguageLoaderTest.php +++ b/tests/Unit/LanguageLoaderTest.php @@ -308,7 +308,8 @@ public function it_collapses_array() /** @test */ public function it_gets_file_content() { - $this->assertStringEqualsFile(__DIR__.'/../resources/languages.json', self::$methods['getFile']->invoke(null, __DIR__.'/../resources/languages.json')); + $path = realpath(dirname(__DIR__, 2).'/resources/languages.json'); + $this->assertStringEqualsFile($path, self::$methods['getFile']->invoke(null, $path)); } /** @test */