@@ -44,24 +44,24 @@ public function __construct(Repository $config, HtmlBuilder $htmlBuilder)
4444
4545 public function addScripts (array |string $ assets ): static
4646 {
47- $ this ->scripts = array_merge ($ this ->scripts , (array )$ assets );
47+ $ this ->scripts = array_merge ($ this ->scripts , (array ) $ assets );
4848
4949 return $ this ;
5050 }
5151
5252 public function addStyles (array |string $ assets ): static
5353 {
54- $ this ->styles = array_merge ($ this ->styles , (array )$ assets );
54+ $ this ->styles = array_merge ($ this ->styles , (array ) $ assets );
5555
5656 return $ this ;
5757 }
5858
5959 public function addStylesDirectly (array |string $ assets , array $ attributes = []): static
6060 {
61- foreach ((array )$ assets as &$ item ) {
61+ 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 ,
@@ -77,10 +77,10 @@ public function addScriptsDirectly(
7777 string $ location = self ::ASSETS_SCRIPT_POSITION_FOOTER ,
7878 array $ attributes = []
7979 ): static {
80- foreach ((array )$ assets as &$ item ) {
80+ 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 ,
@@ -97,7 +97,7 @@ public function removeStyles(array|string $assets): static
9797 return $ this ;
9898 }
9999
100- foreach ((array )$ assets as $ rem ) {
100+ foreach ((array ) $ assets as $ rem ) {
101101 $ index = array_search ($ rem , $ this ->styles );
102102 if ($ index === false ) {
103103 continue ;
@@ -115,7 +115,7 @@ public function removeScripts(array|string $assets): static
115115 return $ this ;
116116 }
117117
118- foreach ((array )$ assets as $ rem ) {
118+ foreach ((array ) $ assets as $ rem ) {
119119 $ index = array_search ($ rem , $ this ->scripts );
120120 if ($ index === false ) {
121121 continue ;
@@ -129,7 +129,7 @@ public function removeScripts(array|string $assets): static
129129
130130 public function removeItemDirectly (array |string $ assets , ?string $ location = null ): static
131131 {
132- foreach ((array )$ assets as $ item ) {
132+ foreach ((array ) $ assets as $ item ) {
133133 $ item = ltrim (trim ($ item ), '/ ' );
134134
135135 if (
@@ -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,19 +226,19 @@ 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
239239 $ src = $ this ->getSourceUrl ($ configName );
240240
241- foreach ((array )$ src as $ item ) {
241+ foreach ((array ) $ src as $ item ) {
242242 $ html .= $ this ->htmlBuilder ->{$ type }($ item , ['class ' => 'hidden ' ])->toHtml ();
243243 }
244244
@@ -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
@@ -278,8 +278,8 @@ protected function getSource(string $configName, ?string $location = null): arra
278278
279279 $ scripts = [];
280280
281- foreach ((array )$ src as $ s ) {
282- if (!$ s ) {
281+ foreach ((array ) $ src as $ s ) {
282+ if (! $ s ) {
283283 continue ;
284284 }
285285
0 commit comments