diff --git a/http-server/Server.php b/http-server/Server.php index c30a8d64..451e7bc2 100644 --- a/http-server/Server.php +++ b/http-server/Server.php @@ -123,7 +123,6 @@ class Server extends Application $application = Snowflake::get(); foreach ($processes as $name => $process) { $class = Snowflake::createObject($process); - if (!method_exists($class, 'onHandler')) { continue; } diff --git a/system/Abstracts/IListener.php b/system/Abstracts/IListener.php new file mode 100644 index 00000000..2de2c219 --- /dev/null +++ b/system/Abstracts/IListener.php @@ -0,0 +1,16 @@ +params = $params; + } + + + /** + * @return mixed + * @throws Exception + */ + public function toArray() + { + if (!is_array($this->params)) { + return ArrayAccess::toArray($this->params); + } + return $this->params; + } + + + /** + * @param $name + * @return mixed|null + * @throws Exception + */ + public function get($name) + { + $array = $this->toArray(); + if (!isset($array[$name])) { + return null; + } + return $array[$name]; + } + + +}