@@ -295,7 +295,7 @@ public static function error(): Hook
295295 * @param string|null $default
296296 * @return string|null
297297 */
298- public static function getEnv (string $ key , string $ default = null ): ?string
298+ public static function getEnv (string $ key , ? string $ default = null ): ?string
299299 {
300300 return $ _SERVER [$ key ] ?? $ default ;
301301 }
@@ -366,7 +366,7 @@ public function getResource(string $name, string $context = 'utopia', bool $fres
366366 $ this ->resources [$ context ] ??= [];
367367
368368 $ resourcesCallback = &self ::$ resourcesCallbacks [$ context ] ?? [];
369- if (empty ($ resourcesCallback ) || !\array_key_exists ($ name , $ resourcesCallback )) {
369+ if (empty ($ resourcesCallback ) || !\array_key_exists ($ name , $ resourcesCallback )) {
370370 $ resourcesCallback = &self ::$ resourcesCallbacks ['utopia ' ];
371371 }
372372
@@ -514,7 +514,7 @@ public static function addRoute(string $method, string $url): Route
514514 *
515515 * @throws \Exception
516516 */
517- public function loadFiles (string $ directory , string $ root = null ): void
517+ public function loadFiles (string $ directory , ? string $ root = null ): void
518518 {
519519 $ this ->files ->load ($ directory , $ root );
520520 }
@@ -576,7 +576,7 @@ public function start()
576576 try {
577577 $ this ->run ($ request , $ response , $ context );
578578 } finally {
579- if (isset (self ::$ resourcesCallbacks [$ context ])) {
579+ if (isset (self ::$ resourcesCallbacks [$ context ])) {
580580 unset(self ::$ resourcesCallbacks [$ context ]);
581581 }
582582 }
@@ -593,7 +593,7 @@ public function start()
593593 $ arguments = $ this ->getArguments ($ hook , 'utopia ' , [], []);
594594 \call_user_func_array ($ hook ->getAction (), $ arguments );
595595 }
596- } catch (\Exception $ e ) {
596+ } catch (\Exception $ e ) {
597597 self ::setResource ('error ' , fn () => $ e );
598598
599599 foreach (self ::$ errors as $ error ) { // Global error hooks
@@ -793,7 +793,7 @@ public function run(Request $request, Response $response, string $context): stat
793793 $ arguments = $ this ->getArguments ($ hook , $ context , [], []);
794794 \call_user_func_array ($ hook ->getAction (), $ arguments );
795795 }
796- } catch (\Exception $ e ) {
796+ } catch (\Exception $ e ) {
797797 self ::setResource ('error ' , fn () => $ e , [], $ context );
798798
799799 foreach (self ::$ errors as $ error ) { // Global error hooks
0 commit comments