Skip to content

Commit 85c57e4

Browse files
isaekenactions-user
authored andcommitted
Fix styling
1 parent a2f03d9 commit 85c57e4

File tree

8 files changed

+17
-26
lines changed

8 files changed

+17
-26
lines changed

src/Commands/PublishCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public function handle(): void
3232
foreach ($this->links() as $link => $target) {
3333
$link = public_path($link);
3434

35-
if (file_exists($link) && !$this->isRemovableSymlink($link, $this->option('force'))) {
35+
if (file_exists($link) && ! $this->isRemovableSymlink($link, $this->option('force'))) {
3636
$this->error("The [$link] link already exists.");
37+
3738
continue;
3839
}
3940

@@ -43,8 +44,7 @@ public function handle(): void
4344

4445
if ($this->option('relative')) {
4546
$this->laravel->make('files')->relativeLink($target, $link);
46-
}
47-
else {
47+
} else {
4848
$this->laravel->make('files')->link($target, $link);
4949
}
5050

@@ -65,7 +65,7 @@ protected function links(): array
6565
foreach (theme_system()->findThemes() as $theme) {
6666
$directory = $theme->directory . '/' . theme_system()->getPublicDirectory();
6767

68-
if (!is_dir($directory)) {
68+
if (! is_dir($directory)) {
6969
continue;
7070
}
7171

src/Exceptions/ThemeNotExistsException.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ public function __construct(string|null $name = null, string|null $path = null)
1010
{
1111
if ($name !== null && $path !== null) {
1212
$message = sprintf('The theme %s (%s) not found.', $name, $path);
13-
}
14-
else if ($name !== null) {
13+
} elseif ($name !== null) {
1514
$message = sprintf('The theme %s not found.', $name);
16-
}
17-
else if ($path !== null) {
15+
} elseif ($path !== null) {
1816
$message = sprintf('The theme %s not found.', $path);
1917
}
2018

src/Illuminate/UrlGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function asset($path, $secure = null)
2121
}
2222

2323
$root = $this->assetRoot ?: $this->formatRoot($this->formatScheme($secure));
24-
24+
2525
$theme = Str::snake(theme_system()->getCurrentTheme(), '-');
2626
if ($theme === 'default') {
2727
$theme = '';

src/ThemeSystem.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function findThemes(): array
5454

5555
if ($this->isExists($path)) {
5656
$themes[] = (object) [
57-
'directory' => theme_path($path),
58-
'name' => $path,
57+
'directory' => theme_path($path),
58+
'name' => $path,
5959
'publicName' => Str::snake($path, '-'),
6060
];
6161
}
@@ -64,7 +64,6 @@ public function findThemes(): array
6464
return $themes;
6565
}
6666

67-
6867
/**
6968
* Get public directory name.
7069
*
@@ -85,7 +84,6 @@ public function getThemesDirectory(): string
8584
return config('theme-system.themes_directory', resource_path('themes')) ?? resource_path('themes');
8685
}
8786

88-
8987
/**
9088
* Get current theme name.
9189
*
@@ -116,7 +114,6 @@ public function getDefaultTheme(): string
116114
return config('theme-system.theme', 'default') ?? 'default';
117115
}
118116

119-
120117
/**
121118
* Get current theme directory.
122119
*
@@ -136,7 +133,7 @@ public function getCurrentThemeDirectory(bool|null $fallback = null): string
136133
return $this->getDefaultThemeDirectory();
137134
}
138135

139-
if (!$this->isExists($theme)) {
136+
if (! $this->isExists($theme)) {
140137
throw_unless($fallback, ThemeNotExistsException::class, $theme);
141138

142139
return $this->getDefaultThemeDirectory();
@@ -155,7 +152,6 @@ public function getDefaultThemeDirectory(): string
155152
return app('config')['view.paths'][0] ?? resource_path('views');
156153
}
157154

158-
159155
/**
160156
* Change current theme.
161157
*
@@ -167,11 +163,9 @@ public function setTheme(string|null $name): static
167163
{
168164
if ($name == 'default' || $name == null) {
169165
$this->theme = $this->getDefaultTheme();
170-
}
171-
else if ($this->isExists($name)) {
166+
} elseif ($this->isExists($name)) {
172167
$this->theme = $name;
173-
}
174-
else {
168+
} else {
175169
throw new ThemeNotExistsException($name);
176170
}
177171

@@ -192,7 +186,6 @@ public function isExists(string $name): bool
192186
preg_match(config('theme-system.name_regex', '/(.[a-zA-Z0-9-_]+)/'), $name) !== false;
193187
}
194188

195-
196189
/**
197190
* Resolve theme directories.
198191
*
@@ -205,6 +198,7 @@ public function resolvePaths(): array
205198
if ($this->isFallbackEnabled()) {
206199
$paths[] = $this->getDefaultThemeDirectory();
207200
}
201+
208202
return $paths;
209203
}
210204
}

src/ThemeSystemServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function registeringPackage()
2626
public function packageBooted()
2727
{
2828
$this->app->singleton(ThemeSystem::class, function ($app) {
29-
return new ThemeSystem;
29+
return new ThemeSystem();
3030
});
3131

3232
if (config('theme-system.enable')) {

src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use IsaEken\ThemeSystem\ThemeSystem;
44

5-
if (!function_exists('theme_system')) {
5+
if (! function_exists('theme_system')) {
66
/**
77
* Get theme system instance.
88
*
@@ -14,7 +14,7 @@ function theme_system(): ThemeSystem
1414
}
1515
}
1616

17-
if (!function_exists('theme_path')) {
17+
if (! function_exists('theme_path')) {
1818
/**
1919
* Get the path to the theme folder.
2020
*

tests/TestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ protected function getPackageProviders($app)
1616

1717
protected function getEnvironmentSetUp($app)
1818
{
19-
2019
}
2120
}

tests/ThemeSystemTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
assertEquals(theme_system()->getCurrentTheme(), 'default');
1818

1919
$themeDirectory = theme_system()->getThemesDirectory() . '/testing';
20-
if (!is_dir($themeDirectory)) {
20+
if (! is_dir($themeDirectory)) {
2121
mkdir(theme_system()->getThemesDirectory() . '/testing', recursive: true);
2222
}
2323

0 commit comments

Comments
 (0)