Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhanSalleh authored and github-actions[bot] committed Nov 18, 2023
1 parent 2dd5be8 commit b84b0c9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
15 changes: 7 additions & 8 deletions src/FilamentLanguageSwitchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

namespace BezhanSalleh\FilamentLanguageSwitch;

use Filament\Panel;
use Livewire\Livewire;
use BezhanSalleh\FilamentLanguageSwitch\Http\Livewire\FilamentLanguageSwitch;
use BezhanSalleh\FilamentLanguageSwitch\Http\Middleware\SwitchLanguageLocale;
use Filament\Facades\Filament;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Panel;
use Filament\Support\Assets\Css;
use Spatie\LaravelPackageTools\Package;
use Filament\Support\Facades\FilamentAsset;
use Livewire\Livewire;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use BezhanSalleh\FilamentLanguageSwitch\LanguageSwitch;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use BezhanSalleh\FilamentLanguageSwitch\Http\Livewire\FilamentLanguageSwitch;
use BezhanSalleh\FilamentLanguageSwitch\Http\Middleware\SwitchLanguageLocale;

class FilamentLanguageSwitchServiceProvider extends PackageServiceProvider
{
Expand Down Expand Up @@ -72,4 +71,4 @@ protected function reorderCurrentPanelMiddlewareStack(Panel $panel): void
->concat($middlewareCollection->slice($position))
->toArray();
}
}
}
6 changes: 3 additions & 3 deletions src/Http/Livewire/FilamentLanguageSwitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace BezhanSalleh\FilamentLanguageSwitch\Http\Livewire;

use Livewire\Component;
use Illuminate\Contracts\View\View;
use BezhanSalleh\FilamentLanguageSwitch\LanguageSwitch;
use Illuminate\Contracts\View\View;
use Livewire\Component;

class FilamentLanguageSwitch extends Component
{
Expand All @@ -23,7 +23,7 @@ public function changeLocale($locale)
public function render(): View
{
return view('filament-language-switch::language-switch', [
'languageSwitch' => LanguageSwitch::make()
'languageSwitch' => LanguageSwitch::make(),
]);
}
}
4 changes: 2 additions & 2 deletions src/Http/Middleware/SwitchLanguageLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace BezhanSalleh\FilamentLanguageSwitch\Http\Middleware;

use BezhanSalleh\FilamentLanguageSwitch\LanguageSwitch;
use Closure;
use Illuminate\Http\Request;
use BezhanSalleh\FilamentLanguageSwitch\LanguageSwitch;

class SwitchLanguageLocale
{
public function handle(Request $request, Closure $next): \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
public function handle(Request $request, Closure $next): \Illuminate\Http\Response | \Illuminate\Http\RedirectResponse
{
$locale = session()->get('locale')
?? $request->get('locale')
Expand Down
8 changes: 4 additions & 4 deletions src/LanguageSwitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Closure;
use Filament\Panel;
use Filament\Support\Concerns;
use Illuminate\Support\Facades\Blade;
use Filament\Support\Facades\FilamentView;
use Illuminate\Support\Facades\Blade;

class LanguageSwitch
{
Expand All @@ -17,7 +17,7 @@ class LanguageSwitch

protected bool | Closure $isCircular = false;

protected null | string $displayLocale = null;
protected ?string $displayLocale = null;

protected array | Closure $excludes = [];

Expand Down Expand Up @@ -122,7 +122,7 @@ public function getFlags(): array
{
$flagUrls = (array) $this->evaluate($this->flags);

foreach($flagUrls as $url) {
foreach ($flagUrls as $url) {
if (! filter_var($url, FILTER_VALIDATE_URL)) {
throw new \Exception('Invlid flag url');
exit;
Expand Down Expand Up @@ -181,4 +181,4 @@ public function getLabel(string $locale): string
{
return $this->labels[$locale] ?? locale_get_display_name($locale, $this->getDisplayLocale());
}
}
}

0 comments on commit b84b0c9

Please sign in to comment.