@@ -12,11 +12,6 @@ class Bref
1212{
1313 private static ?Closure $ containerProvider = null ;
1414 private static ?ContainerInterface $ container = null ;
15- /** @deprecated Use Bref::events()->subscribe() instead */
16- private static array $ hooks = [
17- 'beforeStartup ' => [],
18- 'beforeInvoke ' => [],
19- ];
2015 private static EventDispatcher $ eventDispatcher ;
2116
2217 /**
@@ -37,46 +32,6 @@ public static function events(): EventDispatcher
3732 return self ::$ eventDispatcher ;
3833 }
3934
40- /**
41- * Register a hook to be executed before the runtime starts.
42- *
43- * Warning: hooks are low-level extension points to be used by framework
44- * integrations. For user code, it is not recommended to use them. Use your
45- * framework's extension points instead.
46- *
47- * @deprecated Use Bref::events()->subscribe() instead.
48- */
49- public static function beforeStartup (Closure $ hook ): void
50- {
51- self ::$ hooks ['beforeStartup ' ][] = $ hook ;
52- }
53-
54- /**
55- * Register a hook to be executed before any Lambda invocation.
56- *
57- * Warning: hooks are low-level extension points to be used by framework
58- * integrations. For user code, it is not recommended to use them. Use your
59- * framework's extension points instead.
60- *
61- * @deprecated Use Bref::events()->subscribe() instead.
62- */
63- public static function beforeInvoke (Closure $ hook ): void
64- {
65- self ::$ hooks ['beforeInvoke ' ][] = $ hook ;
66- }
67-
68- /**
69- * @param 'beforeStartup'|'beforeInvoke' $hookName
70- *
71- * @internal Used by the Bref runtime
72- */
73- public static function triggerHooks (string $ hookName ): void
74- {
75- foreach (self ::$ hooks [$ hookName ] as $ hook ) {
76- $ hook ();
77- }
78- }
79-
8035 /**
8136 * @internal Used by the Bref runtime
8237 */
@@ -103,10 +58,6 @@ public static function reset(): void
10358 {
10459 self ::$ containerProvider = null ;
10560 self ::$ container = null ;
106- self ::$ hooks = [
107- 'beforeStartup ' => [],
108- 'beforeInvoke ' => [],
109- ];
11061 self ::$ eventDispatcher = new EventDispatcher ;
11162 }
11263}
0 commit comments