@@ -200,12 +200,7 @@ public function isDirectAccessFrontendName($code)
200
200
public function getBasePath ()
201
201
{
202
202
$ path = parent ::getBasePath ();
203
- if (empty ($ path )) {
204
- $ path = '/ ' ;
205
- } else {
206
- $ path = str_replace ('\\' , '/ ' , $ path );
207
- }
208
- return $ path ;
203
+ return empty ($ path ) ? '/ ' : str_replace ('\\' , '/ ' , $ path );
209
204
}
210
205
211
206
/**
@@ -298,10 +293,9 @@ public function getBeforeForwardInfo($name = null)
298
293
{
299
294
if ($ name === null ) {
300
295
return $ this ->beforeForwardInfo ;
301
- } elseif (isset ($ this ->beforeForwardInfo [$ name ])) {
302
- return $ this ->beforeForwardInfo [$ name ];
303
296
}
304
- return null ;
297
+
298
+ return $ this ->beforeForwardInfo [$ name ] ?? null ;
305
299
}
306
300
307
301
/**
@@ -311,13 +305,9 @@ public function getBeforeForwardInfo($name = null)
311
305
*/
312
306
public function isAjax ()
313
307
{
314
- if ($ this ->isXmlHttpRequest ()) {
315
- return true ;
316
- }
317
- if ($ this ->getParam ('ajax ' ) || $ this ->getParam ('isAjax ' )) {
318
- return true ;
319
- }
320
- return false ;
308
+ return $ this ->isXmlHttpRequest ()
309
+ || $ this ->getParam ('ajax ' )
310
+ || $ this ->getParam ('isAjax ' );
321
311
}
322
312
323
313
/**
@@ -365,7 +355,7 @@ public static function getDistroBaseUrlPath($server)
365
355
$ result = '' ;
366
356
if (isset ($ server ['SCRIPT_NAME ' ])) {
367
357
$ envPath = str_replace ('\\' , '/ ' , dirname (str_replace ('\\' , '/ ' , $ server ['SCRIPT_NAME ' ])));
368
- if ($ envPath != '. ' && $ envPath != '/ ' ) {
358
+ if ($ envPath !== '. ' && $ envPath != = '/ ' ) {
369
359
$ result = $ envPath ;
370
360
}
371
361
}
0 commit comments