File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 99trait HooksTrait
1010{
1111 /**
12- * Вызов метода при наличии. Для хуков событий.
12+ * Вызов метода при наличии.
1313 * @param string имя метода
1414 * @param mixed аргумент метода
1515 */
@@ -22,4 +22,19 @@ protected function hook(string $methodName, ...$methodArgs)
2222 call_user_func_array ([$ this , $ methodName ], $ methodArgs );
2323 }
2424 }
25+
26+ /**
27+ * Вызов статического метода при наличии.
28+ * @param string имя метода
29+ * @param mixed аргумент метода
30+ */
31+ protected static function staticHook (string $ methodName , ...$ methodArgs )
32+ {
33+ if (defined ('EVAS_DEBUG ' ) && true == EVAS_DEBUG ) {
34+ echo $ methodName . ('cli ' == PHP_SAPI ? "\n" : '<br> ' );
35+ }
36+ if (method_exists (static ::class, $ methodName )) {
37+ call_user_func_array ([static ::class, $ methodName ], $ methodArgs );
38+ }
39+ }
2540}
You can’t perform that action at this time.
0 commit comments