From ed0710ffd1d73a849db1350f14bcc5185588b040 Mon Sep 17 00:00:00 2001 From: Chin Leung Date: Tue, 3 Mar 2020 19:53:56 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/helpers.php | 4 ++-- tests/HelpersTest.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index b869d73..cb3d5f0 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -7,7 +7,7 @@ * @param array $locales * @return array */ - function locales(array $locales = null) : array + function locales(array $locales = null): array { if (! is_null($locales)) { config([ @@ -29,7 +29,7 @@ function locales(array $locales = null) : array * @param string $locale * @return string */ - function locale(string $locale = null) : string + function locale(string $locale = null): string { if (! is_null($locale) && in_array($locale, locales())) { app()->setLocale($locale); diff --git a/tests/HelpersTest.php b/tests/HelpersTest.php index c44e26c..4549709 100644 --- a/tests/HelpersTest.php +++ b/tests/HelpersTest.php @@ -13,7 +13,7 @@ class HelpersTest extends TestCase * @test * @return void */ - public function the_locales_helper_will_return_all_locales() : void + public function the_locales_helper_will_return_all_locales(): void { $this->assertCount(1, locales()); $this->assertEquals(['en'], locales()); @@ -26,7 +26,7 @@ public function the_locales_helper_will_return_all_locales() : void * @test * @return void */ - public function the_locales_helper_will_return_locales_from_app_first() : void + public function the_locales_helper_will_return_locales_from_app_first(): void { config(['app.locales' => ['en', 'fr']]); $this->assertCount(2, locales()); @@ -41,7 +41,7 @@ public function the_locales_helper_will_return_locales_from_app_first() : void * @test * @return void */ - public function the_locale_helper_will_return_the_current_active_locale() : void + public function the_locale_helper_will_return_the_current_active_locale(): void { $this->assertEquals(app()->getLocale(), locale()); @@ -55,7 +55,7 @@ public function the_locale_helper_will_return_the_current_active_locale() : void * @test * @return void */ - public function the_locale_helper_can_update_the_application_locale() : void + public function the_locale_helper_can_update_the_application_locale(): void { $this->assertEquals('en', locale()); @@ -72,7 +72,7 @@ public function the_locale_helper_can_update_the_application_locale() : void * @test * @return void */ - public function the_locale_helper_will_not_update_if_locale_is_not_supported() : void + public function the_locale_helper_will_not_update_if_locale_is_not_supported(): void { $this->assertEquals('en', locale()); $this->assertEquals('en', locale('fr')); @@ -85,7 +85,7 @@ public function the_locale_helper_will_not_update_if_locale_is_not_supported() : * @test * @return void */ - public function the_locales_helper_can_update_the_list_of_supported_locales() : void + public function the_locales_helper_can_update_the_list_of_supported_locales(): void { $this->assertCount(1, locales()); @@ -100,7 +100,7 @@ public function the_locales_helper_can_update_the_list_of_supported_locales() : * @param \Illuminate\Foundation\Application $app * @return array */ - protected function getPackageProviders($app) : array + protected function getPackageProviders($app): array { return [ LaravelLocalesServiceProvider::class,