chore: code refactor via rector

This commit is contained in:
idevakk
2025-11-14 02:01:01 -08:00
parent 90ab79b3a2
commit ae795880ed
148 changed files with 1520 additions and 1486 deletions

View File

@@ -10,7 +10,7 @@ use Tests\TestCase;
class AppControllerTest extends TestCase
{
/** @test */
public function it_redirects_to_home_when_no_email_exists_in_mailbox()
public function it_redirects_to_home_when_no_email_exists_in_mailbox(): void
{
$response = $this->get('/mailbox');
@@ -18,7 +18,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_creates_custom_email_from_url_when_enabled()
public function it_creates_custom_email_from_url_when_enabled(): void
{
$email = 'custom@example.com';
@@ -28,7 +28,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_validates_email_parameter_in_mailbox_route()
public function it_validates_email_parameter_in_mailbox_route(): void
{
$response = $this->get('/mailbox/invalid-email');
@@ -37,7 +37,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_redirects_to_home_when_mailbox_slug_is_disabled()
public function it_redirects_to_home_when_mailbox_slug_is_disabled(): void
{
Config::set('app.settings.configuration_settings', json_encode([
'disable_mailbox_slug' => true,
@@ -49,7 +49,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_switches_email_successfully()
public function it_switches_email_successfully(): void
{
$email = 'newemail@example.com';
@@ -59,7 +59,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_redirects_to_home_when_switching_email_with_disabled_mailbox_slug()
public function it_redirects_to_home_when_switching_email_with_disabled_mailbox_slug(): void
{
Config::set('app.settings.configuration_settings', json_encode([
'disable_mailbox_slug' => true,
@@ -73,7 +73,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_deletes_email_successfully()
public function it_deletes_email_successfully(): void
{
$email = 'delete@example.com';
@@ -83,7 +83,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_redirects_to_home_when_deleting_email_without_parameter()
public function it_redirects_to_home_when_deleting_email_without_parameter(): void
{
$response = $this->get('/delete');
@@ -91,7 +91,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_switches_locale_successfully()
public function it_switches_locale_successfully(): void
{
$locale = 'es';
@@ -102,7 +102,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_aborts_with_400_for_invalid_locale()
public function it_aborts_with_400_for_invalid_locale(): void
{
$invalidLocale = 'invalid';
@@ -112,7 +112,7 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_redirects_back_after_locale_switch()
public function it_redirects_back_after_locale_switch(): void
{
$locale = 'fr';
@@ -123,12 +123,11 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_handles_get_string_between_method_correctly()
public function it_handles_get_string_between_method_correctly(): void
{
$controller = new AppController;
$reflection = new ReflectionClass($controller);
$method = $reflection->getMethod('getStringBetween');
$method->setAccessible(true);
$string = 'Hello [world] test';
$result = $method->invoke($controller, $string, '[', ']');
@@ -137,12 +136,11 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_handles_get_string_between_with_missing_end()
public function it_handles_get_string_between_with_missing_end(): void
{
$controller = new AppController;
$reflection = new ReflectionClass($controller);
$method = $reflection->getMethod('getStringBetween');
$method->setAccessible(true);
$string = 'Hello [world test';
$result = $method->invoke($controller, $string, '[', ']');
@@ -151,12 +149,11 @@ class AppControllerTest extends TestCase
}
/** @test */
public function it_handles_get_string_between_with_no_match()
public function it_handles_get_string_between_with_no_match(): void
{
$controller = new AppController;
$reflection = new ReflectionClass($controller);
$method = $reflection->getMethod('getStringBetween');
$method->setAccessible(true);
$string = 'Hello world test';
$result = $method->invoke($controller, $string, '[', ']');