@@ -345,7 +345,7 @@ public static function image(?string $handler = null, ?Images $config = null, bo
345345 $ config ??= config (Images::class);
346346 assert ($ config instanceof Images);
347347
348- $ handler = $ handler !== null && $ handler !== '' && $ handler !== '0 ' ? $ handler : $ config ->defaultHandler ;
348+ $ handler = in_array ( $ handler, [ null , '' , '0 ' ], true ) ? $ config ->defaultHandler : $ handler ;
349349 $ class = $ config ->handlers [$ handler ];
350350
351351 return new $ class ($ config );
@@ -385,7 +385,7 @@ public static function language(?string $locale = null, bool $getShared = true)
385385 }
386386
387387 // Use '?:' for empty string check
388- $ locale = $ locale !== null && $ locale !== '' && $ locale !== '0 ' ? $ locale : $ requestLocale ;
388+ $ locale = in_array ( $ locale, [ null , '' , '0 ' ], true ) ? $ requestLocale : $ locale ;
389389
390390 return new Language ($ locale );
391391 }
@@ -484,7 +484,7 @@ public static function parser(?string $viewPath = null, ?ViewConfig $config = nu
484484 return static ::getSharedInstance ('parser ' , $ viewPath , $ config );
485485 }
486486
487- $ viewPath = $ viewPath !== null && $ viewPath !== '' && $ viewPath !== '0 ' ? $ viewPath : (new Paths ())->viewDirectory ;
487+ $ viewPath = in_array ( $ viewPath, [ null , '' , '0 ' ], true ) ? (new Paths ())->viewDirectory : $ viewPath ;
488488 $ config ??= config (ViewConfig::class);
489489
490490 return new Parser ($ config , $ viewPath , AppServices::get ('locator ' ), CI_DEBUG , AppServices::get ('logger ' ));
@@ -503,7 +503,7 @@ public static function renderer(?string $viewPath = null, ?ViewConfig $config =
503503 return static ::getSharedInstance ('renderer ' , $ viewPath , $ config );
504504 }
505505
506- $ viewPath = $ viewPath !== null && $ viewPath !== '' && $ viewPath !== '0 ' ? $ viewPath : (new Paths ())->viewDirectory ;
506+ $ viewPath = in_array ( $ viewPath, [ null , '' , '0 ' ], true ) ? (new Paths ())->viewDirectory : $ viewPath ;
507507 $ config ??= config (ViewConfig::class);
508508
509509 return new View ($ config , $ viewPath , AppServices::get ('locator ' ), CI_DEBUG , AppServices::get ('logger ' ));
0 commit comments