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

@@ -2,9 +2,11 @@
namespace App\Livewire;
use Illuminate\Support\Facades\Session;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use App\Models\ZEmail;
use Livewire\Component;
use Session;
class AddOn extends Component
{
@@ -27,11 +29,12 @@ class AddOn extends Component
$email = ZEmail::getEmail();
$messages = ZEmail::getMessages($email);
if (count($messages['data']) > 0) {
return redirect()->route('mailbox');
return to_route('mailbox');
}
return null;
}
public function mount()
public function mount(): void
{
$this->faqs = json_decode(file_get_contents(public_path('addOnFAQs.json')), true) ?? [];
$route = request()->route()->getName();
@@ -45,16 +48,14 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
} elseif ($route == 'disposable-gmail') {
$this->title = 'Disposable Gmail Email | Free Temporary Gmail Inbox Online';
@@ -65,16 +66,14 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
} elseif ($route == 'disposable-outlook') {
@@ -86,16 +85,14 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
} elseif ($route == 'disposable-yahoo') {
$this->title = 'Disposable Yahoo Mail | Free Temporary Yahoo Inbox';
@@ -106,16 +103,14 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
} elseif ($route == 'gmailnator') {
$this->title = 'Gmailnator - Free Temporary Gmail Email Address Generator';
@@ -126,16 +121,14 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
} elseif ($route == 'emailnator') {
$this->title = 'Emailnator - Free Disposable Temporary Email Service';
@@ -146,16 +139,14 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
} elseif ($route == 'temp-gmail') {
$this->title = 'Temp Gmail | Free Temporary Gmail Inbox for Instant Use';
@@ -166,22 +157,20 @@ class AddOn extends Component
$this->faqSchema = [
'@context' => 'https://schema.org',
'@type' => 'FAQPage',
'mainEntity' => collect($this->faqs)->map(function ($faq) {
return [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
];
})->toArray(),
'mainEntity' => collect($this->faqs)->map(fn(array $faq): array => [
'@type' => 'Question',
'name' => $faq['title'],
'acceptedAnswer' => [
'@type' => 'Answer',
'text' => $faq['content'],
],
])->all(),
];
}
}
public function render()
public function render(): Factory|View
{
return view('livewire.add-on');
}