Skip to content

Commit e6cb155

Browse files
Apply fixes from StyleCI (#9)
Co-authored-by: StyleCI Bot <[email protected]>
1 parent 19f9251 commit e6cb155

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Assets.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function addStylesDirectly(array|string $assets, array $attributes = []):
6161
foreach ((array)$assets as &$item) {
6262
$item = ltrim(trim($item), '/');
6363

64-
if (! in_array($item, $this->appendedStyles)) {
64+
if (!in_array($item, $this->appendedStyles)) {
6565
$this->appendedStyles[$item] = [
6666
'src' => $item,
6767
'attributes' => $attributes,
@@ -73,14 +73,14 @@ public function addStylesDirectly(array|string $assets, array $attributes = []):
7373
}
7474

7575
public function addScriptsDirectly(
76-
array|string $assets,
77-
string $location = self::ASSETS_SCRIPT_POSITION_FOOTER,
76+
array|string $assets,
77+
string $location = self::ASSETS_SCRIPT_POSITION_FOOTER,
7878
array $attributes = []
7979
): static {
8080
foreach ((array)$assets as &$item) {
8181
$item = ltrim(trim($item), '/');
8282

83-
if (! in_array($item, $this->appendedScripts[$location])) {
83+
if (!in_array($item, $this->appendedScripts[$location])) {
8484
$this->appendedScripts[$location][$item] = [
8585
'src' => $item,
8686
'attributes' => $attributes,
@@ -133,7 +133,7 @@ public function removeItemDirectly(array|string $assets, ?string $location = nul
133133
$item = ltrim(trim($item), '/');
134134

135135
if (
136-
$location
136+
$location
137137
&& in_array($location, [self::ASSETS_SCRIPT_POSITION_HEADER, self::ASSETS_SCRIPT_POSITION_FOOTER])
138138
) {
139139
Arr::forget($this->appendedScripts[$location], $item);
@@ -158,7 +158,7 @@ public function getScripts(?string $location = null): array
158158
foreach ($this->scripts as $script) {
159159
$configName = 'resources.scripts.' . $script;
160160

161-
if (! empty($location) && $location !== Arr::get($this->config, $configName . '.location')) {
161+
if (!empty($location) && $location !== Arr::get($this->config, $configName . '.location')) {
162162
continue; // Skip assets that don't match this location
163163
}
164164

@@ -174,7 +174,7 @@ public function getScripts(?string $location = null): array
174174
public function getStyles(array $lastStyles = []): array
175175
{
176176
$styles = [];
177-
if (! empty($lastStyles)) {
177+
if (!empty($lastStyles)) {
178178
$this->styles = array_merge($this->styles, $lastStyles);
179179
}
180180

@@ -226,13 +226,13 @@ protected function itemToHtml(string $name, string $type = 'style'): string
226226
{
227227
$html = '';
228228

229-
if (! in_array($type, ['style', 'script'])) {
229+
if (!in_array($type, ['style', 'script'])) {
230230
return $html;
231231
}
232232

233233
$configName = 'resources.' . $type . 's.' . $name;
234234

235-
if (! Arr::has($this->config, $configName)) {
235+
if (!Arr::has($this->config, $configName)) {
236236
return $html;
237237
}
238238

@@ -250,7 +250,7 @@ protected function itemToHtml(string $name, string $type = 'style'): string
250250
*/
251251
protected function getSourceUrl(string $configName)
252252
{
253-
if (! Arr::has($this->config, $configName)) {
253+
if (!Arr::has($this->config, $configName)) {
254254
return '';
255255
}
256256

@@ -265,7 +265,7 @@ protected function getSourceUrl(string $configName)
265265

266266
protected function isUsingCdn(string $configName): bool
267267
{
268-
return Arr::get($this->config, $configName . '.use_cdn', false) && ! $this->config['offline'];
268+
return Arr::get($this->config, $configName . '.use_cdn', false) && !$this->config['offline'];
269269
}
270270

271271
protected function getSource(string $configName, ?string $location = null): array
@@ -279,7 +279,7 @@ protected function getSource(string $configName, ?string $location = null): arra
279279
$scripts = [];
280280

281281
foreach ((array)$src as $s) {
282-
if (! $s) {
282+
if (!$s) {
283283
continue;
284284
}
285285

src/HtmlBuilder.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(UrlGenerator $urlGenerator)
1919
*/
2020
public function script(string $url, array $attributes = [], ?bool $secure = null): HtmlString
2121
{
22-
if (! $url) {
22+
if (!$url) {
2323
return new HtmlString();
2424
}
2525

@@ -33,7 +33,7 @@ public function script(string $url, array $attributes = [], ?bool $secure = null
3333
*/
3434
public function style(string $url, array $attributes = [], ?bool $secure = null): HtmlString
3535
{
36-
if (! $url) {
36+
if (!$url) {
3737
return new HtmlString();
3838
}
3939

@@ -92,7 +92,7 @@ protected function attributeElement(string $key, array|bool|string|null $value)
9292
return 'class="' . implode(' ', $value) . '"';
9393
}
9494

95-
if (! empty($value)) {
95+
if (!empty($value)) {
9696
return $key . '="' . e($value, false) . '"';
9797
}
9898

0 commit comments

Comments
 (0)