Skip to content

Commit cd7d4fa

Browse files
Merge pull request #59 from hexadog/gaetan-hexadog-patch-1
Update php-cs-fixer.yml
2 parents edf316f + 4298518 commit cd7d4fa

File tree

13 files changed

+12
-29
lines changed

13 files changed

+12
-29
lines changed

.github/workflows/php-cs-fixer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
ref: ${{ github.head_ref }}
1616

1717
- name: Run php-cs-fixer
18-
uses: docker://oskarstark/php-cs-fixer-ga:3.0.0
18+
uses: docker://oskarstark/php-cs-fixer-ga
1919
with:
2020
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
2121

src/Console/Commands/AbstractCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function validateName()
2424
if (!$this->theme) {
2525
$this->error("Theme with name {$name} does not exists!");
2626

27-
exit();
27+
exit;
2828
}
2929
}
3030
}

src/Console/Generators/MakeTheme.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Hexadog\ThemesManager\Console\Generators;
44

5-
use Exception;
65
use Hexadog\ThemesManager\Console\Commands\Traits\BlockMessage;
76
use Hexadog\ThemesManager\Console\Commands\Traits\SectionMessage;
87
use Hexadog\ThemesManager\Facades\ThemesManager;
@@ -86,7 +85,7 @@ public function handle()
8685
$this->generateTheme();
8786

8887
$this->sectionMessage('Themes Manager', 'Theme successfully created');
89-
} catch (Exception $e) {
88+
} catch (\Exception $e) {
9089
$this->error($e->getMessage());
9190
}
9291
}
@@ -240,7 +239,7 @@ private function generateTheme()
240239

241240
// Make directory
242241
if ($this->files->isDirectory($directory)) {
243-
throw new Exception("Theme {$this->theme['name']} already exists");
242+
throw new \Exception("Theme {$this->theme['name']} already exists");
244243
}
245244
$this->files->makeDirectory($directory, 0755, true);
246245

src/Events/ThemeDisabled.php

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class ThemeDisabled
99
*/
1010
public $theme;
1111

12-
/**
13-
* @param $theme
14-
*/
1512
public function __construct($theme)
1613
{
1714
$this->theme = $theme;

src/Events/ThemeDisabling.php

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class ThemeDisabling
99
*/
1010
public $theme;
1111

12-
/**
13-
* @param $theme
14-
*/
1512
public function __construct($theme)
1613
{
1714
$this->theme = $theme;

src/Events/ThemeEnabled.php

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class ThemeEnabled
99
*/
1010
public $theme;
1111

12-
/**
13-
* @param $theme
14-
*/
1512
public function __construct($theme)
1613
{
1714
$this->theme = $theme;

src/Events/ThemeEnabling.php

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class ThemeEnabling
99
*/
1010
public $theme;
1111

12-
/**
13-
* @param $theme
14-
*/
1512
public function __construct($theme)
1613
{
1714
$this->theme = $theme;

src/Exceptions/ThemeLoaderException.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace Hexadog\ThemesManager\Exceptions;
44

5-
use RuntimeException;
6-
7-
class ThemeLoaderException extends RuntimeException
5+
class ThemeLoaderException extends \RuntimeException
86
{
97
/**
108
* @return \Hexadog\ThemesManager\Exceptions\ThemeLoaderException

src/Helpers/Json.php

-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ public function save(): bool
201201
/**
202202
* Get the specified attribute from json file.
203203
*
204-
* @param $key
205204
* @param null $default
206205
*
207206
* @return mixed

src/Http/Middleware/ThemeLoader.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Hexadog\ThemesManager\Http\Middleware;
44

5-
use Closure;
65
use Hexadog\ThemesManager\Facades\ThemesManager;
76
use Illuminate\Http\Request;
87

@@ -16,7 +15,7 @@ class ThemeLoader
1615
*
1716
* @return mixed
1817
*/
19-
public function handle(Request $request, Closure $next, $theme = null)
18+
public function handle(Request $request, \Closure $next, $theme = null)
2019
{
2120
// Do not load theme if API request or App is running in console
2221
if ($request->expectsJson() || app()->runningInConsole()) {

src/Providers/PackageServiceProvider.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Illuminate\Routing\Router;
1616
use Illuminate\Support\ServiceProvider;
1717
use Illuminate\Support\Str;
18-
use ReflectionClass;
1918

2019
class PackageServiceProvider extends ServiceProvider
2120
{
@@ -83,7 +82,7 @@ public function provides()
8382
protected function getPath($path = '')
8483
{
8584
// We get the child class
86-
$rc = new ReflectionClass(get_class($this));
85+
$rc = new \ReflectionClass(get_class($this));
8786

8887
return dirname($rc->getFileName()) . '/../../' . $path;
8988
}

src/Theme.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Theme
4949
/**
5050
* The Parent theme.
5151
*/
52-
protected string | Theme | null $parent = null;
52+
protected string|Theme|null $parent = null;
5353

5454
/**
5555
* The theme statud (enabled or not).
@@ -219,7 +219,7 @@ public function hasParent(): bool
219219
/**
220220
* Set parent Theme.
221221
*/
222-
public function setParent(string | Theme | null $theme): self
222+
public function setParent(string|Theme|null $theme): self
223223
{
224224
$this->parent = empty($theme) ? null : $theme;
225225

@@ -229,7 +229,7 @@ public function setParent(string | Theme | null $theme): self
229229
/**
230230
* Get parent Theme.
231231
*/
232-
public function getParent(): Theme | null
232+
public function getParent(): Theme|null
233233
{
234234
if (is_string($this->parent)) {
235235
$this->parent = ThemesManager::findByName($this->parent);

src/ThemesManager.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public function current(): ?Theme
7979
return $this->themes
8080
->filter(function ($theme) {
8181
return $theme->enabled();
82-
})->first();
82+
})->first()
83+
;
8384
}
8485

8586
/**

0 commit comments

Comments
 (0)