Skip to content

Commit 1da357a

Browse files
chore(style): Fix code style
1 parent 3dbf088 commit 1da357a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/ThemesManager.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ThemesManager
2323
* @var string
2424
*/
2525
protected $basePath;
26-
26+
2727
/**
2828
* Scanned themes
2929
* @var Collection
@@ -36,7 +36,7 @@ class ThemesManager
3636
* @var \Illuminate\Contracts\Translation\Translator
3737
*/
3838
protected $lang;
39-
39+
4040
/**
4141
* View finder
4242
* @var \Illuminate\View\Factory
@@ -47,21 +47,21 @@ class ThemesManager
4747
* @var \Illuminate\Contracts\Filesystem\Filesystem
4848
*/
4949
private $files;
50-
50+
5151
/**
5252
* Engine compiler.
5353
*
5454
* @var array
5555
*/
5656
protected $compilers = array();
57-
57+
5858
public function __construct(Factory $view, Filesystem $files, Translator $lang)
5959
{
6060
$this->view = $view;
6161
$this->files = $files;
6262
$this->lang = $lang;
6363
$this->basePath = config('themes-manager.directory', 'themes');
64-
64+
6565
// Scan available themes per group
6666
try {
6767
$this->themes = $this->scan($this->basePath, Theme::class);
@@ -81,7 +81,7 @@ public function __construct(Factory $view, Filesystem $files, Translator $lang)
8181
return $this;
8282
}
8383
}
84-
84+
8585
/**
8686
* Get all themes for group
8787
*
@@ -122,7 +122,7 @@ public function get(string $name = null)
122122
});
123123
}
124124
}
125-
125+
126126
/**
127127
* Set current active theme
128128
*
@@ -132,19 +132,19 @@ public function get(string $name = null)
132132
*
133133
* @return ThemesManager
134134
*/
135-
public function set(string $name) : ThemesManager
135+
public function set(string $name): ThemesManager
136136
{
137137
if (!$this->has($name)) {
138138
throw new ThemeNotFoundException($name);
139139
}
140-
140+
141141
optional($this->current())->disable();
142142

143143
$this->enable($name);
144-
144+
145145
return $this;
146146
}
147-
147+
148148
/**
149149
* Get current theme for a group (current group if none provided).
150150
*
@@ -167,7 +167,7 @@ public function current()
167167
*
168168
* @return $this
169169
*/
170-
public function enable(string $name, bool $withEvent = true) : ThemesManager
170+
public function enable(string $name, bool $withEvent = true): ThemesManager
171171
{
172172
if ($theme = $this->get($name)) {
173173
$theme->enable($withEvent);
@@ -206,21 +206,21 @@ public function enable(string $name, bool $withEvent = true) : ThemesManager
206206
*
207207
* @return ThemesManager
208208
*/
209-
public function disable(string $name, bool $withEvent = true) : ThemesManager
209+
public function disable(string $name, bool $withEvent = true): ThemesManager
210210
{
211211
if ($theme = $this->get($name)) {
212212
$theme->disable($withEvent);
213213
}
214214

215215
return $this;
216216
}
217-
217+
218218
/**
219219
* @param type $asset
220220
*
221221
* @return string
222222
*/
223-
public function asset(string $asset, $absolutePath = false) : string
223+
public function asset(string $asset, $absolutePath = false): string
224224
{
225225
return $this->url($asset, $absolutePath);
226226
}
@@ -231,7 +231,7 @@ public function asset(string $asset, $absolutePath = false) : string
231231
* @param string $href
232232
* @return string
233233
*/
234-
public function style(string $asset, $absolutePath = false) : string
234+
public function style(string $asset, $absolutePath = false): string
235235
{
236236
return sprintf(
237237
'<link media="all" type="text/css" rel="stylesheet" href="%s">',
@@ -248,7 +248,7 @@ public function style(string $asset, $absolutePath = false) : string
248248
* @param string $level
249249
* @return string
250250
*/
251-
public function script(string $asset, string $mode = '', $absolutePath = false, string $type = 'text/javascript', string $level = 'functionality') : string
251+
public function script(string $asset, string $mode = '', $absolutePath = false, string $type = 'text/javascript', string $level = 'functionality'): string
252252
{
253253
return sprintf(
254254
'<script %s src="%s" data-type="%s" data-level="%s"></script>',
@@ -268,7 +268,7 @@ public function script(string $asset, string $mode = '', $absolutePath = false,
268268
* @param array $attributes
269269
* @return string
270270
*/
271-
public function image(string $asset, string $alt = '', string $class = '', array $attributes = [], $absolutePath = false) : string
271+
public function image(string $asset, string $alt = '', string $class = '', array $attributes = [], $absolutePath = false): string
272272
{
273273
return sprintf(
274274
'<img src="%s" alt="%s" class="%s" %s>',
@@ -293,15 +293,15 @@ public function mix($asset, $manifestDirectory = '')
293293
}
294294

295295
// Return url of current theme
296-
public function url(string $asset, $absolutePath = false) : ?string
296+
public function url(string $asset, $absolutePath = false): ?string
297297
{
298298
// Split asset name to find concerned theme name
299299
$assetParts = explode('::', $asset);
300300
if (count($assetParts) == 2) {
301301
$name = $assetParts[0];
302302
$asset = $assetParts[1];
303303
}
304-
304+
305305
// If no Theme set, return /$asset
306306
if (empty($name) && !$this->current()) {
307307
return '/' . ltrim($asset, '/');
@@ -329,7 +329,7 @@ private function htmlAttributes($attributes)
329329
return $key . '="' . $attributes[$key] . '"';
330330
}, array_keys($attributes)));
331331
}
332-
332+
333333
/**
334334
* @param Collection $themes
335335
*

0 commit comments

Comments
 (0)