@@ -49,7 +49,7 @@ final class OnRequestHandler
4949 /**
5050 * @var bool
5151 */
52- public $ isFullPath = TRUE ;
52+ public $ isFullPath = true ;
5353
5454 /**
5555 * @var Http\IRequest
@@ -207,27 +207,27 @@ public function __invoke(Application\Application $application) : void
207207 private function hasPhoneRedirect () : bool
208208 {
209209 if (!$ this ->redirectConf ['phone ' ]['isEnabled ' ]) {
210- return FALSE ;
210+ return false ;
211211 }
212212
213213 $ isPhone = $ this ->mobileDetect ->isPhone ();
214214
215- if ($ this ->redirectConf ['detectPhoneAsMobile ' ] === FALSE ) {
215+ if ($ this ->redirectConf ['detectPhoneAsMobile ' ] === false ) {
216216 $ isPhoneHost = ($ this ->getCurrentHost () === $ this ->redirectConf ['phone ' ]['host ' ]);
217217
218218 if ($ isPhone && !$ isPhoneHost && ($ this ->getRoutingOption (self ::PHONE ) != self ::NO_REDIRECT )) {
219- return TRUE ;
219+ return true ;
220220 }
221221
222222 } else {
223223 $ isMobileHost = ($ this ->getCurrentHost () === $ this ->redirectConf ['mobile ' ]['host ' ]);
224224
225225 if ($ isPhone && !$ isMobileHost && ($ this ->getRoutingOption (self ::PHONE ) != self ::NO_REDIRECT )) {
226- return TRUE ;
226+ return true ;
227227 }
228228 }
229229
230- return FALSE ;
230+ return false ;
231231 }
232232
233233 /**
@@ -238,27 +238,27 @@ private function hasPhoneRedirect() : bool
238238 private function hasTabletRedirect () : bool
239239 {
240240 if (!$ this ->redirectConf ['tablet ' ]['isEnabled ' ]) {
241- return FALSE ;
241+ return false ;
242242 }
243243
244244 $ isTablet = $ this ->mobileDetect ->isTablet ();
245245
246- if ($ this ->redirectConf ['detectTabletAsMobile ' ] === FALSE ) {
246+ if ($ this ->redirectConf ['detectTabletAsMobile ' ] === false ) {
247247 $ isTabletHost = ($ this ->getCurrentHost () === $ this ->redirectConf ['tablet ' ]['host ' ]);
248248
249249 if ($ isTablet && !$ isTabletHost && ($ this ->getRoutingOption (self ::TABLET ) != self ::NO_REDIRECT )) {
250- return TRUE ;
250+ return true ;
251251 }
252252
253253 } else {
254254 $ isMobileHost = ($ this ->getCurrentHost () === $ this ->redirectConf ['mobile ' ]['host ' ]);
255255
256256 if ($ isTablet && !$ isMobileHost && ($ this ->getRoutingOption (self ::TABLET ) != self ::NO_REDIRECT )) {
257- return TRUE ;
257+ return true ;
258258 }
259259 }
260260
261- return FALSE ;
261+ return false ;
262262 }
263263
264264 /**
@@ -269,13 +269,13 @@ private function hasTabletRedirect() : bool
269269 private function hasMobileRedirect () : bool
270270 {
271271 if (!$ this ->redirectConf ['mobile ' ]['isEnabled ' ]) {
272- return FALSE ;
272+ return false ;
273273 }
274274
275- if ($ this ->redirectConf ['detectPhoneAsMobile ' ] === FALSE ) {
275+ if ($ this ->redirectConf ['detectPhoneAsMobile ' ] === false ) {
276276 $ isMobile = ($ this ->mobileDetect ->isTablet () || ($ this ->mobileDetect ->isMobile ()) && !$ this ->mobileDetect ->isPhone ());
277277
278- } elseif ($ this ->redirectConf ['detectTabletAsMobile ' ] === FALSE ) {
278+ } elseif ($ this ->redirectConf ['detectTabletAsMobile ' ] === false ) {
279279 $ isMobile = ($ this ->mobileDetect ->isPhone () || ($ this ->mobileDetect ->isMobile ()) && !$ this ->mobileDetect ->isTablet ());
280280
281281 } else {
@@ -285,10 +285,10 @@ private function hasMobileRedirect() : bool
285285 $ isMobileHost = ($ this ->getCurrentHost () === $ this ->redirectConf ['mobile ' ]['host ' ]);
286286
287287 if ($ isMobile && !$ isMobileHost && ($ this ->getRoutingOption (self ::MOBILE ) != self ::NO_REDIRECT )) {
288- return TRUE ;
288+ return true ;
289289 }
290290
291- return FALSE ;
291+ return false ;
292292 }
293293
294294 /**
@@ -298,15 +298,15 @@ private function hasMobileRedirect() : bool
298298 */
299299 private function needPhoneResponseModify () : bool
300300 {
301- if (($ this ->deviceView ->getViewType () === NULL || $ this ->deviceView ->isPhoneView ()) && $ this ->mobileDetect ->isMobile () && !$ this ->mobileDetect ->isTablet ()) {
301+ if (($ this ->deviceView ->getViewType () === null || $ this ->deviceView ->isPhoneView ()) && $ this ->mobileDetect ->isMobile () && !$ this ->mobileDetect ->isTablet ()) {
302302 $ this ->onResponseHandler ->modifyResponseClosure = function (Helpers \DeviceView $ deviceView ) : Http \IResponse {
303303 return $ deviceView ->modifyPhoneResponse ();
304304 };
305305
306- return TRUE ;
306+ return true ;
307307 }
308308
309- return FALSE ;
309+ return false ;
310310 }
311311
312312 /**
@@ -316,15 +316,15 @@ private function needPhoneResponseModify() : bool
316316 */
317317 private function needTabletResponseModify () : bool
318318 {
319- if (($ this ->deviceView ->getViewType () === NULL || $ this ->deviceView ->isTabletView ()) && $ this ->mobileDetect ->isTablet ()) {
319+ if (($ this ->deviceView ->getViewType () === null || $ this ->deviceView ->isTabletView ()) && $ this ->mobileDetect ->isTablet ()) {
320320 $ this ->onResponseHandler ->modifyResponseClosure = function (Helpers \DeviceView $ deviceView ) : Http \IResponse {
321321 return $ deviceView ->modifyTabletResponse ();
322322 };
323323
324- return TRUE ;
324+ return true ;
325325 }
326326
327- return FALSE ;
327+ return false ;
328328 }
329329
330330 /**
@@ -334,15 +334,15 @@ private function needTabletResponseModify() : bool
334334 */
335335 private function needMobileResponseModify () : bool
336336 {
337- if (($ this ->deviceView ->getViewType () === NULL || $ this ->deviceView ->isMobileView ()) && $ this ->mobileDetect ->isMobile ()) {
337+ if (($ this ->deviceView ->getViewType () === null || $ this ->deviceView ->isMobileView ()) && $ this ->mobileDetect ->isMobile ()) {
338338 $ this ->onResponseHandler ->modifyResponseClosure = function (Helpers \DeviceView $ deviceView ) : Http \IResponse {
339339 return $ deviceView ->modifyMobileResponse ();
340340 };
341341
342- return TRUE ;
342+ return true ;
343343 }
344344
345- return FALSE ;
345+ return false ;
346346 }
347347
348348 /**
@@ -352,15 +352,15 @@ private function needMobileResponseModify() : bool
352352 */
353353 private function needNotMobileResponseModify () : bool
354354 {
355- if ($ this ->deviceView ->getViewType () === NULL || $ this ->deviceView ->isNotMobileView ()) {
355+ if ($ this ->deviceView ->getViewType () === null || $ this ->deviceView ->isNotMobileView ()) {
356356 $ this ->onResponseHandler ->modifyResponseClosure = function (Helpers \DeviceView $ deviceView ) : Http \IResponse {
357357 return $ deviceView ->modifyNotMobileResponse ();
358358 };
359359
360- return TRUE ;
360+ return true ;
361361 }
362362
363- return FALSE ;
363+ return false ;
364364 }
365365
366366 /**
@@ -371,12 +371,12 @@ private function needNotMobileResponseModify() : bool
371371 private function getRedirectResponseBySwitchParam () : Responses \RedirectResponse
372372 {
373373 // Generate full url path
374- if ($ this ->isFullPath === TRUE ) {
374+ if ($ this ->isFullPath === true ) {
375375 // Get actual url
376376 $ url = $ this ->httpRequest ->getUrl ();
377377
378378 // Remove switch param
379- $ url ->setQueryParameter ($ this ->deviceView ->getSwitchParameterName (), NULL );
379+ $ url ->setQueryParameter ($ this ->deviceView ->getSwitchParameterName (), null );
380380
381381 // Create full path url
382382 $ redirectUrl = $ this ->getCurrentHost () . $ url ->getRelativeUrl ();
@@ -405,7 +405,7 @@ private function getDeviceRedirectResponse(string $device) : ?Responses\Redirect
405405 );
406406 }
407407
408- return NULL ;
408+ return null ;
409409 }
410410
411411 /**
@@ -427,7 +427,7 @@ private function getRedirectUrl(string $platform) : ?string
427427 }
428428 }
429429
430- return NULL ;
430+ return null ;
431431 }
432432
433433 /**
@@ -439,14 +439,14 @@ private function getRedirectUrl(string $platform) : ?string
439439 */
440440 private function getRoutingOption (string $ name ) : ?string
441441 {
442- $ option = NULL ;
442+ $ option = null ;
443443
444444 // Get actual route
445445 $ request = $ this ->router ->match ($ this ->httpRequest );
446446
447447 if ($ request instanceof Application \Request) {
448448 $ params = $ request ->getParameters ();
449- $ option = isset ($ params [$ name ]) ? $ params [$ name ] : NULL ;
449+ $ option = isset ($ params [$ name ]) ? $ params [$ name ] : null ;
450450 }
451451
452452 if (!$ option ) {
@@ -457,7 +457,7 @@ private function getRoutingOption(string $name) : ?string
457457 return $ option ;
458458 }
459459
460- return NULL ;
460+ return null ;
461461 }
462462
463463 /**
0 commit comments