Permalink
Browse files

initial commit

  • Loading branch information...
Lucas Krause
Lucas Krause committed Feb 17, 2015
1 parent 3dbbfb6 commit 09c088db20e35579b79fb5acf3434f12f5eb040c
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
Binary file not shown.
View

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,42 @@
+<?php
+namespace futape\gustav;
+
+require_once implode(DIRECTORY_SEPARATOR, array(rtrim(__DIR__, DIRECTORY_SEPARATOR), "GustavBase.php"));
+
+use BadMethodCallException;
+
+abstract class GustavBaseHooks extends GustavBase {
+
+
+
+ #misc-functions#
+
+ #GustavHooks::__callStatic()#
+ /**
+ * A "magic" overloading function that gets called when an class's non-reachable function is called.
+ * This function is used to make all non-reachable static function of the GustavBase class publically
+ * available.
+ * If a non-existing function is called, a BadMethodCallException exception is thrown.
+ *
+ * @param string $function_name The name of the called function.
+ * @param array $arguments The arguments passed to the called function.
+ *
+ * @return mixed
+ */
+ public static function __callStatic($str_fn, $arr_args){
+ if(method_exists(__CLASS__, $str_fn)){
+ return call_user_func_array(array(__CLASS__, $str_fn), $arr_args);
+ }
+
+ if(method_exists(get_parent_class(), "__callStatic")){
+ $arr_args_b=func_get_args();
+
+ return call_user_func_array(array(get_parent_class(), "__callStatic"), $arr_args_b);
+ }
+
+ throw new BadMethodCallException("Method doesn't exist.");
+ }
+
+
+
+}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,42 @@
+<?php
+namespace futape\gustav;
+
+require_once implode(DIRECTORY_SEPARATOR, array(rtrim(__DIR__, DIRECTORY_SEPARATOR), "GustavBlock.php"));
+
+use BadMethodCallException;
+
+abstract class GustavBlockHooks extends GustavBlock {
+
+
+
+ #misc-functions#
+
+ #GustavHooks::__callStatic()#
+ /**
+ * A "magic" overloading function that gets called when an class's non-reachable function is called.
+ * This function is used to make all non-reachable static function of the GustavBlock class publically
+ * available.
+ * If a non-existing function is called, a BadMethodCallException exception is thrown.
+ *
+ * @param string $function_name The name of the called function.
+ * @param array $arguments The arguments passed to the called function.
+ *
+ * @return mixed
+ */
+ public static function __callStatic($str_fn, $arr_args){
+ if(method_exists(__CLASS__, $str_fn)){
+ return call_user_func_array(array(__CLASS__, $str_fn), $arr_args);
+ }
+
+ if(method_exists(get_parent_class(), "__callStatic")){
+ $arr_args_b=func_get_args();
+
+ return call_user_func_array(array(get_parent_class(), "__callStatic"), $arr_args_b);
+ }
+
+ throw new BadMethodCallException("Method doesn't exist.");
+ }
+
+
+
+}
Oops, something went wrong.

0 comments on commit 09c088d

Please sign in to comment.